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.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Truncating Text Field In CMS View of DOM


Reply


499 Views

Avatar
ocean

Community Member, 37 Posts

11 February 2012 at 12:10am

Hello,

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?!

Thanks
~ Sean