Make top-level links inactive.

Search engine friendly UL list type menu for Actinic V8 and V9. Styled by CSS and animated by a small JavaScript.
Post Reply
norman
Site Admin
Posts: 1238
Joined: Sat Feb 07, 2004 9:55 pm

Make top-level links inactive.

Post by norman » Mon Mar 15, 2010 4:47 pm

If you want to top-level links not to be clickable:-

Go to Design / Library / Layouts / NorList Menu / NorList Dynamic Menu Code.

Look for the (very long) line:

Code: Select all

<li><a href='<actinic:block if="%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20AND%0d%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e" ><actinic:variable name="SectionPageName" /></actinic:block><actinic:block if="%28%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20%3d%3d%20false%29%20OR%0d%28%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e%20%3d%3d%20false%29" ><actinic:variable name="SectionURL" /></actinic:block>'><Actinic:Variable Name="SectionName"></a></actinic:block></actinic:block>
Replace it with:

Code: Select all

<li><a href='<actinic:block if="%3cactinic%3avariable%20name%3d%22SectionLevelIsGreaterThan1%22%20%2f%3e"><actinic:block if="%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20AND%0d%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e" ><actinic:variable name="SectionPageName" /></actinic:block></actinic:block><actinic:block if="%28%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20%3d%3d%20false%29%20OR%0d%28%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e%20%3d%3d%20false%29" ><actinic:variable name="SectionURL" /></actinic:block><actinic:block if="%3cactinic%3avariable%20name%3d%22SectionLevel%22%20%2f%3e%20%3d%3d%201">javascript:return false;</actinic:block>'><Actinic:Variable Name="SectionName"></a></actinic:block></actinic:block>
Norman

pauliem
Posts: 1
Joined: Thu Feb 03, 2011 9:55 pm

Re: Make top-level links inactive.

Post by pauliem » Thu Feb 03, 2011 10:00 pm

Is it possible to make a link inactive if it has children? For example, we have a three tier menu currently using NorList:

Code: Select all

TopLevel1
TopLevel2
  SubItem1
  SubItem2
  SubItem3
    SubLevel2Item1
    SubLevel2Item2
TopLevel3
What we are trying to do is deactivate any item which has a child. So in this example TopLevel2 & SubItem3 would have thier links disabled, but all of the others would be active.

Would be really grateful if you can see anyway that this can be acheived through NorList.

norman
Site Admin
Posts: 1238
Joined: Sat Feb 07, 2004 9:55 pm

Re: Make top-level links inactive.

Post by norman » Fri Feb 04, 2011 12:30 am

I can't think of a way to do this that wouldn't require a big rewrite of how NorList works.

If you want me to write something specific for you email me for a quote.

Also, my Accordion Menu does work in the way you want. It may be more cost effective to change menus.
Norman

pilgrim
Posts: 2
Joined: Mon Oct 08, 2012 6:41 am

Re: Make top-level links inactive.

Post by pilgrim » Mon Oct 08, 2012 6:55 am

Good Morning,
I've been looking to make the top-level links non-clickable, and found this post which is exactly what I needed:
viewtopic.php?f=9&t=478

It looks as though the code has been updated?, - as although I found the long line

Code: Select all

<li><a href='<actinic:block if="%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20AND%0d%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e" ><actinic:variable name="SectionPageName" /></actinic:block><actinic:block if="%28%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20%3d%3d%20false%29%20OR%0d%28%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e%20%3d%3d%20false%29" ><actinic:variable name="SectionURL" /></actinic:block>'><Actinic:Variable Name="SectionName"></a></actinic:block></actinic:block>
This part of the code (last bit of the above line)

Code: Select all

"></a></actinic:block></actinic:block>
is different in the menu version I have, it seems to be replaced with:

Code: Select all

><actinic:block if="%3cactinic%3avariable%20name%3d%22NorListDepth%22%20%2f%3e%20%3e%201"><actinic:variable name="NorListSubSection" value="NorList Sub Section 1" /></actinic:block></li>
</actinic:block>
I've tried various things including putting in what appears to be the new block from the latest menu, but all I've managed to get is 22 errors!
Hope I've explained this clearly,
Can anyone help please?
Many thanks
Ian

norman
Site Admin
Posts: 1238
Joined: Sat Feb 07, 2004 9:55 pm

Re: Make top-level links inactive.

Post by norman » Mon Oct 08, 2012 8:56 am

NorList has moved on and is now on NorList V3 with completely different code.

In NorList V3, making all the top-links inactive can be done by editing layout NorList Dynamic Menu Code and replacing the line:

Code: Select all

<li><a href='<actinic:block if="%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20AND%0d%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e" ><actinic:variable name="SectionPageName" /></actinic:block><actinic:block if="%28%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20%3d%3d%20false%29%20OR%0d%28%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e%20%3d%3d%20false%29" ><actinic:variable name="SectionURL" /></actinic:block>'><Actinic:Variable Name="SectionName"></a><actinic:block if="%3cactinic%3avariable%20name%3d%22NorListDepth%22%20%2f%3e%20%3e%201"><actinic:variable name="NorListSubSection" value="NorList Sub Section 1" /></actinic:block></li>
With the much simpler:

Code: Select all

<li><a href='javascript:void(0)'><Actinic:Variable Name="SectionName"></a><actinic:block if="%3cactinic%3avariable%20name%3d%22NorListDepth%22%20%2f%3e%20%3e%201"><actinic:variable name="NorListSubSection" value="NorList Sub Section 1" /></actinic:block></li>
If you want the better solution that makes only the top-level links that have sub-sections inactive then the replacement code becomes:

Code: Select all

<li><a href='<actinic:block if="%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20AND%0d%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e" ><actinic:variable name="SectionPageName" /></actinic:block><actinic:block if="%28%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20%3d%3d%20false%29%20OR%0d%28%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e%20%3d%3d%20false%29" ><actinic:variable name="SectionURL" /></actinic:block>' <actinic:block type="ChildSectionList"><actinic:block if="%3cactinic%3avariable%20name%3d%22ListIndex%22%20%2f%3e%20%3d%3d%201"> onclick="return false;"</actinic:block></actinic:block>><Actinic:Variable Name="SectionName"></a><actinic:block if="%3cactinic%3avariable%20name%3d%22NorListDepth%22%20%2f%3e%20%3e%201"><actinic:variable name="NorListSubSection" value="NorList Sub Section 1" /></actinic:block></li>
Norman

pilgrim
Posts: 2
Joined: Mon Oct 08, 2012 6:41 am

Re: Make top-level links inactive.

Post by pilgrim » Mon Oct 08, 2012 10:18 am

You really are a star Norman!
There's not many places where a javascript dummy like me would get an update to a question/answer 2 years old about an hour after it's posted.
Many thanks
Ian

Post Reply