Feature Request: Universal Placeholders

7 posts by 5 authors in: Forums > CMS Builder
Last Post: July 19, 2010   (RSS)

Hi, Dave -

I've been really pleased with some of the additions to CMSB of late. However, as a former fan of AM (1&2) there is one feature which has yet to make the cut which I would like to champion.

Is there any way we could introduce some sort of "Universal Placeholder" system - like the one used to such great effect in AM2?

For those not familiar with the system, there is a page in the admin area where you can list your own placeholders. You enter a name and then the corresponding code snippet. So, for example, you might do something like this:

my.domain = http://www.mysite.co.uk

Then wherever $my.domain appears in your template it is replaced by the code - in this case the URL above.

It's a simple system and works with text, links and images. This makes it really easy to construct templates which use site-wide features, such as logo images, menus, page titles, meta data and pretty much anything else. With a little imagination, you can also use it to control CSS and other formatting.

I appreciate AM2 and CMSB employ fundamentally different methods for delivering pages, but is there any way we could do something along these lines? Could it not be some kind of integrated php include system?

:0)

Perch

Re: [Perchpole] Feature Request: Universal Placeholders

By Chris - January 19, 2010

Hi Perch,

I've done something like this on my own projects using a Single Record Section called Website (maybe Globals would be a better name) which I load on every page. Rather than copying the code to load that record all over the place, I include a single "includes/init.php" file which does this (as well as including viewer_functions.php). Inserting values from my Website table is then as easy as <?php echo $website['field_name'] ?>

Specifically, I've used this for CSS colours and page titles so that my end-users can easily update them.

Does that accomplish what you're after or is it missing something you were thinking of?

I hope the helps! Please let me know if you have any questions.
All the best,
Chris

Re: [chris] Feature Request: Universal Placeholders

Hi, Chris -

Thanks for your note. I like your suggestion about using a single record section ("Globals" is spot on). It would certainly do the job.

Perhaps it would be worth exploring if it would be worth including a basic Globals set-up as a presetschema?

:0)

Perchpole

Re: [Perchpole] Feature Request: Universal Placeholders

By Chris - January 20, 2010

Hi Perchpole,

That's an idea. I'm not sure what fields it would have by default, but we'll mull it over. :)
All the best,
Chris

Re: [wolftracks] Feature Request: Universal Placeholders

By Donna - July 19, 2010

Hi Wolftracks,

It's not something on the immediate list of releases, but definitely a good idea for future updates. :)
Donna

--
support@interactivetools.com

Re: [chris] Feature Request: Universal Placeholders

By rconring - July 19, 2010

I have been doing the "globals" thing for a while now .. a "control file" concept from my applications programming days. I use it for meta tag and other information I need to include on all or some pages throughout the site. Works great for me!
Ron Conring
Conring Automation Services
----------------------------------------
Software for Business and Industry Since 1987