Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Need help with setFieldFormatting. Creating an anchor/link format has odd behaviours

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

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

Page: 1
Go to End
Author Topic: 1112 Views
  • Hammy
    Avatar
    Community Member
    49 Posts

    Need help with setFieldFormatting. Creating an anchor/link format has odd behaviours Link to this post

    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?

    1112 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.