Default Values - enable access like a new section

3 posts by 2 authors in: Forums > CMS Builder
Last Post: September 19, 2012   (RSS)

Re: [rjbathgate] Default Values - enable access like a new section

By Dave - September 7, 2012

Hi Rob,

The "default value" field supports PHP tags. So you can create a single record section called "defaults", with a field called "title_default" and then enter some code like this as the default:

<?php echo array_value(mysql_get('defaults', 1), 'title_default'); ?>

Or if you wanted, you could even let each user specify defaults and load it from their user account with:

<?php echo $CURRENT_USER['title_default'] . " by " . $CURRENT_USER['username']; ?>

Note: The above code uses some of our utility helper functions we include with the latest version of CMSB. You could write it out the long way as well if needed.

Hope that helps, let me know any questions.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Default Values - enable access like a new section

Awesomesauce!

Works a treat, thanks Dave (and sorry for the delay...)