WebsiteBaker Support (2.8.x) > Templates, Menus & Design

Multilanguage site: submenu dissapears after search #SOLVED#

<< < (7/7)

brofield:
Your parameters to the function look wrong. The flags are definitely wrong.

B

Ivanov:
I found a solution that satisfy me.
I wanted to show the main navigation menu (no parents, just what the menu looks like on the home page of current language).
So if I start searching from page on English, I want on the search results page to see the menu like I am on the English home (start, root) page.
So, the solution about show_menu is:
1. Open the framework/class.frontend.php
2. Search for...

--- Code: ---if ($this->menu_start_level>0) {
$key_array=array_keys($this->page_trail);
if (isset($key_array[$this->menu_start_level-1])) {
$real_start=$key_array[$this->menu_start_level-1];
$this->menu_parent=$real_start;
$this->menu_start_level=0;
} else {
return;
}

--- End code ---

3. Replace it with...

--- Code: --- if (isset($key_array[$this->menu_start_level-1])) {
$real_start=$key_array[$this->menu_start_level-1];
$this->menu_parent=$real_start;
$this->menu_start_level=0;
} else {
$get_language_root = $database->query("select `page_id` from `pages` where `parent` = '0' and `language` = '".LANGUAGE."'");
$language_root = $get_language_root->fetchRow();
$this->menu_parent = $language_root['page_id'];
$this->menu_start_level=0;
}
--- End code ---


For show_menu2 the solution is ...
1. Open modules/show_menu2/include.php
2. Search for...

--- Code: ---    if (count($wb->page) == 0 && defined('REFERRER_ID') && REFERRER_ID > 0) {
        global $database;
        $sql = "SELECT * FROM ".TABLE_PREFIX."pages WHERE page_id = '".REFERRER_ID."'";
        $result = $database->query($sql);
        if ($result->numRows() == 1) {
            $wb->page = $result->fetchRow();
        }
        unset($result);
    }
--- End code ---
3. Than replace it with...

--- Code: ---if (count($wb->page) == 0 && ((defined('REFERRER_ID') && REFERRER_ID > 0) || PAGE_ID == 0)) {
global $database;
if(defined('REFERRER_ID') && REFERRER_ID > 0) {
$select_page_id = REFERRER_ID;
}
else {
$get_language_root = $database->query("select `page_id` from `pages` where `parent` = '0' and `language` = '".LANGUAGE."'");
$language_root = $get_language_root->fetchRow();
$select_page_id = $CURR_PAGE_ID = $language_root['page_id'];
}
$sql = "SELECT * FROM ".TABLE_PREFIX."pages WHERE page_id = '".$select_page_id."'";
$result = $database->query($sql);
if ($result->numRows() == 1) {
$wb->page = $result->fetchRow();
}
unset($result);
    }
--- End code ---

crnogorac081:
looks neat, maybe to include in core ?

cheers

mr-fan:

--- Quote from: Boudi on April 18, 2008, 10:12:34 AM ---When you do a search, the menu is dissapearing.  :|

When you want I can pm you the logindata?

--- End quote ---

hi boudi,

was there a solution for this....i've got the same issue on a multilanguage site with more than one menu....

kind regards
martin

crnogorac081:
I have the same issue here, using SM2 on wb.281..

I tried solutions from all posts here but still no solution...damn...

Navigation

[0] Message Index

[*] Previous page

Go to full version