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.

Archive /

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

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

Need help with setFieldFormatting. Creating an anchor/link format has odd behaviours


Go to End


2098 Views

Avatar
Hammy

Community Member, 49 Posts

8 December 2008 at 11:57am

I have added the following formatting to a ComplateTableField:

$storesTablefield->setFieldFormatting(array(
			'ProductUrl' => '<a href=\"$ProductUrl\">$ProductUrl</a>'
		));

I was expecting the page to go to that url, instead it opens up in a lightbox pop up window.

Also, when i click on any of the other cells in the ComplexTableField (excluding vew, edit, etc), instead of it opening a popup window to show the full details of the dataobject, it instead tries to load the url from the formatted field instead.

Is there an attribute that I need to add to this anchor to help control its behaviours?