Using variables in the wysiwyg editor

5 posts by 2 authors in: Forums > CMS Builder
Last Post: August 6, 2009   (RSS)

By eduran582 - August 5, 2009

Hi all,

Does anyone know if there is a way to use CMSB variables within the wysiwyg editor when adding a record? What I need is a way to add certain variables in the text that would be added in a "content" wysiwyg field. Example: something entered into the wysiwyg field like this:

"Your reservation for <?php echo $myRecord['mytotal'] ?> of people has been made..."

TIA

Eric

Re: [chris] Using variables in the wysiwyg editor

By eduran582 - August 6, 2009

Hi Chris,

Thanks for replying. I figured because of the nature of the "wysiwyg" that this would not be a possibility but wanted to make sure. I've already told the maintainer they will have to revise the message they maintain to reflect a reference to the variables that will be displayed before the "content" is displayed (as in a header). So what I displayed would be changed to say something like:

"Your reservations for the number of people, as displayed above, has been made."

Thanks again for the quick reply.

Eric

Re: [eduran582] Using variables in the wysiwyg editor

By Chris - August 6, 2009

If you wanted to get your hands dirty with PHP, you could always create your own placeholder system. e.g.:

<?php
$content = $record['content'];
$content = str_replace("(***NUM***)", $record['num'], $content);
echo $content;
?>

All the best,
Chris

Re: [chris] Using variables in the wysiwyg editor

By eduran582 - August 6, 2009

Hmmm... interesting. Thanks for the hint, Chris! [;)]

I might try something like this after I get this thing going.

Eric