Question

I have a text area that grows each week with date stamped data. I want to know if it is possible to make it so that it stays at a certain size and has a vertical scroll bar, instead of having a huge text area.

Basically, I want it to look like it does in edit view, but not editable, of course.

Was it helpful?

Solution

I added a new file named DetailView.tpl in the custom/include/SugarFields/Fields/Text/ directory ( which you may have to create ) with the following contents:

<span class="sugar_field" id="{{sugarvar key='name'}}" style="max-height: 200px;overflow: scroll; display: block;">
{{if empty($displayParams.textonly)}}
{{sugarvar key='value' htmlentitydecode='true'}}
{{else}}
{{sugarvar key='value'}}
{{/if}}
</span>
{{if !empty($displayParams.enableConnectors)}}
{if !empty({{sugarvar key='value'}})}
{{sugarvar_connector view='DetailView'}}
{/if}
{{/if}}

Afterwards, do a Quick Rebuild and Repair and that section should be limited to 200px high, and have scrollbars if the content gets longer than that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top