Quick Nav:  Online Store   |   Login | Register

Disable a menu item from being clicked

Rate this topic:

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
AuthorMessages
tezza98
<20 Posts
Posts:18


04/03/2008 2:06 AM  

Is it possible to disable a menu item from being clicked
I have a submenu item that expands to another sub menu, and i dont want people to be able to click on the menu item itself, in the documentation there is a Page.DisableLink token, but it is not clear on how to use it.

 

 

Host Account
<250Posts
Posts:104


04/03/2008 7:35 AM  

If you disable the link in the settings of the page then most types of the menu will render it disabled.

If you are using a template type, then you can use the Page.DisableLink in an IF statement to decide if a link should be created or not.

[Level0-Anchor[  IIF({Page.DisableLink}='True',< span, < a href="{Page.Url}" title="{Tab.Title}" ) >{Tab.Name} IIF({Page.DisableLink}='True',< /span>,< /a>) ]]

tezza98
<20 Posts
Posts:18


04/03/2008 7:22 PM  
Posted By SnapsisHost on 04/03/2008 7:35 AM

If you disable the link in the settings of the page then most types of the menu will render it disabled.

If you are using a template type, then you can use the Page.DisableLink in an IF statement to decide if a link should be created or not.

[Level0-Anchor[ IF ({Page.DisableLink}='True',< span, < a href="{Page.Url}" title="{Tab.Title}" ) >{Tab.Name} IF ({Page.DisableLink}='True',< /span>,< /a>) ]]

 

 

Ive tried using this code in my page but it does not work. All it does is display this

"IF ({Page.DisableLink}='True',< span, < a href="{Page.Url}" title="{Tab.Title}" ) >{Tab.Name} IF ({Page.DisableLink}='True',< /span>,< /a>"

If i try this even to test the code it wont work

[Level0-Anchor[ IF ({Page.DisableLink}='True',Disabled, enabled)]]

which should display enabled or disabled depending, but it displayes this   "disabled, enabled" for every link.

can you take a look at this to see if it is correct please

 

John Mitchell
Posts:3471


04/03/2008 10:08 PM  
That code needs to be used in a Menu Template file, it does not go directly in your skin.

It's only for NavType="Template". All the other NavTypes will automatically render a span instead of an anchor if you disable the menu item in Page Settings.

Look at the ActiveResetHover or the SilverTabs hover for examples of template type menus.
tezza98
<20 Posts
Posts:18


04/03/2008 10:20 PM  

This is my template file where i put the code


it wont work - instead of displaying the links, it displays the actual code

 

 

- code didnt copy properly, so attached the file

 


Attachment: 143234968771.txt

Host Account
<250Posts
Posts:104


04/04/2008 8:33 AM  

Sorry, I did that code off the top of my head and it had a couple of bugs. 

IF ( should be IIF(   <-- no space and an extra I

Yours is also missing a closing Paren.

I have attached another template that has the proper code in level1


Attachment: 14434048471.txt

tezza98
<20 Posts
Posts:18


04/06/2008 12:24 AM  

thanks works a treat

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
Forums >Snapsis Product Support >CSS NavMenu > Disable a menu item from being clicked



ActiveForums 3.7
Powered by: Snapsis Software