Forum

Thread tagged as: Question

perch:before

I have a list with multiple items. Any way to hide the input field of perch:before for all items except the first in the back end? I find it's quite confusing. Thanks!

Martin Stettler

Martin Stettler 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What do you mean by "the input field of perch:before" ?

Perhaps showing us your template would help.

I mean my «title id». It is visible on every element although we set it only once. Here you find a screenshot: https://www.evernote.com/shard/s482/sh/a78d339a-a907-47e0-bab0-e2cc3ddd4e10/cc6bd3d145830415275d14becc1f84d6

And here's m template:

<perch:before> <ul class="default"><perch:content id="title" type="text" label="list-title"/> </perch:before> <li> <perch:content id="text" type="text" label="list entry" /> </li> <perch:after> </ul> </perch:after>

Many thanks!

Drew McLellan

Drew McLellan 2638 points
Perch Support

You shouldn't put content tags in perch:before or perch:after items in a master template.

Ok, thanks!

Rachel Andrew

Rachel Andrew 394 points
Perch Support

You could achieve what you are doing by using a regular perch text field and then putting your list items in a repeater. Then the title could be outside of the repeater completely.

https://docs.grabaperch.com/docs/templates/repeaters/

Another great answer, thanks for your support!