Deactivate parent pages while keeping subpages active?

Hello everyone,

Here's what I'm trying to do. I've got a parent page A and I want it to show up in the Auto Nav with all of it's sub pages A-1, A-2, and A-3. However, A doesn't actually have any content, it's just a way to group together the subpages under a title in the Auto Nav dropdown. Is there a way to make certain 1st level page links 'dead' so visitors can only select pages from the drop down?

I've attached a screenshot for clarity. The circled page link is the one I would like deactivated, but still kept visible.

I could probably break the links with jQuery, but if there's a better way to do it I would appreciate any help!


1 Attachment

View Replies: View Best Answer
webpresso replied on at Permalink Best Answer Reply
Hi Rob

You can make your own autonav dropdown-template. Change for the first level the code of the link. In your block/autnav/templates/YOUROWNDROPDOWN/view.php from
echo '<a href="' . $ni->url . '" target="' . $ni->target . '" class="' . $ni->classes . '">' . $ni->name . '</a>';

if($ni->level == '1'){
// Here can you put your Code for the 1st level 
echo '<span class="' . $ni->classes . '">' . $ni->name . '</span>'; 
} else {
// Original Code for the other levels
echo '<a href="' . $ni->url . '" target="' . $ni->target . '" class="' . $ni->classes . '">' . $ni->name . '</a>'; 

Good Luke
mhawke replied on at Permalink Reply
Have a look at line 42 of [root]/concrete/blocks/autonav/view.php.
* 3) Handle: replace_link_with_first_in_nav
 *    Type: Checkbox
 *    Functionality: If a page has this checked, clicking on it in the nav menu will go to its first child (sub-page) instead.

They are suggesting you add a page attribute to your system called "replace_link_with_first_in_nav" and set that attribute on the top-level page(s) you want to 'kill'. When the autonav sees this attribute, it sets the URL for that item to be the first item in the drop-down. This prevents a UI issue where users expect to be able to click on the top-level menu items.