Forum
Editor select collection for display on page
Hi,
I have a really simple function on a Runway page that looks like this:
perch_collection('Things', [
'template' => 'collections/display'
]);
I would like to use this page as a master page, and allow the editor to add new pages and select different collections to be used (to replace Things
in the example above). What is the best way to give them a select box to choose the collection to be displayed on that page?
Many thanks
Mike
Yes, you can do that. The arguments are just strings, so they can be hardcoded or they can be dynamic if you choose.
You can use a region to allow editors to choose the collection they want to display:
As for the select field, I don't think there's an out-of-the-box select field that gets you a list of all the collections. If you know what the collections are, you can use a normal select field and hardcode the values: