Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multi-level navigation and easy menu definition
#51
yojoe Wrote:Yes it is a standard. But I need to show permanently a side-menu consisting of siblings belonging to 1 top lvl parent. This parent is set to not be shown in menu, and after reading for 5th time documentation I could only show all of its siblings as opened.

If the parent is not shown in the menu, then the children are also not shown in the menu (unless you use the flag I18N_SHOW_PAGES).
On the other hand, if the top page is in the (top) menu and you click on it, it is the active page and the code shown above will display all its children in the sidebar. If you click on one of the children, then its (sub)children are also shown, but not those of its siblings.
Do you have a link to an example so that I can better understand your problem?
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#52
I've sent you all info in PM.

Below image shows the problem.
On the left is the menu currently rendered with: get_i18n_navigation('SUBMENU', 1, 2,I18N_SHOW_MENU);
On the right is the submenu's functionality I'd like to get.
With get_i18n_navigation('SUBMENU',1,99); I have closed 2nd lvl pages, but when I click on one, it doesn't show its 3rd lvl nested siblings.

This functionality is no problem to achieve with full menu, but rendering additional menu using certain slug sibling beat me.

[Image: misc.php?item=703]
Addons: blue business theme, Online Visitors, Notepad
Reply
#53
yojoe Wrote:I've sent you all info in PM.

Below image shows the problem.
On the left is the menu currently rendered.
On the right is the submenu's functionality I'd like to get.

First: you write sibling, but according to the pictures and description you seem to mean child.
It's not the siblings (i.e. same level), but children (i.e. level below) that is/should be displayed.

The left version in the image is only displayed, if you use I18N_SHOW_MENU or I18N_SHOW_PAGE as 4th parameter - you need to use no 4th parameter or set it to I18N_SHOW_NORMAL.

I18N_SHOW_MENU means: show the whole menu independent of the current active page.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#54
Is it possible to use get_i18n_navigation with a list of slugs as a parameter, so the menu displays only those slugs?

This would have many uses, for instance you want Home, About, Contact links displayed in a smaller menu separate from the main navigation, but they are still in the top level of the page hierarchy. Or you are using image replacement with CSS sprites in the top-level menu, and you don't want clients to be able to mess up the design by adding new top-level pages to the menu.

If the i18n Navigation plugin can't do this, does anyone know of another plugin or maybe a PHP technique to build a menu from a pre-determined list of slugs?
Thanks.
Reply
#55
Cerulean Wrote:Is it possible to use get_i18n_navigation with a list of slugs as a parameter, so the menu displays only those slugs?

This would have many uses, for instance you want Home, About, Contact links displayed in a smaller menu separate from the main navigation, but they are still in the top level of the page hierarchy. Or you are using image replacement with CSS sprites in the top-level menu, and you don't want clients to be able to mess up the design by adding new top-level pages to the menu.

If you have a fixed number of links you want to display, which will not change, you can put the corresponding XML into your templated (along with calls to find_url).

The I18N navigation will always display a part of the navigation tree: you can specify where to start and how many levels, but not specify the pages to display.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#56
mvlcek Wrote:If you have a fixed number of links you want to display, which will not change, you can put the corresponding XML into your templated (along with calls to find_url).

Do you mean just hard-code the menu into the template? If I did that how would the "active" class be applied to the correct <a> tag depending on the current page? Or is the "find_url" you mention a PHP function that can be used to set the active navigation element?
Reply
#57
Thanks for the menu capabilities. The top drop down menu interests me the most, and it is a breeze to style with css.

I've made some attempts to make the menu horizontally centered, but without progress.

Is there a way to center the top drop down menu?

Thank you.
Reply
#58
hi there.

i use this plugin to generate 3 different menus with a similar technique described in this thread http://get-simple.info/forum/topic/1025/...ersidebar/

the problems with this is, that only the main-navigation gets an active state via ".current".

my site structure looks like this:

header:
- navi top 1 (not in menu, not private)
- header link 1
- header link 2

main navigation:
- main link 1
- main link 2
- main link 3
...

sidebar navigation:
- Navi Left 1 (not in menu, not private)
- left link 1
- left link 1-1
- left link 1-2
- left link 2
- left link 3
...

the header navi is implemented with
Code:
<?php get_i18n_navigation("header link 1", 1, 3); ?>

main navi uses
Code:
<?php get_i18n_navigation(return_page_slug(),0,1); ?>

sidebar uses
Code:
<?php get_i18n_navigation("left link 1", 1, 3); ?>


the menus look nice with this and are fully functional but i'm missing a span, class or id to define the active link via css.

is there any fix for this or am i doing something wrong?
Reply
#59
fabsn Wrote:i use this plugin to generate 3 different menus with a similar technique described in this thread http://get-simple.info/forum/topic/1025/...ersidebar/
...

You can achieve this doing the following - assuming slugs "navi-top-1" and "navi-left-1" (without blanks) instead of "header link 1" and "left link 1":
  • put "navi-top-1" and "navi-left-1" into the menu
  • hide them in the main menu by adding a css rule (assuming id main-nav for the main menu):
Code:
#main-nav .navi-top-1, #main-nav .navi-left-1 { display: none; }
  • display the menus the following way:
Code:
<?php
  $bc = return_i18n_breadcrumbs(return_page_slug());
  get_i18n_navigation($bc[0]['url']=='nav-top-1'?return_page_slug():'nav-top-1',1,3);
  ...
  get_i18n_navigation(return_page_slug(),0,1);
  ...
  get_i18n_navigation($bc[0]['url']=='nav-left-1'?return_page_slug():'nav-left-1', 1, 3);
?>

Alternatively you could also put the main menu below another page, however then you might get a problem with the home page (if you want to show it in the menu) and fancy urls, if you use the parent slug.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#60
thank you for your quick response. i will try this out and give some feedback on monday
Reply
#61
thank you, this works like a charm.
keep up the good work, your plugins are AWESOME
Reply
#62
Hi there,

thanks for your awesome plugins. I have a quick question.

I'm trying to display the menu using default code/behavior i.e

Code:
<?php get_i18n_navigation(return_page_slug(),1,99) ?>

menu items are starting from level 1 because my parent page (0) being used as a header. the code works well when browse the level 1 page but on the index page I don't see anything.

Normally I need to use this code to show sub pages of a parent page called page-slug

Code:
<?php get_i18n_navigation('page-slug',1,100,I18N_SHOW_MENU); ?>

and this code works well but in this case I lose the required behavior i.e displaying child pages of a current opened page.

What should I change in the code to make the menu visible on the main page?

Sorry if it sounds too complicated, I tried to describe my problem as simple as possible Smile

The attached screenshot shows the menu on a sub page (level 1) but is empty on the homepage.
Reply
#63
[/root.] Wrote:I'm trying to display the menu using default code/behavior i.e
Code:
<?php get_i18n_navigation(return_page_slug(),1,99) ?>

menu items are starting from level 1 because my parent page (0) being used as a header. the code works well when browse the level 1 page but on the index page I don't see anything.

Normally I need to use this code to show sub pages of a parent page called page-slug

Code:
<?php get_i18n_navigation('page-slug',1,100,I18N_SHOW_MENU); ?>

and this code works well but in this case I lose the required behavior i.e displaying child pages of a current opened page.

What should I change in the code to make the menu visible on the main page?

If you want to always show the children of main page 'page-slug', use the following code:
Code:
<?php
  $bc = return_i18n_breadcrumbs(return_page_slug());
  get_i18n_navigation($bc[0]['url']=='page-slug'?return_page_slug():'page-slug',1,99);
?>
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#64
Thanks the code works as expected except 3rd level pages. Any advice?
Reply
#65
[/root.] Wrote:Thanks the code works as expected except 3rd level pages. Any advice?

What's the problem? Do you have a link to your site or is it local?
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#66
mvicek

I mean that the menu is not displaying the pages of level 3. I PM'd you the details.
Reply
#67
[/root.] Wrote:I mean that the menu is not displaying the pages of level 3. I PM'd you the details.

Just checked your site and didn't find a problem:
When you click on 1st-level page demographics, all pages of level 2 below demographics are shown.
When you click on 2nd-level page population, all pages of level 3 below population are also shown.

If you want to show the whole navigation hierarchy independent of the current page, use I18N_SHOW_MENU as 4th parameter of get_i18n_navigation.

Otherwise you should think about formatting the current navigation page different (e.g. bold) - it has the css class current. To show the user which pages have sub pages, use different styles for the css classes open and closed.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#68
lol my bad. you are right, I have overseen the 3d level page. Thanks for your help Smile
Reply
#69
Im using this code to call my drop down main menu

Code:
<?php get_i18n_navigation(return_page_slug(), 0, 1, true); ?>

I dont want the home link to appear on menu, how do i do that?

thanks...
Reply
#70
amaurib Wrote:Im using this code to call my drop down main menu

Code:
<?php get_i18n_navigation(return_page_slug(), 0, 1, true); ?>

I dont want the home link to appear on menu, how do i do that?

thanks...

Assuming, you have code like this
Code:
<ul class="menu"><?php get_i18n_navigation(return_page_slug(), 0, 1, true); ?></ul>
just add a new CSS rule to your style sheet:
Code:
ul.menu li.index { display: none; }
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#71
@mvlcek thank you, that made the trick.

I have another question.
what can i do to show the top menu title or father on all childs page?

this is my menu.

Code:
<div id="myslidemenu" class="jqueryslidemenu">
               <ul>
               <?php get_i18n_navigation(return_page_slug()); ?>
               </ul>
</div>

This is my Sub-Menu
Code:
<div class="sidebarcontent">
                <h4 class="sidebarheading">SERVICES</h4>
            <ul class="sidelist">
               <?php get_i18n_navigation(return_page_slug(),1,99); ?>
            </ul>
</div>


How can i show the top level menu title on my sidebarheading ?

for example

Services
-service1
-service2
-service3

And how do i Hide the submenu completely if there is no childs?


thank you! Smile
Reply
#72
amaurib Wrote:@mvlcek thank you, that made the trick.

I have another question.
what can i do to show the top menu title or father on all childs page?

See http://mvlcek.bplaced.net/multi-level-na...-children/.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#73
@mvlcek

Thanks a lot!!!!
Reply
#74
Hello, 


Lets assume that we have menu like

Main   Team   About   Contact

Main Team About Contact is a top level menu, About has children menu but I would like to place it before contacts

Is it possible to show first 2 (Main and Team) by any command like

<?php get_i18n_navigation(return_page_slug()); ?>

and then show about submenu by 

<?php get_i18n_navigation('about',1,99); ?>

then show Contact with command like

<?php get_i18n_navigation(return_page_slug()); ?>
Reply




Users browsing this thread: 1 Guest(s)