Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Themes /

Discuss SilverStripe Themes.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Replace Content Var by code-snippet


Go to End


2 Posts   1892 Views

Avatar
Silverfish

Community Member, 59 Posts

27 April 2012 at 9:02pm

Hi All,

I want to give Editors the possibility to place prepared HTML snippets wherever they want within an open Content Textfield (HTMLEditorField).
I.e. if the Editor writes something like
'This is some Text
$mySnippet
and some more Text'
into the content field, the page should show the (hardcoded) HTML of mySnippet.ss instead of the $mySnippet var.
Is there any prepared functionality in Silverstripe for this? How would you do this?
My Approach would be to check the $UserDefinedform var of the so called module and modify it's way of replacement. Ist there a better way?

Thx for any Feedback! :)
Kind regards
SF

Avatar
Willr

Forum Moderator, 5523 Posts

27 April 2012 at 9:21pm