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:

Content Editor Discussions /

Forum for content editors and CMS users.

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

Template Vars in Page-Content?

Go to End

2 Posts   1464 Views


Community Member, 14 Posts

21 February 2010 at 6:09am

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


Forum Moderator, 5523 Posts

22 February 2010 at 5:58pm

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 Its not really that nice but should work.