Forum
Display Single Region Item
Hey I'm curious if I can just show a single item from a template using perch_content_custom, without creating a separate template for it. For example, I have property listings, and I want the page title to show just the id="title" from the listing. Instead of creating a separate template with that item and calling it, can I just spit out that item's value in the perch_content_custom array? Thanks for your time!
You can either use a template (as you nearly always want to surround it in some sort of markup) or you can use the
skip-template
option to get the raw data without a template.Great thank you. So the skip-template returns the raw data, but is there a way to just show the value of one item from the region? Like is there a parameter within the custom array that will return the value of just one item?
No, it returns all the values, so you just pick the one you want.
Cool thanks. I'm having trouble getting skip-template to work in perch_custom. When I add "skip-template" => true, nothing is returned. Is there as example somewhere that I could see of proper usage? I'm sure I'm just leaving out something simple. Thanks!
Show us your code and we can help.
This is inside an include file that checks if the page is a property listing, then will add the listing title. I commented out the skip template line that causes it to break. The page is here: https://hometeaminvestors.com/homes/homeListing.php?item=emerald-estates
You have a typo - it's
skip-template
notslip-template
.You also need to assign it somewhere.