Dear Couchmembers,
I'm wondering if anyone knows how to dump all the custom field data of a given template.
I'm not looking to retrieve values (such as <cms:get_field 'my_field' masterpage='my-template.php' />). Rather, I'm hoping to list all the editable field names and all the data related to them, such as their editable type, what opt_values may be defined on them, etc.
Something like:
I'm wondering if anyone knows how to dump all the custom field data of a given template.
I'm not looking to retrieve values (such as <cms:get_field 'my_field' masterpage='my-template.php' />). Rather, I'm hoping to list all the editable field names and all the data related to them, such as their editable type, what opt_values may be defined on them, etc.
Something like:
- Code: Select all
<cms:pages masterapge='my-template.php'>
<cms:dump_custom_field_data />
</cms:pages>
// Output
# custom field data:
*my_text*:
- field_name: my_text
- field_type: text
- field_value: My text value here
*my_dropdown*:
- field_name: my_dropdown
- field_type: dropdown
- field_value: option 2
- field_opt_values: option 1 | option 2 | option 3
- field_opt_selected: option 1