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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Use variables within content?


Go to End


3 Posts   1257 Views

Avatar
Romeo

Community Member, 67 Posts

2 December 2009 at 10:04am

Edited: 02/12/2009 10:04am

Something I'd find really handy would be to be able to embed variables/functions/whatever in the content as entered via the TinyMCE editor - i.e., treat this user-edited content as if it were an SS template. So, for example, the maintainer of the site could write whatever they like on the page but if they wanted a table of students in their page, they could simply type in $StudentTable and this would be correctly parsed as templates are.

Is this completely far-fetched?

Avatar
Willr

Forum Moderator, 5523 Posts

2 December 2009 at 12:15pm

2.4 will have tokenized content support for doing just this :D. I don't think it made it into the alpha but I think it should be in the 2.4 branch (if you use svn). Currently one of the easiest ways is just doing http://doc.silverstripe.org/doku.php?id=recipes:customising-content-in-your-templates, but thats not very nice. The token system will be more useful.

Avatar
Romeo

Community Member, 67 Posts

2 December 2009 at 10:50pm

Great to hear this will be there for 2.4. In the meantime, though, the existing technique looks as if it will work fine for me - thanks for pointing it out!