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 /

Identify show and edit forms


Reply


4 Posts   972 Views

Avatar
cardinale

Community Member, 23 Posts

22 March 2010 at 9:40pm

Edited: 22/03/2010 9:42pm

How can I know if the actual form is edit or show ?

function getCMSFields() {
$fields = parent::getCMSFields();      

// This is working for add form:

if( !$this->ID ) {
// form = add
// https://www.xy.de/admin/Modeladmin/Depositaer/5/EditForm/field/News/add
}

// This is NOT working for show form:

if( $this->action == 'show' ) {
// form = show
// https://www.xy.de/admin/Modeladmin/Depositaer/5/EditForm/field/News/item/12/show
}
   
return $fields;
}

Avatar
cardinale

Community Member, 23 Posts

26 March 2010 at 10:27pm

Hello,
I'm looking since 4 days for the solution and will be very happy if someone could help me.

Avatar
Willr

Forum Moderator, 5513 Posts

27 March 2010 at 4:04pm

Are you referring to cms fields in the site tree or in a form such as model admin?

Avatar
cardinale

Community Member, 23 Posts

27 March 2010 at 10:02pm

Thanks Willr,
my form is in the model admin!