Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Hello I made a few templates on my homepage. When editing a repeatable I want to show a dropdown of all pages (templates) of my site. I want to get the URL of the template (site).
* * * * * * I LOVE COUCH CMS - flexible and straight forward * * * * * *
Hello chichi,

There is tag called cms:templates (http://www.couchcms.com/docs/tags-refer ... tes-1.html) that you can use to get the names and links of all templates in your site.

As to how to list these names in the admin-panel, you can use the technique described here -
viewtopic.php?f=4&t=1671&p=2483&hilit=dynamic_params#p2483

Hope this helps.
I did try this way:
my_dynamic_listalltemplates.htm in folder snippets
Code: Select all
Please Select=-
<cms:pages masterpage='listtemplatesinc.php'>
   | <cms:show k_template_name  />
</cms:pages>


listtemplatesinc.php in root folder
Code: Select all
<?php error_reporting(E_ERROR); require_once( 'couch/cms.php' ); ?>
<cms:template title='list templates' />
<cms:templates show_hidden='1' order='desc'>
    <cms:dump />
</cms:templates>
<?php COUCH::invoke(); ?>


menu.php in root folder
Code: Select all
<?php error_reporting(E_ERROR); require_once( 'couch/cms.php' ); ?>
<cms:template title='menu' />
<cms:repeatable name='menu' label='title'>
<cms:editable name="list all templates" label="all templates dropdown" opt_values='my_dynamic_listalltemplates.htm' dynamic='opt_values' type='dropdown' group='event_sensei'/>
</cms:repeatable>
<?php COUCH::invoke(); ?>


My output dropdown in each row looks like this:

----------------------
Please Select
listtemplatesinc.php
----------------------

Can you help me to list all k_template_name in the dropdown instead of showing me the name listtemplatesinc.php?
* * * * * * I LOVE COUCH CMS - flexible and straight forward * * * * * *
Hi chichi,

The second template, i.e. listtemplatesinc.php, is not required.

Please change the code in my_dynamic_listalltemplates.htm snippet to make it as follows
Code: Select all
Please Select=-
<cms:templates show_hidden='1' order='desc'>
    | <cms:show k_template_name  />
</cms:templates>

All templates should now get listed in menu.php.

Hope this helps.
This is it! They show up now and I am very happy. Thank you! :P
* * * * * * I LOVE COUCH CMS - flexible and straight forward * * * * * *
5 posts Page 1 of 1