passing variable into [type="select"] in template

  • Is is possible to pass a variable into a the options part of a select field type?

    example as follows, in perch all I see in the cms as a selectable option is <perch:content id="



    PerchSystem::set_vars(['pagesArr'=>'Page 1|url1.html, Page 2|url2.html']);

    perch_content_custom('Slide Content'); 


    perch template

    <perch:content id="heading" type="text" label="Heading">

    <perch:content id="pages" type="select" label="Pages" options="<perch:content id="pagesArr">">

  • drewm

    Approved the thread.
  • Sorry I am not sure I follow...

    doing like this still does not seem to work here is my code now:

    1. <?php
    2. PerchSystem::set_vars(['pagesArr'=>'Page 1|url1.html, Page 2|url2.html',]);
    3. perch_content_custom('Slide Content', []);
    4. ?>
    1. <perch:content type="select" options="<perch:content id="pagesArr">" id="links">

    Passing the string into the template works fine as I can see it print out on the template however is does not recognise passing the template tag within the template tag

  • Is there another method to achieve this then if the above is not possible? What I am trying to achieve is a select box in the cms with a list of urls for all siblings pages?