Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » add link to $title checkbox field

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 1536 Views
  • bebabeba
    Avatar
    Community Member
    192 Posts

    add link to $title checkbox field Link to this post

    Hi!
    I follow the guide to add checkbox.
    new CheckboxField(
    $name = "newsletter",
    $title = "I would like to receive a monthly newsletter"
    );

    My problem is that i need a link for the text near checkbox, so a link for $title. Can you help me?

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: add link to $title checkbox field Link to this post

    Sorry I don't quite understand what you are asking? Do you want some part of $title to be a link? You can embed the link in it just like HTML

    new CheckboxField(
    $name = "newsletter",
    $title = "I would like to receive a <a href='link-to-page'>monthly newsletter</a>"
    );

  • bebabeba
    Avatar
    Community Member
    192 Posts

    Re: add link to $title checkbox field Link to this post

    My problem is that I want to add a file html in assets folder and use thickbox. I have a lot of error.

    new CheckboxField(
             $name = "privacy",
             $title = "<a href="assets/files/privacy.html?keepThis=true&TB_iframe=true&height=300&width=500" class="thickbox"> Accetta informativa (clicca sul link)</a>"
             )

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: add link to $title checkbox field Link to this post

    You cannot do $var = "string " " " - note the nested "' try

    $title = "<a href='assets/files/privacy.html?keepThis=true&TB_iframe=true&height=300&width=500' class='thickbox'> Accetta informativa (clicca sul link)</a>"

  • bebabeba
    Avatar
    Community Member
    192 Posts

    Re: add link to $title checkbox field Link to this post

    I try to include file in my function in this way:

    require_once(Director::baseFolder() . '/files/privacy.html');
    require_once(Director::baseFolder() . '/themes/underthebridge/css/thickbox.css');

    but my error are link to
    ... ?keepThis=true&TB_iframe=true&height=300&width=500 class="thickbox"

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