Auto-Nav Sub Pages

Permalink Browser Info Environment
I would like to use the Auto-Nav using the custom template "Dropdown" on my home page.

Example:
PETS
Dogs
Cats

"PETS" being the main link and "Dogs" and "Cats" being the Sub Pages.

The 2 problems I'm having are...

1. In order to add the first link "PETS" to the navigation menu I need to add/create a new page, in which would be a blank page with just the default theme displaying. When an user clicks on the "PETS" link, in which I do not want to display anything being it is just a main link that will display so that the sub pages "Dogs" and "Cats" will display when a user hovers over the "PETS" link.

2. When I click on the "Dogs" link in the dropdown it will go to the "Dogs" page, but I have to go back to the "Home Page" in order for a user to select the "Cats" link. In other words, if I'm viewing the "Dogs" page and go to the main menu and hover over the "PETS" link the dropdown no longer displays the 2 sub pages "Dogs" or "Cats".

Is there any work around or fixes for these 2 problems?

Type: Discussion
Status: New
djhussey
View Replies:
c5studio replied on at Permalink Reply
c5studio
Hello,

In order for the top level menu item to not link, you would need to do some custom programming, as concrete5 does not currently have a way to do that. Let me know if you are interested and we can give you a quote.

Have you applied the "Dropdown" custom template on all your pages? That's the only reason I can think of, why the dropdown would work on one page but not another.
djhussey replied on at Permalink Reply
djhussey
I have applied the "Dropdown" custom template to all my pages with no change. I did notice that when I view your "Demo" of this template it also does not display the Dropdown menu while you are on any other pages but the "Home" page.
djhussey replied on at Permalink Reply
djhussey
Hello,

Okay I found the problem I was having with the Drop Down Menu only working from the "Home Page". As you said, I had to apply the "Dropdown" custom template to all the pages in my site. But what I did not do was edit each page under Auto-Nav to the following... Sub Pages to Display = Display All, Sub-Page Levels = Display a custom amount to "1 Levels".

Thank you for all your help!
bsimonton replied on at Permalink Reply
bsimonton
Ok so I have the same issue -- well sorta -- I cant get a drop down menu to show period!
Custom template -- how do you add this without "nuking" the current information -- been there done that already --
I just want a page link at the top menu to display the sub pages associated with the page.

and I AM NOT a designer, programmer -- I just have to maintain the site does anybody have some "step by step" instructions in layman terms they could send me PLEASE -- why does this program not have a user manual you can download and READ
retroinhightech replied on at Permalink Reply
retroinhightech
Many have commented on the fix for issue #2. But I had the same with for your issue #1, and here's how I addressed it:

1. Find /packages/theme_businesstheme/blocks/autonav/templates/Dropdown

2. Edit view.php in that directory.

3. Find the lines that read:

if ($_c->getCollectionAttributeValue('replace_link_with_first_in_nav')) {
    $subPage = $_c->getFirstChild();
    if ($subPage instanceof Page) {
       $pageLink = $nh->getLinkToCollection($subPage);
    }
 }


4. Change the line that begins with "$pageLink = " to read like this:

$pageLink = '#';


This will keep you on the current page if someone clicks the dropdown menu heading rather than clicking a subpage item.
wpatters1229 replied on at Permalink Reply
wpatters1229
This works great...now if you know how to make the pointer turn off so it is not a hand that would be perfect
c5studio replied on at Permalink Reply
c5studio
You will need to add a separate class to those menu items and then use css, here is how I would do it, please note that I haven't tested this, but you should get the idea:

<?php 
   defined('C5_EXECUTE') or die("Access Denied.");
   $aBlocks = $controller->generateNav();
   $c = Page::getCurrentPage();
   $containsPages = false;
   $nh = Loader::helper('navigation');
   //this will create an array of parent cIDs 
   $inspectC=$c;
   $selectedPathCIDs=array( $inspectC->getCollectionID() );
   $parentCIDnotZero=true;   
   while($parentCIDnotZero){
      $cParentID=$inspectC->cParentID;
      if(!intval($cParentID)){
         $parentCIDnotZero=false;
      }else{


And then add the following css to the theme somewhere:

.default-cursor{
    cursor: default;
}
wpatters1229 replied on at Permalink Reply
wpatters1229
So much code to do such a small thing. In a normal javascript menu I have found just adding a style to the call for that menu does the trick but I guess C5 is more complex. Not that big a deal

Thanks
edwardbuck replied on at Permalink Reply
edwardbuck
Hello,

I know that this is several years old, but if you have a minute to respond. I have a dropdown menu and I'm trying to make the top menu item "countries" (under which are several sub-pages- France, Germany, Austria, etc.) not link to a page, but stay on the same page when clicked. I have made the modifications that you mentioned in the view.php, but the Countries item in the nav still loads the Countries page, instead of staying on the current page.

I understand in principle why your solution should work, but for some reason it is not. I have tried clearing the cache on the site and in my browser. Has something changed in the past 3 years to make this fix not function anymore? Do you have any suggestions on what else to try?

Thanks,

Ed

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.