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.

Form Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Limit Characters Displayed in ComplexTableField

Go to End

2 Posts   1082 Views


Community Member, 2 Posts

31 January 2012 at 1:01pm

Hi, I'd like to limit the number of characters that are displayed in a ComplexTableField (in CMS) while keeping the underlying data in tact for display in the popup. Any thoughts?


Forum Moderator, 1391 Posts

1 February 2012 at 6:23am

Edited: 01/02/2012 6:24am

One simple way to do is to create a function in your DataObject that returns the truncated text, then add the name of that function to the summary fields, like

static $summary_fields = array(

function TruncatedContent() {
	// return $this->Content, truncated in some way