#1 October 18, 2016 4:03am

Terra-IT
Member
Registered: April 18, 2016
Posts: 10

Extending the admin page properties

Hi Tim,

We at Terra-IT are trying to extend the properties of a page to create a 'static page title'. We created a properties file in the 'custom/admin/modules/pages' folder and we copied the core properties file and added the field we wanted. We also created a new field for the static page title in the database. Now what we want to know is how and where the post variables are looped or added to the database. Because at this moment our static page title field is getting posted into the wrong variable.

Thank you in advance.

Added: screenshot of post.

Terra-IT

Screen_Shot_2016_10_18_at_11_00_59.png

Offline

#2 October 18, 2016 10:26am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: Extending the admin page properties

You'll want to extend the admin class methods updatePage and createPage (see https://www.bigtreecms.org/docs/dev-gui … ding-core/ under "Extending Without Overriding"). Generally I'd advise calling the parent method first, then manually update the column for your added fields, something like this:

class CustomAdmin extends BigTreeAdminBase {
    function createPage($data) {
        $id = parent::createPage($data);
        sqlquery("UPDATE bigtree_pages SET custom_flag = '".sqlescape($data["custom_flag"])."' WHERE id = '$id'");
        return $id;
    }
}

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.