Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
I want to be able to define an repeatable region in skins.php to define different skins (this can be used throughout the entire website), because I have several different themes of subjects and each gets a different color, another favicon, and has a theme name. (This may be extended in the future).
This is the code inside skins.php
Code: Select all
<?php require_once('couch/cms.php'); ?>
<cms:template title='Skins' executable='0'>
<cms:repeatable name='skins' >
        <cms:editable name='cat_name' label='Category Name' type='text' /><br/>
        <cms:editable name='favicon' label='Favicon' type="image" width='64' height='64'></cms:editable> <br/>
        <cms:editable name='color' label='Color' type='text'/>
    </cms:repeatable>
</cms:template>
<?php COUCH::invoke(); ?>


Then I want a dropdown into the pages to choose one of these skins (one place to define entire skin, each page can select a theme)
If I put this code into my blog-single.php snippet:
Code: Select all
<cms:set skinning="<cms:get_custom_field 'skins' masterpage='skins.php' />" />
<cms:show skinning />

I get some json output that clearly contains the values I've been using.
However when I do this:
Code: Select all
<cms:show_repeatable skinning >  
    <cms:show cat_name />
</cms:show_repeatable>

It seems to be empty. Maybe I need to decode the json at some point to access the cat_name?
How do I do that?

In the end my goal is to do something like this:
Code: Select all
 <cms:editable type='dropdown'
              name='skinning'
              label='Skinning'
              opt_values="
              <cms:show_repeatable skinning >
                    <cms:show cat_name /> |
              </cms:show_repeatable>
              "
              />


Would that be possible?
I would be such a hassle to define each skin in every page over and over again (especially since I plan to add values to it, but my main goal is to get this working first)... So this would be a very nice solution if I managed to get it to work :) Can someone help me or give me a hint what to look for? Thank you!
Hi,

I think you should find the following thread useful -
viewtopic.php?f=2&t=9510

Hope it helps.
hi cowgirl, @kk just got in as I was about to reply ... but I'll post anyway as my suggestion is different! From my understanding of your post you are after something I use quite a lot - which is to have a dropdown list of testimonials (a cloneable template) appearing on multiple other templates - so that the client can select and show testimonials across pages, whilst they are all stored in a single 'repository'.

My techniques is from http://www.couchcms.com/forum/viewtopic.php?f=4&t=8032&p=15209&hilit=dropdown+cloned+pages#p15209
Thank you KK & potato for the very fast & helpful answers! In this case I will be using the solution KK suggested (for now) (in this case I can add the pages tag with the repeatable region inside), but I certainly will keep in mind the suggestion potato gave, I feel it might come in handy some day when trying to select pages instead :)

Actually thinking about this even more, I realized that actually my folder structure (using dynamic folders) mimics the categories that have certain styles... I would be even more convenient to have this dropdown not at page level, but at folder level. Is this also possible within dynamic folders?
4 posts Page 1 of 1