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

Using FieldGroup and customizing field layout in ModelAdmin


Reply

12 Posts   4700 Views

Avatar
Stefdv

3 March 2011 at 9:34am Community Member, 110 Posts

Got it :)

Again, Swaiba...Thank u so much

Avatar
swaiba

3 March 2011 at 10:17am Forum Moderator, 1796 Posts

you're welcome

Avatar
Stefdv

16 March 2011 at 5:27am Community Member, 110 Posts

Swaiba, need your (or anybody else )help again..

I'm trying to do this;

$fields->addFieldToTab("Root.MedRecords", $fields->insertBefore(new LiteralField('NameFieldGroup'.'Patella','<div class="NameFieldGroup">'),'HD');
$fields->addFieldToTab("Root.MedRecords", $fields->insertAfter(new LiteralField('NameFieldGroup'.'Patella','<div class="NameFieldGroup">'),'DNA');


Well...that doesn't work

My MedRecords are a different DataObject than the one i'm creating the Tab in. The 'Patella' , 'HD' and 'DNA' are fields in my MedRecords.

any ideas on this one ?

Avatar
Carbon Crayon

30 March 2011 at 11:39pm Community Member, 598 Posts

Hi Stefdv,

I think what you need is just:

$fields->addFieldToTab("Root.MedRecords", new LiteralField('NameFieldGroup'.'Patella','<div class="NameFieldGroup">'),'HD');

Which will insert the field before the 'HD' field under MedRecords tab.

Hope that helps,

Aram