Jump to:

23552 Posts in 19349 Topics by 2891 members

General Questions

SilverStripe Forums » General Questions » baseURL in literalField

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: 251 Views
  • merrick_sd
    Avatar
    Community Member
    95 Posts

    baseURL in literalField Link to this post

    what should it be to include the BaseURL in some text in the CMS like on a literal field

    $fields->addFieldToTab("Root.Main", new LiteralField (
    "literalfield",
    "<p>Download Example Banner <a href=\"/".Director::absoluteBaseURL()."/BannerModule/images/examples/770x314.zip\" target=\"_blank\" >Example Banner Image 770 x 314px [zip]</a></p>"
    ));

    this come out whithe the domainname twice!!!

    http://dev.mydomain.co.uk/http://dev.mydomain.co.uk//lBannerModule/images/examples/770x314.zip

  • merrick_sd
    Avatar
    Community Member
    95 Posts

    Re: baseURL in literalField Link to this post

    solution

    $fields->addFieldToTab("Root.Main", new LiteralField (
    "literalfield",
    "<p>Download Example Banner <a href=\"/BannerModule/images/examples/770x314.zip\" target=\"_blank\" >Example Banner Image 770 x 314px [zip]</a></p>"
    ));

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