Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Updating DOM values derived other DOM fields and the site tree

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 414 Views
  • theoldlr
    Avatar
    Community Member
    103 Posts

    Updating DOM values derived other DOM fields and the site tree Link to this post

    I have a DOM with an image, image height, image width, link ID assigned by a SimpleTreeDropdownField, and a link name which is just a friendly view of what page the link ID is for.

    I'm using an onBeforeWrite to grab the height and width of the image as well as the link name from the link ID. In this scenario if somebody uploads a replacement image with the same name and different dimensions, or changes the Page Name of a page that is linked, the info in the DOM will be incorrect. What is the best way for me to keep the DOM info accurate?

    Also, is there any way to include a null option in the SimpleTreeDropdownField in the case that I would not want to include a link on a particular object?

    Thanks!

  • UncleCheese
    Avatar
    4085 Posts

    Re: Updating DOM values derived other DOM fields and the site tree Link to this post

    Yeah, it works just like a DropdownField..

    $dropdown = new SimpleTreeDropdownField(...);
    $dropdown->setEmptyString(_t('Mysite.PLEASESELECT','Please select'));

    --------------------
    SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

    414 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.