Forum

Thread tagged as: Question, Configuration, Gallery

Additional fields in gallery

I would like to include some other fields like 'shared content' in my gallery template that are not standard gallery fields and I am trying to see if there work around way of doing this.

I have my output template b_static_image.html and have passed some extra fields through by adding them to image.html template but also want to add some general content that is the same for all images (product descriptions) without having to add it each time I add a new image but also still giving the client the facility to edit.

Tried rescope but that didn't work. Thought using the album description field and pass this through the template but that does not work either. Can this be displayed in my template? It has to be the template rather than the output php page, which is why I am having problems. Any ideas or shall I give up?

Denise Courtney

Denise Courtney 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Could you put the content in regular content regions and just pass them into the template?

I tried using perch:content but it didn't work. Can I use perch content in a perch gallery template? If so what I am doing wrong?

Drew McLellan

Drew McLellan 2638 points
Perch Support

No, you'd need to create a content region on the page. Return the result to a variable, then pass that into the template.

Can you give me an example please?

Drew McLellan

Drew McLellan 2638 points
Perch Support

$region = perch_content('My region', true);
PerchSystem::set_var('region_html', $region);

In the template:

<perch:gallery id="region_html" encode="false" />

Thank you very much I give that a go.

Sorry Drew but can I check where this should part should go to create my region...

$region = perch_content('My region', true); PerchSystem::set_var('region_html', $region);

Drew McLellan

Drew McLellan 2638 points
Perch Support

Where do you need it to be?

Well it will be on gallery/image.php which is dictated by template b_static_image.html.

Basically, I have a paypal form on the gallery template page which I want to adapt to editable content to the output to image.php

thank you.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, then place it on gallery/image.php.