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.

Customising the CMS

Simple Problem - Add descriptions to CSM fields?


Reply

4 Posts   1521 Views

Avatar
b0bro

23 August 2009 at 4:44pm Community Member, 38 Posts

Hi,

Is it possible to add small descriptions to cms fields?
Example, I have an image field named PhotoHome

$fields->addFieldToTab("Root.Content.Photos", new ImageField('PhotoHome'));

*First of all I would like to know how to put a space in-between Photo and Home (in cms it appears as one) and;
*Second of all I would like to add a small description like "This is the photo that will appear on the homepage"

Thanks for any help.

Byron

Avatar
JoshuaLewis

12 December 2009 at 6:15pm Community Member, 76 Posts

I'm also looking for ways of adding descriptions and notes to fields in the CMS, especially with images so the editor can get an idea of what dimensions or aspect ratio is expected by the templates.

As far as changing the name there is a second parameter to the ImageField() class that sets a title.

Currently I'm looking at two ideas for easily adding notes to CMS fields. One is to place them in the title parameter which isn't so great seeing as the layout and styling of the CMS assumes the titles are short. The other is to use LiteralField() to add the text with appropriate markup and possibly even some inline styles. I haven't done any tests with the second one yet so I'm not sure how well it works.

Avatar
kevino

26 January 2010 at 2:02am Community Member, 30 Posts

try this:

$fields->addFieldToTab("Root.Content.Photos", new ImageField('PhotoHome', 'Photo Home (This is the photo that will appear on the homepage)'));

( and ) are brackets "(" & ")"

Avatar
ajshort

26 January 2010 at 2:13am Community Member, 244 Posts

The proper way to do this is to call $field->setRightTitle('A longer description here');. This is displayed under the field in the CMS in smaller text.