Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Truncating Text Field In CMS View of DOM

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: 406 Views
  • ocean
    Community Member
    37 Posts

    Truncating Text Field In CMS View of DOM Link to this post


    I'd like to reduce the number of characters of a text field as displayed in the CMS view of the DOM, as the rows are getting ridiculously large in proportion to the overall view!

    I managed to implement this kind of thing for an image field:

    public function getDOMThumbnail()
    return $this->Image()->CroppedImage(150,150);

    Where 'DOMThumbnail' is placed in the DOM array. But can find no similar example of how to reduce a text field, in this case its an HTMLtext field, nor have any of my attempts/experiments from reading through the api docs really helped much either in solving the problem. Seems like it should be pretty simple really?!

    ~ Sean

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.