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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Giving a basic field linking options in the admin?


Go to End


2 Posts   1715 Views

Avatar
TF-35Lightning

Community Member, 137 Posts

15 September 2010 at 4:39pm

Hi guys,

I have a basic text field that I am using as a place to hold a url for a link button back out on the front end of the site.

Currently I have to copy and paste the url into the field, what I would like to be able to do is have happen to my basic field what happens when you click the link icon in the Tinymce content field.

I'd like to be able to get those linking options to popup and be able to apply to my basic field, so that I could select files from the Silverstripe site, or go to another website etc and have those options.

Is there anyway to do this?

A screen shot of what I am talking about, I'd have a simple field like what is shown ehre Page Name or Label but call it link1, link2 etc and then get that right hand column link options to be able to apply to it.

http://gyazo.com/ec95a72d1ee7f775d3da6f2b6a61bc84.png

Any help would be great

Avatar
Devlin

Community Member, 344 Posts

15 September 2010 at 11:29pm

Edited: 15/09/2010 11:53pm

You can probably use the TreeDropdownField and replace it with your TextField.

static $has_one = array('RightContent' => 'SiteTree');
$treedropdownfield = new TreeDropdownField("RightContentID", "Choose a page to show on the right:", "SiteTree");

http://doc.silverstripe.org/treedropdownfield
http://api.silverstripe.org/trunk/forms/fields-relational/TreeDropdownField.html