5099 Posts in 1519 Topics by 1116 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1472 Views |
-
[SOLVED] Grouping SelectionGroup or Labels for SelectionGroups

18 March 2009 at 11:16pm Last edited: 20 March 2009 11:03am
Hello Community,
is it possible to group SelectionGroups in CMS or make a label for a SelectionGroup?
I have 2 SelectionGroups to chose options for has_many images: GalerieLayout and GalerieDisplayModeThe SelectionGroups are displaying in my tab like this:
o Columns
o Rows
o Lightbox
o GallerificAnd what i want is this:
Layout ((one SelectionGroup))
o Rows
o ColumnsDisplay ((other SelectionGroup))
o Lightbox
o Gallerificany ideas or hints?
thanks in advance,
Ralfmy code:
$fields->addFieldToTab('Root.Content.GalerieSettings',
new SelectionGroup('GalerieLayout', array(
"rows//Rows (Standard)" => new HiddenField(""),
"columns//Columns" => new HiddenField("")
))
);
$fields->addFieldToTab('Root.Content.GalerieSettings',
new SelectionGroup('GalerieDisplayMode', array(
"gallerific//Gallerific (Standard)" => new HiddenField(""),
"lightbox//Lightbox" => new HiddenField("")
))
); -
Re: [SOLVED] Grouping SelectionGroup or Labels for SelectionGroups

20 March 2009 at 4:56am Last edited: 20 March 2009 4:58am
Hi,
I don't have any experience with selectiongroups, so I checked the API and the file in sapphire/forms/SelectionGroup.php.
As far as I understand it, there is no way to display the $name of the selectiongroup right now (in your setup it would be GallerieLayout and GallerieDisplayMode). However... there is a workaround (add it above your Layout-selectiongroup and add another one above your Display-selectiongroup)
$fields->addFieldToTab('Root.Content.GallerieSettings', new LiteralField(
"myTitle",
"<p style='font-size:11px; color:#444'>Layout</p>"
));The HTML-tags are just in there to show you can do almost anything inside a LiteralField (even adding <img>-tags).
Instead of a LiteralField you could also use a LabelField, a HeaderField or one of the other Dataless/Utility form fieldtypes.
-
Re: [SOLVED] Grouping SelectionGroup or Labels for SelectionGroups

20 March 2009 at 10:57am
Great! That will do it. And it's much more flexible...
Thanks
| 1472 Views | ||
|
Page:
1
|
Go to Top |


