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.

General Questions /

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

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

Use variables within content?


Reply


3 Posts   872 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, 5513 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!