Forum
reuse id in template
I am trying to basically reuse an id in a template to add a navigation list but i think it's not the right way to do it... Beginner's question...
<ul>
<li><a href="#<perch:content id="any_id" type="text" label="Any Label"/>"><perch:content id="any_id" type="text" label="Any Label"/></a></li>
</ul>
<h2 id="<perch:content id="any_id" type="text" label="Any Label"/>"><perch:content id="any_id" type="text" label="Any Label"/></h2>
That's right, but you probably want to use a slug so caps/spaces/etc. don't break your ID:
My solution is not good as it's not working at all. Maybe i should investigate slugs that i never used before.
In what way is it not working? Is it not outputting to the page? Are other regions working and outputting?
Does this solution help?
https://solutions.grabaperch.com/html-and-css/how-do-i-create-a-faq
Thanks Rachel. I did it some other way because i am using blocks and repeaters but this tutorial helped me with the
perch_item_index
.My navigation is ok now.