Thread tagged as: Question

Nesting content templates

Is there a way to nest content templates inside of perch?

Benjamin Cortes

Benjamin Cortes 0 points

  • 7 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

I'm not sure what you mean by "nesting". What problem are you trying to solve?

Rachel what I need to do is build biography pages, once those pages are built I want to use the same information but a small snippet of it so I can create a snippet of the biography in other locations.

This is the page I am building.

If you hover over the byline names you see a popup. I would want to use the information in here but pull it form another template which I have yet to create.

I basically need a json object that I can share via variables. How would I accomplish something like this with perch?

I forgot to ask Another reason is so I can repeat it right now I have all these tags repeating in my markup. I also do not have a way to enter an optional character so the word "and" is taking a ride with my hover and opening up the box. How would you recommend a solution for this?

I appreciate your support btw I have noticed that you guys answer a lot of questions.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Would it not just be a case of showing a subset of the same content through a simplified template?

One template will be a biography page. But then the writers want a way to preview a part of that information in the drop down byline. They don't want to enter the information twice. Is there a way I can do this?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Sure. Use perch_content_custom() to display the content from the biography page using a simplified template.

Thank you Drew I will read this documentation.