Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hello

I need to get a list of all the editables of a clonable template automatically. I should have their name, their type, and if type checkbox, radio or dropdown also the opt_values.

Anyone an idea about how to get this with the php-tag?

Regards,
Olliwalli
Hi,

You may try try using the <cms:db_fields> tag -
Code: Select all
// Provides meta-info about fields in a template
<cms:db_fields>

// parameters
masterpage      /* required */
page_name       /* useful if also fetching data contained in the fields */
names           /* name(s) of fields to fetch (use comma to separate multiple values). Can have negation (e.g. NOT my_check) */
types           /* type(s) of fields to fetch (use comma to separate multiple values). Can have negation (e.g. NOT checkbox) */
skip_system     /* default is '1' */
skip_deleted    /* default is '1' */

Example -
Code: Select all
<cms:db_fields masterpage='blog.php' >
    <cms:dump />
</cms:db_fields>

You may also find @trendoman's usage of this tag useful -
viewtopic.php?f=4&t=11172#p29311

Hope this helps.
Thank you very much!
3 posts Page 1 of 1
cron