Jump to:

3399 Posts in 979 Topics by 855 members

Template Questions

SilverStripe Forums » Template Questions » how to print $ . in a template ?

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

Page: 1
Go to End
Author Topic: 1542 Views
  • snaip
    Avatar
    Community Member
    180 Posts

    how to print $ . in a template ? Link to this post

    hi

    it is a big problem

    i want to put in a template somethnig like this $URL

    but '$ with words' executing the function or variable from databese

    so how to print $URL like a simple text without using HTML Encoding Tags like %24 %24 = $ ?

    another problem, how to print a dot ?

    this problem appears in <a> tag
    <a href="$Parent.URLSegment/$URLSegment.html">

    .html doesnt work becouse "." ".html" is treating like another function (?) to $URLSegment
    so how to stop (?) rendering SS function and start print HTML character ?

    maby is there any escape character like ; \ / ? $URLSegment;.html $URLSegment\.html doesnt work too

    at know i am using this $URLSegment%2Ehtml but in source i still have %2Ehtml and it is not very good in view Google Analytics

    using SS 2.4

  • lerni
    Avatar
    Community Member
    80 Posts

    Re: how to print $ . in a template ? Link to this post

    <a href="$Parent.URLSegment/$URLSegment.html">

    <a href="{$Parent.URLSegment}/{$URLSegment}.html">

  • snaip
    Avatar
    Community Member
    180 Posts

    Re: how to print $ . in a template ? Link to this post

    great !
    where did you found it ?
    could you give me a link to documentation ?

  • lerni
    Avatar
    Community Member
    80 Posts

    Re: how to print $ . in a template ? Link to this post

    i've picked it up somewhere..?? but it's also in the comments here (bottom):
    http://doc.silverstripe.org/templates

  • Willr
    Avatar
    Forum Moderator
    5464 Posts

    Re: how to print $ . in a template ? Link to this post

    I've added some notes and an example to http://doc.silverstripe.org/templates#escaping. Not sure if its 100% clear with the naming as escaping relates more specifically to escaping for attributes, xml, sql etc but couldn't think what else would make sense.

    1542 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.