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   920 Views

Avatar
cardinale

22 March 2010 at 9:40pm (Last edited: 22 March 2010 9:42pm), Community Member, 23 Posts

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

26 March 2010 at 10:27pm Community Member, 23 Posts

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

Avatar
Willr

27 March 2010 at 4:04pm Forum Moderator, 5511 Posts

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

Avatar
cardinale

27 March 2010 at 10:02pm Community Member, 23 Posts

Thanks Willr,
my form is in the model admin!