Transcript

In these videos we have looked at how to order content in regions. If you want to enable the editor to set the order rather than ordering things by a heading or other content displayed on the page we can do this by adding a field to our template that is only visible to editors and has no output to our page.

Using the sidebar module as an example again, I am adding a new Perch content tag. It is a text type with an ID of order and I have set the attribute suppress to true. Suppress means the field will show in admin but the value won’t get displayed on the page at runtime.


<perch:content id="order" type="text" label="Sort Order" suppress="true" />

Back in the admin we can add some sidebar items and just add a numeric value in the Sort Order field.

In the Options for the region we can choose to sort on this new field, ascending.

Our items are now sorted by the suppressed field value.

Perch by edgeofmyseat.com

Perch is a product developed and sold by edgeofmyseat Limited t/a edgeofmyseat.com Registered as a company in England and Wales, company registration no. 04735127