Welcome, Guest. Please login or register.
Did you miss your activation email?
February 11, 2012, 03:08:01 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
149560 Posts in 21091 Topics by 7532 Members
Latest Member: nes00103
* Home Help Search Login Register
Pages: 1 [2]   Go Down
Print
Author Topic: Multilanguage site: submenu dissapears after search #SOLVED#  (Read 10086 times)
Boudi
Addon Team

Offline Offline

Posts: 793



WWW
« Reply #25 on: April 21, 2008, 08:14:17 PM »

Hello,


I have a question, Is sir Brofield still on this topic, trying to solve it?   smiley

Besides that I would like to hear from other multilanguage users if they have this problem or not.

Hope 2 hear from you  smiley

Sincerely,
Knert
« Last Edit: April 21, 2008, 08:21:23 PM by knert » Logged

...:: Bake the Unbakable ::...
brofield

Offline Offline

Posts: 224


WWW
« Reply #26 on: April 22, 2008, 04:11:24 AM »

Fixed.

In class.frontend.php, function get_page_details(), add the following line:

     // Page ID
     define('PAGE_ID', $this->page['page_id']);
+   define('REFERRER_ID', PAGE_ID);

(Note that this change isn't strictly necessary, but I feel that it is better to have it as it makes the necessary template code a little simpler. Simpler is always better. See below)

In Settings -> Show advanced settings -> Search Settings -> Header, add this input field immediately following the <form> open tag.

     <input type="hidden" name="referrer" value="[REFERRER_ID]" />

In the template, add the following input field immediately following the search <form> open tag.

     <input type="hidden" name="referrer" value="<?php echo REFERRER_ID; ?>" />

If the class.frontend.php is not modified, it can still be done with the code:

     <input type="hidden" name="referrer" value="<?php echo defined('REFERRER_ID') ? REFERRER_ID : PAGE_ID; ?>" />

Upgrade to the latest show_menu2 version 2.6

     http://code.jellycan.com/show_menu2/


NOTE: would you please test with these changes and verify for me that it is fixed (I've tested on 2.7 for multi-language sites, and 2.6.7 for a normal site).

B
« Last Edit: April 22, 2008, 06:40:49 AM by brofield » Logged
Boudi
Addon Team

Offline Offline

Posts: 793



WWW
« Reply #27 on: April 22, 2008, 09:43:18 AM »

Hi Brofield,

First off all...thank you for taking the time to try to solve this issue. I really appreciate it!

Specs:

- WB 2.7
- Allcss2 template

I did exactly what you wrote and it works like a charm!  cheesy cheesy

The menu stays intact like It should be! Great stuff! So nice to see it works after weeks of stress  rolleyes

I will now test it in combination with other mods like anynews, multiple menu's etc.
If I have results about that I will put them here right away!

Thank again for helping me (and us) out!  smiley smiley
Logged

...:: Bake the Unbakable ::...
doc
Guest
« Reply #28 on: April 22, 2008, 06:09:12 PM »

Hello Brofield,

tested the latest version of show_menu2 (v4.60) on an existing WB 2.6.7 multi-lingual site: http://help.websitebaker.org/
Everything works as it should (also tested with WB 2.7), thanks for providing a working solution.

Have updated the show_menu2 module on the addons repository with your latest version.

Thanks for your contribution.
Regards Christian
« Last Edit: April 22, 2008, 08:02:49 PM by doc » Logged
gucci

Offline Offline

Posts: 46


« Reply #29 on: May 14, 2008, 12:02:06 PM »

Hallo Brofield,

I had the same problem like Knert.
Now, the menu stays intact when I click on search and the results are displayed.
But when I click on one of the results all div containers above the div container who includes the search (in index.php of my template) disappear.

I use wb 2.7 with showmenu2 (version 4.6), multilingual site.

Code:
<?php show_menu2(0SM2_ROOT+1SM2_ALLSM2_CURR+1|SM2_CURRTREEfalsefalsefalsefalsefalse'<ul id="header_menu" class="menu">'); ?>

Is this a problem of my template or a showmenue2 problem?

Sincerely

gucci
« Last Edit: October 23, 2008, 08:00:53 AM by gucci » Logged
brofield

Offline Offline

Posts: 224


WWW
« Reply #30 on: May 15, 2008, 11:28:54 PM »

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

B
Logged
Ivanov

Offline Offline

Posts: 22


« Reply #31 on: September 11, 2010, 03:35:07 PM »

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;
}

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;
}


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);
    }
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);
    }
« Last Edit: September 12, 2010, 11:51:20 AM by Ivanov » Logged
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1680



« Reply #32 on: September 11, 2010, 04:30:39 PM »

looks neat, maybe to include in core ?

cheers
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
mr-fan

Offline Offline

Posts: 1538


WWW
« Reply #33 on: October 19, 2010, 06:49:07 PM »

When you do a search, the menu is dissapearing.  undecided

When you want I can pm you the logindata?

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
Logged

 
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1680



« Reply #34 on: November 16, 2010, 09:20:52 PM »

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

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

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
Pages: 1 [2]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!