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.

Archive

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

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

add link to $title checkbox field


Reply

5 Posts   1637 Views

Avatar
bebabeba

3 November 2008 at 9:51pm Community Member, 192 Posts

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?

Avatar
Willr

4 November 2008 at 5:57pm Forum Moderator, 5511 Posts

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>"
);

Avatar
bebabeba

4 November 2008 at 10:16pm Community Member, 192 Posts

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>"
         )

Avatar
Willr

4 November 2008 at 10:23pm Forum Moderator, 5511 Posts

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>"

Avatar
bebabeba

4 November 2008 at 10:26pm Community Member, 192 Posts

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"