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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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   1130 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!