23373 Posts in 18175 Topics by 2865 members
|Go to End|
6 May 2009 at 6:57am
I have created a custom tab in the admin.
I would like to place a divider or <hr /> between sections.
Can this be done?
6 May 2009 at 10:40am
I'm not sure if this is the best way, but the HeaderField field type works well for me when I need to insert any custom HTML into the CMS forms.
In your case, in your getCMSFields function of the Page, you would add a HeaderField in the relevant position like so:
$fields->push( new TextField( 'Item1Link', 'Item 1 Link' ));
$fields->push( new HeaderField( '<hr />', '3', true ) );
$fields->push( new TextField( 'Item2Title', 'Item 2 Title' ));
The first argument is the HTML you want to insert. The second is the Header size (not relevant in this case), and the third is to tell the method to allow HTML in the first argument.
6 May 2009 at 5:32pm
Rather then a header field - which is designed for Header elements (<h1>) a better one would be the LiteralField() which is designed to just output whatever you pass it.
6 May 2009 at 11:19pm
I combined your answers to create this working code:
$fields->addFieldToTab("Root.Content.Item", new LiteralField('CustomCode1','<hr />'));
|Go to Top|