Forum

Thread tagged as: Question, Problem

Specifying a different attributes template?

Setting a specific set of attributes in Perch has never worked for me:

I place this in the head of the template:

<?php
    perch_page_attributes(array(
        'template' => 'new_attributes.html'
    ));
?>

Perch ignore this and goes with the default.html attributes template only.

Has anyone had this working, and might be able to give us a pointer?

Tony Astley

Tony Astley 0 points

  • 3 years ago
Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hello Tony,

You should be able to change the attributes template through the control panel. Go to the page and under the Settings tab there's a field called "Attribute template".

Thanks Hussien,

I'm aware of that feature, however this is for the end user, not me.

That method is too convoluted, too many steps for the non-technical user.

I think Perch is very simple, however when I demo it to some users they think it's complicated.

Asking them create a page, submit the 'incomplete' page details, go into settings, change the attribute template, then go back into details to enter the 'correct' attributes has proved off-putting to my clients and according to the docs it should be possible the simpler.

Hence I end up throwing everything into default.html whether or not the page type requires it.

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

I think perch_page_attributes() only outputs to the page. I don't know of a way to set the attributes template right from the master page. Hopefully others can help.

Thanks Hussein,

I love Perch... 95% of it fits perfectly - there's just a few tiny bits that don't.

Your shop app is great by the way, the product list filters are extremely useful.

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hence I end up throwing everything into default.html whether or not the page type requires it.

If you find doing this gives the editors a better editing experience or is more suited to their technical level, why not! You can organise the template by grouping related fields and adding headings with divider-before.


Your shop app is great by the way, the product list filters are extremely useful.

Good to hear. I'm glad other developers are finding it useful.

I'm no developer! :-)