The solution was simple to make dynamic drop down link on header which uses ezpages pages of certain group.
Copy the ezpages_drop_menu.php to make own custom one.
**SOLUTION A **
Edit following line>
$page_query = $db->Execute("select * from " . TABLE_EZPAGES . " where status_header = 1 order by header_sort_order, pages_title");
TO LINE
$page_query = $db->Execute("select * from " . TABLE_EZPAGES . " where **toc_chapter = 1 and** status_header = 1 order by header_sort_order, pages_title");
Then it displayes only ezpage links of group 1.
To make it even better, more general add a variable to the line.
**SOLUTION B **
$page_query = $db->Execute("select * from " . TABLE_EZPAGES . " where toc_chapter = " . **$chapNumber **. " and status_header = 1 order by header_sort_order, pages_title");
Now when you are calling for copy of ezpages_drop_menu2.php or what ever name you gave it, you can before that give a value to the variable.
This way you can create multiple menu drop down links using same code.
If you want even better than this you can edit the code that if $chapNumber is not defined then it is not used in where clause.
**SOLUTION C **
If ($chapNumber != ""){
$page_query = $db->Execute("select * from " . TABLE_EZPAGES . " where toc_chapter = " . $chapNumber . " and status_header = 1 order by header_sort_order, pages_title");
} else
{
$page_query = $db->Execute("select * from " . TABLE_EZPAGES . " where status_header = 1 order by header_sort_order, pages_title");
}
CODE IS TESTED AND IT WORKS
You would then use following code to make the drop down link in tpl_drop_menu.php file.
<?php $chapNumber = "1";
require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . 'ezpages_drop_menu2.php'); ?>
Well your desision if you want to edit existing ezpages_drop_menu.php file or make a copy. I prefer a copy in case you update module you could accidently loose the editing. Well maybe module creator could integrate it to the main code.:cool:
Possible make even some improvements to my code.
marksu