Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 12:27:51 PM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155536 Posts in 21712 Topics by 7736 Members
Latest Member: chris85
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Menu with one step without links  (Read 730 times)
viiksi

Offline Offline

Posts: 5


« on: October 19, 2010, 12:57:29 PM »

Hello,

Heres a little explaining.

root
-level1
-level1
---level2 (Not link)
-----level3
---level2 (Not link)
-----level3
-----level3
-level1

Heres what i have at the moment.
<?php show_menu2(0, SM2_ROOT+1, SM2_ALL, SM2_ALL, false,"\n</li>", false, false, false, '<ul id="header_menu" class="menu">'); ?>

In this i make links that starts from level1. (root level shows elsewhere)
What i want is Level2 to be only text and not linkable row but still should open Level3 onmouseover. And of course level3 should be links again Wink

Not sure if i explained this easy enough Wink

Could there be some css code that would make level2 not linking to that page.

 - viiksi
Logged
Stefek
WebsiteBaker Org e.V.

Offline Offline

Posts: 4884



« Reply #1 on: October 19, 2010, 01:07:44 PM »

You can use just sm2 for this.

See documentation and the topic on conditionals
Pseudocode: [if level=n {nolink} else {link} ]

Regards,
Stefek
« Last Edit: October 19, 2010, 01:09:52 PM by Stefek » Logged

"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
viiksi

Offline Offline

Posts: 5


« Reply #2 on: October 19, 2010, 01:22:31 PM »

Thanks for fast answer.

I read the documentation many times allready even before this Wink
But in that document there is no {nolink} option at all.

i still dont get it where in that line to put your code.

 - viiksi

Logged
Stefek
WebsiteBaker Org e.V.

Offline Offline

Posts: 4884



« Reply #3 on: October 19, 2010, 01:43:56 PM »

it was just a "pseudo code".

Please read the opic on conditionals, as I said before:
http://code.google.com/p/showmenu2/source/browse/tags/4.9/README.en.txt#463

What you'll need is something like

...
      $aItemOpen      = '[if level=2 {<li>[menu_title]} else {<li>[a][menu_title]</a>}]',
...


Regards,
Stefek
Logged

"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
DarkViper
Development Team
*****
Offline Offline

Posts: 1252


« Reply #4 on: October 19, 2010, 02:03:03 PM »

...
      $aItemOpen      = '[if level=2 {<li>[menu_title]} else {<li>[a][menu_title]</a>}]',
...


this solution is ok. But unfortunately  hardcoded to a special level. Softcoded it can look like that:
Code:
     $aItemOpen =>>    '[if target==_self {<li>[menu_title]} else {<li>[a][menu_title]</a>}]',

it's a bit tricky use of Target. For 'normal' pages you can use the target '_top' for 'break frameset' and '_blank' for an external link. If you choose '_self' so the menu_title is displayed without a link.

ps @stefek:: compare by  == instead of = then it works..  wink
« Last Edit: October 19, 2010, 02:06:30 PM by DarkViper » Logged

Anleitungen lesen und selber nachdenken ist anstrengend...  Da lass ich doch lieber andere für mich denken...

In 1984:  Nineteen Eighty-Four is a unrealistic utopia!!
In 2012:  Nineteen Eighty-Four is a little piece only of our reality!!
viiksi

Offline Offline

Posts: 5


« Reply #5 on: October 19, 2010, 02:13:55 PM »

it was just a "pseudo code".

I really have to confess that i had to use wikipedia even to check what "pseudo code" means Wink

As you might notice now im not good at coding.

But yes now we are on right track.

I will bang my head to wall tonight to get this work.

 ps. For this solution hardcoded works very well since its never going to be changed afterwards.

 - viiksi
Logged
Stefek
WebsiteBaker Org e.V.

Offline Offline

Posts: 4884



« Reply #6 on: October 19, 2010, 02:18:53 PM »

it's a bit tricky use of Target. For 'normal' pages you can use the target '_top' for 'break frameset' and '_blank' for an external link. If you choose '_self' so the menu_title is displayed without a link.
Too confusing..
It's the same as using  Keywords for unique titles in the menu wink

ps @stefek:: compare by  == instead of = then it works..  wink
Of course, just on the fly, no testing..

Regards,
Stefek
Logged

"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
viiksi

Offline Offline

Posts: 5


« Reply #7 on: October 19, 2010, 10:24:29 PM »

Well thanks for you both.
I know finally understand what those false words even means on that code Wink

It was good that you didnt tell me right solution straightaway so i had to think.

I had to do some modification to the code so it started to work.

...
      $aItemOpen      = '[if level=2 {<li>[menu_title]} else {<li>[a][menu_title]</a>}]',
...


to '[if(level=2) {<...
Logged
Stefek
WebsiteBaker Org e.V.

Offline Offline

Posts: 4884



« Reply #8 on: October 19, 2010, 10:37:17 PM »

It was good that you didnt tell me right solution straightaway so i had to think.

Yes great,
mostly like people using their own brains  wink

Glad you got it working.

Regards,
Stefek
Logged

"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
davidwaterman

Offline Offline

Posts: 8


« Reply #9 on: February 16, 2011, 10:04:28 AM »

Hi Guy's I'm trying to do the same. But get code printing to the screen. Would you tell me what i'm doing wrong please?

      <?php show_menu2(1, SM2_ROOT, SM2_ALL, SM2_ALL, '[iflevel=1{<li>[menu_title]}else{<li>[a][menu_title]</a>}]', "\n</li>", false, false, false, '<ul id="header_menu" class="menu">'); ?>

Thanks in advance.
Logged
Pages: [1]   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!