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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Adding spaces or other notes to the Fields...


Go to End


3 Posts   1195 Views

Avatar
steve_nyhof

Community Member, 224 Posts

21 February 2010 at 4:03am

Edited: 21/02/2010 4:04am

Does anyone know how to add a space or field to add a note to the Field functions?

The first field creates a title which is nice, but I would like to add a space above it.

$fields->addFieldToTab('Root.Content.BannersAndPopups', new HeaderField($title = 'Sticky Note',$headingLevel = 3));

The other is to add a note to the page, when ever I add an echo = "something" it adds the space to the very top of the editor.

Thank you,
Steve

Avatar
martimiz

Forum Moderator, 1391 Posts

21 February 2010 at 5:45am

Hi Steve,

I'm not quite sure what you mean by 'adding a note' - but maybe this'll be of some help: apart from the HeaderField, there's also a LiteralField that lets you add HTML tot the form.

Avatar
steve_nyhof

Community Member, 224 Posts

21 February 2010 at 8:45am

That did it, thank you...

This adds a space by using the <p>&nbsp;</p> tags

$fields->addFieldToTab('Root.Content.BannersAndPopups', new LiteralField('','<p>&nbsp;</p>'));