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.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Remove field from RedirectorPage


Go to End
Reply


3 Posts   91 Views

Avatar
combar

Community Member, 2 Posts

21 June 2017 at 11:08pm

Hi,

When im adding custom field to Page class, new filed also appears in RedirectorPage (eg. image gallery). Any ideas how to remove this filed ? :)

I tried to add new file to mysite/code called RedirectorPage.php, but it causes an error after dev build.

Avatar
martimiz

Forum Moderator, 1391 Posts

22 June 2017 at 1:49am

You could add the field conditionally, for instance only if the current classname is 'Page' or only if the classname isn't 'RedirectorPage' or...

Something like:

public function getCMSFields() 
{
    ....
    if ($this->ClassName != 'RedirectorPage) {
        $fields->addFieldToTab(....);
    }

Avatar
combar

Community Member, 2 Posts

22 June 2017 at 2:57am

Thank you very much :)