Creating non clickable nav link

Permalink
Hi
I am trying to create a non clickable link in the navigation, where I want to be able to click on sub pages only and not the parent link. Previously I added an external link with # as the url, then moved the sub pages underneath this. Now, it will not allow me to do it on this site and comes up with an error:
You may not move/copy/alias the chosen page(s) to that location.

I am I would say beginner level at concrete 5, however sure there is an easy answer?

Thanks in advance

 
siton replied on at Permalink Reply
siton
You must create autoNav custom template. From UI perspective users will try to click on the parent (i think its always better to add this extra parent page with "page-list" to the childrens).

Before you start learn this issue:
How to create custom template tut (or in C5 docs)
https://www.youtube.com/watch?v=yjqkZiwcNNE...

The autoNav use array of nav items (forEach nav item do this and this) - You need some time to learn the idea of the autoNav view.php code (be patient).

autoNav--> view.php - Step 1:
uncomment this (line 80+-)
if ($ni->hasSubmenu) {
      //class for items that have dropdown sub-menus
      $classes[] = 'i-am-the-parent-i-am-not-clickable-in-this-template';
   }

Than you can use this "if" and edit your html output. Example
foreach ($navItems as $ni) {
if ($ni->hasSubmenu){
         echo '<li class="' . $ni->classes . '">'; //opens a nav item - class = i-am-the-parent-i-am-not-clickable-in-this-template
         echo '<a href="#" class="not-Clickable">' . $ni->name . '</a>'; //I am not clickable         
      }

If you set the autoNav to show sub-items + li with sub items --> The output will be....
...code....
<li class=i-am-the-parent-i-am-not-clickable-in-this-template">
<a href="#" class="not-Clickable">page-name</a>
....rest of the code....

Also its helpful to see the code of nested Li items (really basic but important):
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_lists_nest...
siton replied on at Permalink Reply
siton
Also see my answer her - its little abstract diagram of auto-nav loop but i believe it will help you.

dropdown menu autonav:
https://www.concrete5.org/community/forums/5-7-discussion/dropdown-m...