Inserting HTML code into a text field

4 posts by 3 authors in: Forums > CMS Builder
Last Post: September 23, 2011   (RSS)

Re: [Pixels & Beats] Inserting HTML code into a text field

By Jason - September 22, 2011

Hi Paul,

You can use the CMS Builder Function getEvalOutput that takes in a string and executes any PHP that it finds inside.

So, for example, if you have a text field called "date" that had some PHP code that you wanted to display, you could use this:

<?php echo getEvalOutput($record['date']);?>

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Pixels & Beats] Inserting HTML code into a text field

Hi Paul.

This is just a wild stab in the dark, and maybe someone could stear it right...

Could you create a class such as

.date:before{content:"<?php echo date("d.m.y"); ?>";}

Then, in the WYSIWYG, add the class selector.

Then, whenever you wanted to insert the code, you would select where you want it place it and insert a div of that class...

You could have a whole group of these classes for various snippets...
Cheers,

Tim (toledoh.com.au)

Re: [Jason] Inserting HTML code into a text field

Jason: Works like a dream!

Toledoh: Interesting approach. Time constraints mean I can't experiment with it, but will keep in mind for the future.

Thank you both for your excellent input as always :)

Paul