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

Variables in HTMLText


Reply

4 Posts   934 Views

Avatar
dompie

20 January 2010 at 1:37am (Last edited: 20 January 2010 1:38am), Community Member, 88 Posts

i searched the forum and docs but didn't find any satisfying answer.
I have created custom "Details" Tab where i use (among others) a Size field. Now i would like to access the value in the main content wysiwyg by writing $Size. So that the template-engine replaces $Size with the real value (e.g. XXL).

Can this be achieved somehow? I tried $Size, {$Size}, {Details.Size}, <% Details.Size %> and similar but everything failed.

Avatar
zenmonkey

20 January 2010 at 1:37pm Community Member, 528 Posts

I'm sure I've seen a post on this before, but for the life of me I can't find it

Avatar
SilverRay

20 January 2010 at 2:26pm Community Member, 167 Posts

Perhaps you mean something like this:

http://doc.silverstripe.org/doku.php?id=recipes:customising-content-in-your-templates

Avatar
MateuszU

20 January 2010 at 2:46pm Community Member, 89 Posts

I never knew there was a recipe for that :) If you prefer to read the code, userforms does '$Userform' replacement.