WBCE CMS Forum

WBCE CMS – Way Better Content Editing.

You are not logged in.

#1 30.03.2018 13:57:50

foxlake
Member

topmenu item only to open submenu

Hai there,

There are many templates (html responsive) that you can build to a WBCE template.
I'm running now and then against the following:

Some templates goes out from TopMenu items whitout link in it.  Its just to open up the menu under this.
Sometimes the small menu for Phones has a closed menu. 
In WBCE there is always?  a link on the top item.  So when we click to open the top, you get to the site instead of opening the submenu.

If you know what i mean.

Is there a way to have menu items (top) whiteout link on it ?

So i can easy take that kind of template to.
Its not easy for me to change the nav js. systems in the templates.

Thank you in advance.
Greetings, Niek  (NL)

Offline

#2 30.03.2018 14:07:14

florian
Administrator

Re: topmenu item only to open submenu

There is a solution, you can see it for example in the "Buschwerk" template. You have to use conditional cases in the show_menu2 call:

 $mainnav = show_menu2(
			$aMenu          = 1,
			$aStart         = SM2_ROOT,
			$aMaxLevel      = SM2_ALL,
			$aOptions       = SM2_ALL|SM2_PRETTY|SM2_BUFFER,
			$aItemOpen      = '<li><a [if (class!=menu-expand) {href="[url]" class="[class]" target="[target]"}]>[menu_title]</a>',
			$aItemClose     = '</li>',
			$aMenuOpen      = '<ul>',
			$aMenuClose     = '</ul>',
			$aTopItemOpen   = false,
			$aTopMenuOpen   = '<ul class="chevron">'
		  );	

Have a look at the initialization of $aItemOpen: The code [if (class!=menu-expand) {href="[ url ]" class="[class]" target="[target]"}] (note the square brackets) tells show_menu2 not to set the href tag so that the entry itself does not open any link but just show the sub menu when pointing on / touching it. The same way it can be done for other menu scrips - it depends on each implementation how the code has to be set in detail, but the concept is the same.

Feel free to post the example code of the menu here, if you need help configuring the show_menu2 call.


Sorgen sind wie Nudeln: man macht sich meist zu viele.

Offline

#3 30.03.2018 17:31:34

foxlake
Member

Re: topmenu item only to open submenu

Thank you,  SM-2_PRETTY  is showing now menu at all.
But when I only changed the aItemOpen, to your suggestion it works !
Thank you very much.

Offline

#4 30.03.2018 17:57:47

bernd
Developer

Re: topmenu item only to open submenu

The only task for SM-2_PRETTY without the -! is to beautify the HTML-Output for better readbility.


... nein in Europa verwenden wir beim Programmieren nicht € statt $ ...

Offline

Board footer

up