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
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:
I get some json output that clearly contains the values I've been using.
However when I do this:
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:
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!
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
