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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

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

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

add link to $title checkbox field


Go to End


5 Posts   2011 Views

Avatar
bebabeba

Community Member, 193 Posts

3 November 2008 at 9:51pm

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

Forum Moderator, 5523 Posts

4 November 2008 at 5:57pm

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

Community Member, 193 Posts

4 November 2008 at 10:16pm

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

Forum Moderator, 5523 Posts

4 November 2008 at 10:23pm

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

Community Member, 193 Posts

4 November 2008 at 10:26pm

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"