WebsiteBaker Community Forum

General Community => Global WebsiteBaker 2.8.x discussion => Topic started by: PurpleEdge on May 18, 2010, 09:05:11 AM

Title: Suggestion - Show primary module in pages list
Post by: PurpleEdge on May 18, 2010, 09:05:11 AM
I would like to see the primary module used for a page in the admin/pages/index.php file.

I've modified the sql statement as follows to get the primary module...

Code: [Select]
// Get page list from database
//   $sql = 'SELECT * FROM `'.TABLE_PREFIX.'pages` WHERE `parent` = '.$parent; // GWB
    $sql = 'SELECT pages.*, sections.module FROM `'.TABLE_PREFIX.'pages` INNER JOIN `'.TABLE_PREFIX.'sections` ON (pages.page_id = sections.page_id) WHERE `parent` = '.$parent;

...assuming the page_id = section_id for the primary module of a page?

I updated the join to match on page_id - and that gives the interesting effect of showing all the sections for a page - I don't know whether that is good or bad  :?

It is then easy enough to modify the table to display the module.

See attached image.

[gelöscht durch Administrator]