Make Menu Item non-clickable SOLVED
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
-
- Joomla! Explorer
- Posts: 370
- Joined: Fri Jun 13, 2008 7:49 pm
- Location: Escondido, CA 92026
- Contact:
Make Menu Item non-clickable SOLVED
Hello All,
I have a general question - not sure this is the right forum but here goes.
I have often wondered if there is a way or technique that would make Joomla generated menu items non-clickable. What I mean to say is that some times, it is best to have a parent menu item that has lots of children menu items (menu level 0 with lots of menu level 1s) and have the parent show as part of the menu but non-clickable. The user would have the choice to click on the children menu items only.
I can do this if I use SWmenu, but I have not found a way with just the Joomla generated menus.
Any thoughts?
I have a general question - not sure this is the right forum but here goes.
I have often wondered if there is a way or technique that would make Joomla generated menu items non-clickable. What I mean to say is that some times, it is best to have a parent menu item that has lots of children menu items (menu level 0 with lots of menu level 1s) and have the parent show as part of the menu but non-clickable. The user would have the choice to click on the children menu items only.
I can do this if I use SWmenu, but I have not found a way with just the Joomla generated menus.
Any thoughts?
Last edited by djohnson1215 on Mon Oct 19, 2009 3:26 pm, edited 1 time in total.
- imanickam
- Joomla! Master
- Posts: 28210
- Joined: Wed Aug 13, 2008 2:57 am
- Location: Chennai, India
Re: Make Menu Item non-clickable
In the Joomla! generated menu, you can make the parent menu item to be of the type External Link and do not provide any link for that menu item. Then it will become non-clickable.
Ilagnayeru (MIG) Manickam | இளஞாயிறு மாணிக்கம்
Joomla! - Global Moderators Team | Joomla! Core - Tamil (தமிழ்) Translation Team Coordinator
Former Joomla! Translations Coordination Team Lead
Eegan - Support the poor and underprivileged
Joomla! - Global Moderators Team | Joomla! Core - Tamil (தமிழ்) Translation Team Coordinator
Former Joomla! Translations Coordination Team Lead
Eegan - Support the poor and underprivileged
-
- Joomla! Ace
- Posts: 1964
- Joined: Tue Jun 09, 2009 2:21 am
- Location: WV
- Contact:
Re: Make Menu Item non-clickable
Make the parent an external link to #
Still "clickable" but goes nowhere.
Still "clickable" but goes nowhere.
http://jeffchannell.com - Joomla Extensions & Support
http://biziant.com - Open Joomla Firewall/IDS
Unsolicited private messages/emails = hire me to fix your problem.
http://biziant.com - Open Joomla Firewall/IDS
Unsolicited private messages/emails = hire me to fix your problem.
καλλιστι
-
- Joomla! Explorer
- Posts: 370
- Joined: Fri Jun 13, 2008 7:49 pm
- Location: Escondido, CA 92026
- Contact:
Re: Make Menu Item non-clickable
jeffchannell and imanickam,
Great replies.
Jeff, as I was writing my question, I wondered if your suggestion would work.
I even though of making an article whose alias was #, but I am guessing Joomla will disallow this character.
Tks again for your replies.
Great replies.
Jeff, as I was writing my question, I wondered if your suggestion would work.
I even though of making an article whose alias was #, but I am guessing Joomla will disallow this character.
Tks again for your replies.
- raulbcordoba
- Joomla! Explorer
- Posts: 299
- Joined: Mon Aug 28, 2006 5:32 pm
Re: Make Menu Item non-clickable
Also making it as a separator and styling it into the CSS as a link, that should work too.
-
- Joomla! Explorer
- Posts: 370
- Joined: Fri Jun 13, 2008 7:49 pm
- Location: Escondido, CA 92026
- Contact:
Re: Make Menu Item non-clickable
raulbcordoba,
That is an intriguing method. I see where you are going with this idea, but not sure how to implement it in Joomla. Do you have an example site I could see to check it out, or perhaps you could be a bit more verbose in your explanation.
:-)
That is an intriguing method. I see where you are going with this idea, but not sure how to implement it in Joomla. Do you have an example site I could see to check it out, or perhaps you could be a bit more verbose in your explanation.
:-)
- raulbcordoba
- Joomla! Explorer
- Posts: 299
- Joined: Mon Aug 28, 2006 5:32 pm
Re: Make Menu Item non-clickable
Hi,
I have used this method few times in template development and works ok too.
When you create a menu item you can choose the type, sure thing, and if you go down on the list you'll see "Separator" this is almost like the "external link" but withouth link so you have a dummy menu item that does nothing so... what to do with it?
For dropdown menus, you can make the parent items like that if you don't really need them to have content when clickin on so lets say you just use them as a gateway to reach submenuitems, makes sense?
The difference when you create a "separator" menu item is that the output code is a bit different from normal links so you'll have to take care of CSS to make them look as if they were links...
This is a standard menu item:
Then you have with the separator:
So you need to CSS both <li><a> and <li><span class="separator"> the same so they have the same style.
Hope this help
...
I have used this method few times in template development and works ok too.
When you create a menu item you can choose the type, sure thing, and if you go down on the list you'll see "Separator" this is almost like the "external link" but withouth link so you have a dummy menu item that does nothing so... what to do with it?
For dropdown menus, you can make the parent items like that if you don't really need them to have content when clickin on so lets say you just use them as a gateway to reach submenuitems, makes sense?
The difference when you create a "separator" menu item is that the output code is a bit different from normal links so you'll have to take care of CSS to make them look as if they were links...
This is a standard menu item:
Code: Select all
<li class="itemX"><a href="#"><span>Label</span></a></li>
Code: Select all
<li class="itemX"><span class="separator"><span>Label</span></span></li>
Hope this help
...
-
- Joomla! Explorer
- Posts: 370
- Joined: Fri Jun 13, 2008 7:49 pm
- Location: Escondido, CA 92026
- Contact:
Re: Make Menu Item non-clickable
raulbcordoba,
Fantastic. Great post. I always wondered about the "Separator" menu type. Appreciate your verbose explanation.
Tks to jeffchannell and imanickam for their contribution.
Case closed :-)
Fantastic. Great post. I always wondered about the "Separator" menu type. Appreciate your verbose explanation.
Tks to jeffchannell and imanickam for their contribution.
Case closed :-)
-
- Joomla! Explorer
- Posts: 370
- Joined: Fri Jun 13, 2008 7:49 pm
- Location: Escondido, CA 92026
- Contact:
Re: Make Menu Item non-clickable - FOLLOW UP QUESTION
Hi All,
Got one more follow up question about menu items.
In some cases, I would like to "hide" the home menu item. I just don't want it to show. Instead, I would like to have a HOME link somewhere else on the page such as header top_right.
The problem I run into is that Joomla needs a default menu and menu item. If that default menu item is the home page (frontpage), then I can not disable that menu item.
Now, I could create a new menu and position it in the top_right of the header. And I could make this new menu the default menu. And I could make the HOME link the default menu item. But that is lots of work. I would rather just create some <a tags in the header.
Is there another way around this challenge?
Got one more follow up question about menu items.
In some cases, I would like to "hide" the home menu item. I just don't want it to show. Instead, I would like to have a HOME link somewhere else on the page such as header top_right.
The problem I run into is that Joomla needs a default menu and menu item. If that default menu item is the home page (frontpage), then I can not disable that menu item.
Now, I could create a new menu and position it in the top_right of the header. And I could make this new menu the default menu. And I could make the HOME link the default menu item. But that is lots of work. I would rather just create some <a tags in the header.
Is there another way around this challenge?
- raulbcordoba
- Joomla! Explorer
- Posts: 299
- Joined: Mon Aug 28, 2006 5:32 pm
Re: Make Menu Item non-clickable SOLVED
I think it will be the best option as you'll be able to manage the menu items in an easy way and through admin instead of hardcoding them into the template or inside a module?
In my case I'd take that way.
In my case I'd take that way.
-
- Joomla! Explorer
- Posts: 370
- Joined: Fri Jun 13, 2008 7:49 pm
- Location: Escondido, CA 92026
- Contact:
Re: Make Menu Item non-clickable SOLVED
raulbcordoba,
I think I just thought of an easier way.
If I create another menu and make it the default. Then assign the home page menu item to it and make it default. NOW FOR THE TRICK. If I publish this new menu to a position that does not exist, that menu will never appear on the page, but the default condition should still apply.
I think that will work?????
I think I just thought of an easier way.
If I create another menu and make it the default. Then assign the home page menu item to it and make it default. NOW FOR THE TRICK. If I publish this new menu to a position that does not exist, that menu will never appear on the page, but the default condition should still apply.
I think that will work?????
-
- Joomla! Explorer
- Posts: 370
- Joined: Fri Jun 13, 2008 7:49 pm
- Location: Escondido, CA 92026
- Contact:
Re: Make Menu Item non-clickable SOLVED
YEP, that did it. Very cool trick.
Steps to hide HOME PAGE menu item
0) add position in templateDetails.xml file. The position name should not be called in the index.php file. Instead, the position is an 'orphan' position.
1) create new menu.
2) add new menu item to newly created menu
2a) assign frontpage content to newly created menu item.
3) define new menu and new menu item as 'DEFAULT'.
4) add link to domain somewhere on page (footer, header, side column, etc.)
Now, when typing in the domain in a browser, the visitor goes to the home page. All top navs go to interior pages. Hard coded home page link goes to home page.
:-)
Steps to hide HOME PAGE menu item
0) add position in templateDetails.xml file. The position name should not be called in the index.php file. Instead, the position is an 'orphan' position.
1) create new menu.
2) add new menu item to newly created menu
2a) assign frontpage content to newly created menu item.
3) define new menu and new menu item as 'DEFAULT'.
4) add link to domain somewhere on page (footer, header, side column, etc.)
Now, when typing in the domain in a browser, the visitor goes to the home page. All top navs go to interior pages. Hard coded home page link goes to home page.
:-)
- raulbcordoba
- Joomla! Explorer
- Posts: 299
- Joined: Mon Aug 28, 2006 5:32 pm
Re: Make Menu Item non-clickable SOLVED
Cool,
It can be a dirty trick but if it works then it's a good solution.
There is always a way in Joomla! :P
It can be a dirty trick but if it works then it's a good solution.
There is always a way in Joomla! :P
-
- Joomla! Explorer
- Posts: 370
- Joined: Fri Jun 13, 2008 7:49 pm
- Location: Escondido, CA 92026
- Contact:
Re: Make Menu Item non-clickable SOLVED
raulbcordoba, What is 'dirty' about it.
I see more and more websites with out a "HOME" menu item in the primary menu. These sites have a "HOME" link either in the top right/footer/ or somewhere else. And most internet savvy people now know to click on the logo to go to the home page. So having a "HOME" link item detracts from a site's conversion funnel.
I have been trying to solve this kind of problem with Joomla for several month (on various projects). Now, I finally figured out a way and it seems to work well.
Did you mean "dirty" in jest? :-)
just my opinion here.
I see more and more websites with out a "HOME" menu item in the primary menu. These sites have a "HOME" link either in the top right/footer/ or somewhere else. And most internet savvy people now know to click on the logo to go to the home page. So having a "HOME" link item detracts from a site's conversion funnel.
I have been trying to solve this kind of problem with Joomla for several month (on various projects). Now, I finally figured out a way and it seems to work well.
Did you mean "dirty" in jest? :-)
just my opinion here.
- raulbcordoba
- Joomla! Explorer
- Posts: 299
- Joined: Mon Aug 28, 2006 5:32 pm
Re: Make Menu Item non-clickable SOLVED
Oh, don't missunderstand my words.
With dirty I meant "more hard" to do than usual things.
It just makes you think on how to use Joomla!, nothing more
With dirty I meant "more hard" to do than usual things.
It just makes you think on how to use Joomla!, nothing more
-
- Joomla! Explorer
- Posts: 370
- Joined: Fri Jun 13, 2008 7:49 pm
- Location: Escondido, CA 92026
- Contact:
Re: Make Menu Item non-clickable SOLVED
One of these days, I would like to see a thread devoted to all the little tricks and tips for Joomla. May be I will start one.
-
- Joomla! Intern
- Posts: 53
- Joined: Mon Aug 24, 2009 9:19 am
- Location: kathmandu, Nepal
Re: Make Menu Item non-clickable
hi,imanickam wrote:In the Joomla! generated menu, you can make the parent menu item to be of the type External Link and do not provide any link for that menu item. Then it will become non-clickable.
i have done this. the parent menu item is still clickable but when i click it...the page refreshes...
the problem is also that the sub menu-items of that parent menu are also not working..when i click the sub menu-item is shows 404 error article not found....how 2 solve this
thanks
- raulbcordoba
- Joomla! Explorer
- Posts: 299
- Joined: Mon Aug 28, 2006 5:32 pm
Re: Make Menu Item non-clickable SOLVED
For the "clickable" issue you can refer to my first post where I tell to use a "separator" menu item type instead of "external link".
If you getting 404 errors then you you may check your menu routes/url or perhaps any SEF addons you're using?
If you getting 404 errors then you you may check your menu routes/url or perhaps any SEF addons you're using?
-
- Joomla! Enthusiast
- Posts: 213
- Joined: Mon Nov 05, 2007 8:54 pm
Re: Make Menu Item non-clickable
Thought this was worth quoting so it all shows up more recently in the thread.raulbcordoba wrote:Hi,
I have used this method few times in template development and works ok too.
When you create a menu item you can choose the type, sure thing, and if you go down on the list you'll see "Separator" this is almost like the "external link" but withouth link so you have a dummy menu item that does nothing so... what to do with it?
For dropdown menus, you can make the parent items like that if you don't really need them to have content when clickin on so lets say you just use them as a gateway to reach submenuitems, makes sense?
The difference when you create a "separator" menu item is that the output code is a bit different from normal links so you'll have to take care of CSS to make them look as if they were links...
This is a standard menu item:Then you have with the separator:Code: Select all
<li class="itemX"><a href="#"><span>Label</span></a></li>
So you need to CSS both <li><a> and <li><span class="separator"> the same so they have the same style.Code: Select all
<li class="itemX"><span class="separator"><span>Label</span></span></li>
Hope this help
...
Interestingly, I didn't have to mess at all with CSS. Simply creating the separator worked perfectly, though that may have had something to do with my template being produced in Artisteer to begin with. Perhaps the CSS is already set up as needed for me?
In any case, this works perfectly. I never bothered to play with the separator before. I always assumed (apparently mistakenly) that all it would do is create a line or something like that between buttons.
Don't let the number of stars fool ya! I spend most of my time in the "real world" working with and troubleshooting Joomla and the many extensions for it.
-
- Joomla! Fledgling
- Posts: 1
- Joined: Mon Jun 27, 2016 9:05 am
Re: Make Menu Item non-clickable
Hi,raulbcordoba wrote:Hi,
I have used this method few times in template development and works ok too.
When you create a menu item you can choose the type, sure thing, and if you go down on the list you'll see "Separator" this is almost like the "external link" but withouth link so you have a dummy menu item that does nothing so... what to do with it?
For dropdown menus, you can make the parent items like that if you don't really need them to have content when clickin on so lets say you just use them as a gateway to reach submenuitems, makes sense?
The difference when you create a "separator" menu item is that the output code is a bit different from normal links so you'll have to take care of CSS to make them look as if they were links...
This is a standard menu item:Then you have with the separator:Code: Select all
<li class="itemX"><a href="#"><span>Label</span></a></li>
So you need to CSS both <li><a> and <li><span class="separator"> the same so they have the same style.Code: Select all
<li class="itemX"><span class="separator"><span>Label</span></span></li>
Hope this help
...
I tried to put them both in Link CSS Style field, but it didn't work.
Where am I going to put in this code?
This is a standard menu item:
Code: Select all
<li class="itemX"><a href="#"><span>Label</span></a></li>
Then you have with the separator:
Code: Select all
<li class="itemX"><span class="separator"><span>Label</span></span></li>