Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multi-level navigation and easy menu definition
#26
Connie Wrote:I modified this to

Code:
<h3><?php
    if (isset($pages[$slug]['children'])) {
    $bc = return_i18n_breadcrumbs(return_page_slug()); echo $bc[0]['menu']; echo ':';} ?></h3>

so there is output only when there are subpages, but now it is not showing anything...

$pages and $slug are not set. Try the following:

Code:
<?php
      $bc = return_i18n_breadcrumbs(return_page_slug());
      $slug = $bc[0]['url'];
      $pages = return_i18n_pages();
      if (isset($pages[$slug]['children'])) echo '<h3>'.$bc[0]['menu'].'</h3>';
    ?>

(attention: it will show the h3 even if there are only non-menu children)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#27
I had tested it and one page did not show the headline,

but now after some cache-emptying, closing and opening that page in the editor again, everything is ok

thanks!
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#28
Connie Wrote:I had tested it and one page did not show the headline,

but now after some cache-emptying, closing and opening that page in the editor again, everything is ok

thanks!

Just another thought:
If you don't always have the menu text set, you can also replace $bc[0]['menu'] with ($bc[0]['menu'] ? $bc[0]['menu'] : $bc[0]['title']) to use the title if the menu text is empty.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#29
mvlcek Wrote:($bc[0]['menu'] ? $bc[0]['menu'] : $bc[0]['title'])

I checked that, but menu-text is always automatically generated, so there are no empty menu-texts ;=)
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#30
rosejhon Wrote:if the session has been started before I start the session. It would be great if plugin developers that are using the session, will do this as well with a simple

I do not understand you, please explain what you wrote
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#31
I18N Version 1.4:
  • adds the css classes "open" or "closed" to menu items with children. This allows you to style menu items with children differently than those without.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#32
hi, it's my first post

at the beginning I would like to thank you for a greate plugin
but a have a problem

My menu now works almost perfectly, but there is one little thing I want to change, but do not know how

What i want:

When i am on home page and the submenu is closed and i hover "nad" then the submenu open ( "pod" would be visible) and when I move the mouse somewhere sub then menu would close.

my temp page : http://przychodniatest.cba.pl/

my menu css:
Code:
.sitemenu {
  position: relative; /* !!! */
  height: 1.4em; /* make sure whole menu texts are shown */
  background-color: #ECECEC;
}
.sitemenu ul {
  position: absolute;
  list-style: none;
}
.sitemenu li {
  float: left; /* !!! */
  padding: 2px 10px;
  width: 8em;
}
.sitemenu li.current > a, .sitemenu li.currentpath > a {
  font-weight: 800;
}
.sitemenu li > a {
  color: #666;
  text-decoration: none;
  border-bottom: none;
}
.sitemenu li:hover > a {
  color: #92BF92;
}
.sitemenu li ul {
  display: none;
}
.sitemenu li:hover ul{
  display: block; }
.sitemenu li.current ul, .sitemenu li.currentpath ul {
    display:block  
}
.sitemenu li ul li {
  float: none;
}
.sitemenu li:hover ul li {
  background-color: #ECECEC;
  border: none 0;
  display:block;
}

thanks in advance for your help
Reply
#33
You need to call the navigation as
Code:
<?php get_i18n_navigation(return_page_slug(),0,99,I18N_SHOW_MENU); ?>
to output the whole navigation tree.

The style sheet would have to look like this (only relevant styles shown):
Code:
.sitemenu li ul {
  display:none;
}
.sitemenu li.currentpath > ul,
.sitemenu li.current > ul,
.sitemenu li:hover > ul {
  display:block;
}

Corrected: return_page_slug() must be used
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#34
I meant rather to a combination of these two effects,

your effec plus my previuos ( when i am od site "nad" or "pod" the sub menu is visible all the time)

thanks for the quick reply
Reply
#35
sciera Wrote:I meant rather to a combination of these two effects,

your effec plus my previuos ( when i am od site "nad" or "pod" the sub menu is visible all the time)

thanks for the quick reply

There was an error in my answer: of course you have to use return_page_slug() as first parameter to get_i18n_navigation, not 'index'.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#36
Now there's a new problem, the following menu items do not move down when opens submenu

Code:
.sitemenu {
  position: relative;
  height: 1.4em;
  margin-top:0px;
  padding-bottom:40px;
  margin-left:-20px;

  }
.sitemenu ul {
  position: absolute;
  list-style: none;
}
.sitemenu li {
  float: left;
  padding: 2px 10px 2px 7px;
  width: 8em;
  color:#333;
  font-size:18px;
   letter-spacing:1px;
  margin-bottom:5px;
  padding-right:70px;
  background:#333;
  text-decoration:none;
  border-radius:4px;
  -moz-border-radius:4px;
  -khtml-border-radius:4px;
    -webkit-border-radius:4px;
        border-top:1px solid rgba(255,255,255,.4);
    background: -moz-linear-gradient(top, #444 0%, #222 100%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#444), color-stop(100%,#222));
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#222222',GradientType=0 );
    
    }

.sitemenu li a {
  color: #ECECEC;
  text-decoration: none;  
  border-bottom: none;
  font-family: Impact, Charcoal, sans-serif;  
  line-height:1.2em;
  font-weight:100;
  text-transform:uppercase;
  

}
.sitemenu li ul {
  display: none;
  margin-left:8px;
  margin-bottom:50px;}
.sitemenu li.currentpath  ul, .sitemenu li.current  ul, .sitemenu li:hover  ul {
  display:block;
  font-weight:100}
.sitemenu li ul li {
    margin-top:7px;
  float: none;
  background:#333;
    text-decoration:none;
    border-radius:4px;
    margin-bottom:40px;
    -moz-border-radius:4px;
    -khtml-border-radius:4px;
    -webkit-border-radius:4px;
    border-top:1px solid rgba(255,255,255,.4);
    background: -moz-linear-gradient(top, #444 0%, #222 100%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#444), color-stop(100%,#222));
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#222222',GradientType=0 );
}
.sitemenu li:hover {
    background:#6B94B4;
}
.sitemenu li:hover > ul {
    color:#000;
}
.sitemenu li:hover ul li {
  background-color: #333;
  border: none 0;
  display:block;
}
.sitemenu li > ul > li:hover {
    background:#6B94B4;}


i know, my css is crap, but I have tried everything
Reply
#37
sciera Wrote:Now there's a new problem, the following menu items do not move down when opens submenu

Remove every property position, float and display except those I mentioned in the previous mail.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#38
@ mvlcek you are my hero!

I know that I'm strenuous but I cant fix this menu

1. how to stretch the black bars to the left
2. how to do that only one submenu will be highlighted

3 . the screens i made in Opera but in firefox and IE the menu is broken, how to fix it? (I would like to make it look like the picture)

see attached image

Code:
.sitemenu {
  position: relative;
  height: 1.4em;
  margin-top:0px;
  margin-left:-20px;
  margin-bottom:60px;
}
.sitemenu li ul {
  display:none;
  margin-left:8px;
}
.sitemenu li.currentpath > ul,
.sitemenu li.current > ul,
.sitemenu li:hover > ul {
  display:block;
}
.sitemenu ul {

  list-style: none;
}
.sitemenu li {
     margin: 12px 0 12px 0;
     border-top:1px solid rgba(255,255,255,.4);
     background: -moz-linear-gradient(top, #444 0%, #222 100%);
     background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#444),     color-stop(100%,#222));
     filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#222222',GradientType=0 );
    }

.sitemenu li a {
  color: #ECECEC;
  text-decoration: none;  
  border-bottom: none;
  font-family: Impact, Charcoal, sans-serif;  
  line-height:1.2em;
  font-weight:100;
  text-transform:uppercase;
  
  padding: 3px 50px 3px 5px;

  background-color:#333;
  font-size:18px;
   letter-spacing:1px;

  background:#333;

  text-decoration:none;
  border-radius:4px 0 0 4px;
  -moz-border-radius:4px 0 0 4px;
  -khtml-border-radius:4px 0 0 4px;
  -webkit-border-radius:4px 0 0 4px;
  font-weight:100;
}
.sitemenu li:hover a{
    background:#6B94B4;
}
Reply
#39
sciera Wrote:1. how to stretch the black bars to the left

try with display:block property for .sitemenu li a
Addons: blue business theme, Online Visitors, Notepad
Reply
#40
@yojoe tak teraz na operze wygląda świetnie ( poza tym "podswietleniem") ale na firefoxie i IE jest tragedia, dzieki za pomoc

-----------------------------------------------------------------------------------------------------------------

it's look better, but its still problem with highlights the submenu and other webbrowsers ( p.2 and p.3 in my previos post)
Reply
#41
hmmm....

Code:
.sitemenu li a {
display:block;
  color: #ECECEC;
  font: normal 18px Impact, Charcoal, sans-serif;  
  line-height:22px;
  text-transform:uppercase;
  letter-spacing:1px;
  text-decoration:none;
  background-color:#333;
  -moz-border-radius:4px 0 0 4px;
  border-radius:4px 0 0 4px;
}
.sitemenu li a:hover {
    background:#6B94B4;
}

post this menu somewhere
Addons: blue business theme, Online Visitors, Notepad
Reply
#42
yojoe Wrote:post this menu somewhere
@yojoe i dont understand what you mean, i have theese lines

but i solve the problem with compability ( i move gradient parameters from .sitemenu li to .sitemenuli a ) so now its only a one problem with highlighting
Reply
#43
sciera Wrote:
yojoe Wrote:post this menu somewhere
@yojoe i dont understand what you mean, i have theese lines

but i solve the problem with compability ( i move gradient parameters from .sitemenu li to .sitemenuli a ) so now its only a one problem with highlighting

You still set the background color on .sitemenu li:hover a instead ONLY on .sitemenu li a:hover.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#44
ooo i forgot about it, big big thanks for you guys!
Reply
#45
I have 10 pages in my site which I want to divide into two menus.

First menu containing Home, Blog, Contact will go in the header and the second menu containing the rest of the pages will go in the sidebar.

I have installed i18n navigation plugin but I don't know how to achieve this.

Help?
Reply
#46
andyash Wrote:I have 10 pages in my site which I want to divide into two menus.

First menu containing Home, Blog, Contact will go in the header and the second menu containing the rest of the pages will go in the sidebar.

I have installed i18n navigation plugin but I don't know how to achieve this.

Help?

Home, Blog and Contact should be top-level pages (no parent).
The rest of the pages should be children of Home (Parent = index).
For the top menu bar use
Code:
<?php get_i18n_navigation(return_page_slug()); ?>
For the sidebar menu use
Code:
<?php get_i18n_navigation('index',1,99); ?>
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#47
I18N version 1.7:
  • fixes the display of menus texts/titles with < and/or quotes
  • etc., see here
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#48
Does anyone have an idea how to display a menu tree containing slugs of defined page, where slugs also have nested pages, but slugs on lowest levels shouldn't be opened until visitor clicks on their parents.
Structure I have contains top lvl pages, where a certain page (call it page1) has more nested pages inside, and they have another siblings (3 lvl menu)
index
page1
|- subpage1
subpage1sibling1
|-- subpage1sibling2
|-- subpage1sibling3
|-subpage2
|-- subpage2sibling1
|-- subpage2sibling2
|-- subpage2sibling3
|-subpage3
|-- siblings
...
page2
page3
etc.

I'm trying to show on all pages a menu consisting of page's1 1st level siblings:
|-subpage1
|-subpage2
|-subpage3
When visitor clicks on subpage1, its siblings should be shown along with siblings of page1 (parent).
|-subpage1
|-- subpage1sibling1
|-- subpage1sibling2
|-- subpage1sibling3
|-subpage2
|-subpage2
|-subpage2

Can't find the way to display needed data using return_i18n_menu_data function.
Maybe there's another way of displaying such menu structure and navigation ?
Addons: blue business theme, Online Visitors, Notepad
Reply
#49
yojoe Wrote:Does anyone have an idea how to display a menu tree containing slugs of defined page, where slugs also have nested pages, but slugs on lowest levels shouldn't be opened until visitor clicks on their parents.

Isn't this the standard behaviour?
If you click on a page it is shown with its siblings and children (and parents and their siblings). If you click on a child, it is shown along with its siblings and children.

To not show the first level, you have to use <?php get_i18n_navigation(return_page_slug(),1,99) ?>.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#50
mvlcek Wrote:Isn't this the standard behaviour?

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.

Maybe I'm doing something wrong, but looking at outputted html all siblings are being outputted no matter what.
Addons: blue business theme, Online Visitors, Notepad
Reply




Users browsing this thread: 4 Guest(s)