Forum

Thread tagged as: Question

Solve adding a placeholder-item to a list (perch:every)

Hard to find a good subject for this one.

I have a list of employees in a grid, so I use perch:every to insert som extra divs for every third employee. Easy. But, as the last item in the list, I want a placeholder ("we want to employ you") item that should also count againt the "every third"-rule.

How do I do that?

See the dummy here

detail screenshot

Svein Are Gronsund

Svein Are Gronsund 0 points

  • 6 years ago

Could that be solved in the CSS?. Maybe try the pseudo-selector last-child?

(https://www.w3schools.com/cssref/sel_last-child.asp)

Simon Clay

Simon Clay 127 points

Can you post your template code?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I would just add it as a content item - it is content. If you don't want to do that, test the position in your <perch:after> section and then write out one or two extras.