Jump to:

23471 Posts in 18937 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Use variables within content?

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

Page: 1
Go to End
Author Topic: 805 Views
  • Romeo
    Avatar
    Community Member
    67 Posts

    Use variables within content? Link to this post

    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?

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: Use variables within content? Link to this post

    2.4 will have tokenized content support for doing just this . 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.

  • Romeo
    Avatar
    Community Member
    67 Posts

    Re: Use variables within content? Link to this post

    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!

    805 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.