7913 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Link from DOM list
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 337 Views |
-
Link from DOM list

15 June 2011 at 9:23am Last edited: 15 June 2011 9:24am
Hello,
I would like include a link in the list view of a DOM field. I have the link working (code below), but I get a Facebox popup (with no content) when I click on it. How can I stop the popup from being triggered by my click event?
Thanks,
DavidMy Dataobject (partial):
function getLink ()
{
return '<a href="' . $this->Page()->Link('csv') . '/' . $this->ID . '">This link works</a>';
}Page getCMSFields (partial, obviously):
$f->addFieldToTab("Root.Content.Tab", new DataObjectManager(
$this,
'MyDataObjects',
'MyDataObject',
array(
'link' => 'Export'
),
'getCMSFields_forPopup'
)); -
Re: Link from DOM list

16 June 2011 at 5:13am
You use DataObjectManagerAction for this. In your DataObject class, define customDOMActions()..
public function customDOMActions() {
return new DataObjectManagerAction(
'Test', // The title of the action, tooltip text
'http://google.com', // the link
'window', // the behaviour (popup, refresh, delete, window)
"mysite/images/icon.png" // path to the icon for the action
);
}Please note that the behaviour "window" was just added in the last commit, so you'll have to update from the git repo to have that feature.
--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com -
Re: Link from DOM list

16 June 2011 at 5:37am
Thanks, UncleCheese!
Btw, do you accept donations for DOM?
-
Re: Link from DOM list

16 June 2011 at 5:46am
Yes, at my website, http://www.leftandmain.com. Seems to be the thing to do these days! Thanks in advance.
--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com
| 337 Views | ||
|
Page:
1
|
Go to Top |

