[solved] expand menu only if parent href="#"

[solved] expand menu only if parent href="#" was created by yojoe

Posted 12 years 1 month ago #1808
Hello
I'm trying to find a solution, to make the menu expand only, when menu item's type is an external link with '#' value.
I loked into default_ component, separator and url php files and my programming skills are too low to accomplish such task.

Basically I'd like to have a menu which expands only when a menu item (link) points to href="#", but when it leads to an article or is an alias (its href value isn't empty) then it should point to the article, not expand next menu level.

Is it hard to do it, as "javascript:void()" values for href appears couple times, and I'm lost in all those conditional terms ?
Last Edit:12 years 1 month ago by yojoe
Last edit: 12 years 1 month ago by yojoe.

Please Log in or Create an account to join the conversation.

Replied by ced1870 on topic Re: expand menu only if parent href="#"

Posted 12 years 1 month ago #1809
hi
I don't understand your needs...
if you don't want sublevels, don't do it in your menu !
CEd

Joomlack Webmaster and Developer

by ced1870

Please Log in or Create an account to join the conversation.

Replied by yojoe on topic Re: expand menu only if parent href="#"

Posted 12 years 1 month ago #1843

ced1870 wrote: hi
I don't understand your needs...
if you don't want sublevels, don't do it in your menu !
CEd


Nnno no, it's not that I don't need an expanding menu.
The functionality I'd like to achieve connects two separated functions of accordeonCK:
1. all parent elements expands parent's children items
2. parent elements opens related article, while parent's image expands and collapses parent's children items

I'd like to merge those two solutions, to get rid off clickable image, and make the parent element expand its children (sublevel) only, if parent item is an external link, and its url value is '#'. If parent item points to an article (or is an other type of menu, for example blog view of articles) then it should open that page.

I could only make this possible for first parent by
1. setting the module to expand sublevel while clicking on it
2. setting menu element type to be an external link with "#" as its URL value
3. commenting the line 23 in default_url.php file, and if the parent's element value was #, then echo'ing a blank string (echo "";), if it was an url to article, then I left its value to make it point to an article.

This way I was able to expand a sublevel by clicking on its parent, because the generated menu element code was:
Code:
<a class="toggler toggler_1" href="#"> ... </a>
While this item pointed to nowhere, and its assigned class was toggler, it was expanding and collapsing the menu.

I don't know how to make other parent elements working like this, because there are dozen condionals with $item->flink generating the menu element in couple files, and I just can't understand the metodology as I'm rather poor php programmer :\

I hope I explained the situation.

ps. accordion menu lite ( extensions.joomla.org/extensions/structu...ccordion-menus/16517 ) afaik works in this way, but it works only with 2 levels of menu.



pps. I had to fix the paths to img in module administration, to see related images.
I don't know if anyone pointed this "bug", but I think it started to occure, after this menu module had its name changed, along with according paths.
by yojoe

Please Log in or Create an account to join the conversation.

Replied by ced1870 on topic Re: expand menu only if parent href="#"

Posted 12 years 1 month ago #1845
hummm, sorry but I have some difficulties to understand
are you using the last version of the module ? you can choose to open on image only(then link redirect to the article) or click on the link (then it will not redirect)

For images no I did not know anything about a bug on this.

Joomlack Webmaster and Developer

by ced1870

Please Log in or Create an account to join the conversation.

Replied by yojoe on topic Re: expand menu only if parent href="#"

Posted 12 years 1 month ago #1850

ced1870 wrote: hummm, sorry but I have some difficulties to understand
are you using the last version of the module ? you can choose to open on image only(then link redirect to the article) or click on the link (then it will not redirect)

For images no I did not know anything about a bug on this.


hihiii, the module is working fine,and both modes do what they should :)
With image mode link is redirecting to the article, and img is expanding/collapsing sublevel.
The same as second mode: no image, and link expands its submenu.

But navigation I'd like to use this module for, contains 3 levels, and some parents should point to article, while other should only expand the menu.
Hiding completely clickable image is not a solution.

That's why I'm asking, and all this mess is still about some kind of a third mode, which would involve both existing modes the menu module offers.
It would take from the first mode, where link redirects to article, but without image expanding/collapsing feature. And from the second mode, where link expands the sublevel only. But if this link is a type of an external link, and its value is set to "#", then it should expand/collapse sublevel.

Basically after creating a new menu item as a type of an external link (and adding some sublevel/child elements to it) and settting its URL value to "#", the generated link should look like this:
Code:
<a class="toggler toggler_ID" href="#">menu parent item</a>
This way the element will expand and collapse its sublevel items.
But if menu elements points to an article, then its value shouldn't be changed to
"javascript:void(0);"



ps. as it goes to the bug with paths to images in module, I'm using latest (?) mod_accordeonck_1.6.0
All paths to images are set to: /modules/mod_maximenuck/elements/images
for example: /modules/mod_maximenuck/elements/images/chart_organisation_add.png
Just did a fresh install of this module, so I can provide a screenshot.
Last Edit:12 years 1 month ago by yojoe
Attachments:
Last edit: 12 years 1 month ago by yojoe.

Please Log in or Create an account to join the conversation.

Replied by ced1870 on topic Re: expand menu only if parent href="#"

Posted 12 years 1 month ago #1851
ok ! thank you
do you have the last version ? 1.6.0 ?

Joomlack Webmaster and Developer

Last Edit:12 years 1 month ago by ced1870
Last edit: 12 years 1 month ago by ced1870.

Please Log in or Create an account to join the conversation.

Time to create page: 0.731 seconds

Fast and powerful creation, customizable and responsive.

Read More

We have 755 guests and one member online