Jump to:

521 Posts in 248 Topics by 263 members

Content Editor Discussions

SilverStripe Forums » Content Editor Discussions » Template Vars in Page-Content?

Forum for content editors and CMS users.

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

Page: 1
Go to End
Author Topic: 1020 Views
  • me.yay
    Community Member
    14 Posts

    Template Vars in Page-Content? Link to this post

    Hi SilverStripers,

    prolly it a stupid question, but is it possible to make template vars like $URLSegment usable from the backend?

    I have a table with 3 columns having a specific image in the headline and footline of the table.

    In the template i would use <img src="/hemes/myTheme/img/headline_{$Parent.URLSegment}-A.jpg" /> to load the specifi image. Unluckily the template var is not replaced when used inside Content (using tinyMCE).

    Any Ideas how to solve that prob?

    Kind regards

  • Willr
    Forum Moderator
    5511 Posts

    Re: Template Vars in Page-Content? Link to this post

    In 2.3 theres no easy way to handle that sort of thing. Have alook at this tutorial for a way you can do it http://doc.silverstripe.org/doku.php?id=recipes:customising-content-in-your-templates. Its not really that nice but should work.

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.