Deactivate parent pages while keeping subpages active?

Permalink
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!

Rob

1 Attachment

robertsoniv
 
webpresso replied on at Permalink Best Answer Reply
webpresso
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>';

to
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
Tino
mhawke replied on at Permalink Reply
mhawke
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.
plschneide replied on at Permalink Reply
plschneide
I'm trying to do this same thing. (v8+)
I've added the attribute
* 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.

-- activated it on the page, but while it doesn't open that page now it just doesn't do anything. You click on the page and it doesn't actually change to the first page in the nav.

Suggestions???
ConcreteOwl replied on at Permalink Reply 2 Attachments
ConcreteOwl
I just tried this in version 8.4.2 and it worked perfectly for me?
See the attached images..
plschneide replied on at Permalink Reply
plschneide
Yeah that pretty much matches up what I have
https://www.useloom.com/share/819579d30d55465197aa68f2987c0d4d...

I am thinking it might be related to my theme somehow.
plschneide replied on at Permalink Reply
plschneide
Yup it is the theme that is the problem