Not sure how to word this properly. In a drop down menu the top level link is to a page. The forums talk about hiding the parent but this request is the opposite.
I want the parent to show but not link to a page. If someone clicks on that link it should do nothing. They have to select one of the children links to see a page. It appears that navigation menu items only reflect pages. But it doesn't make sense to click on an empty page. The top level links like the about page may point to a specific page but list items with children should disabled at the top level and only the children link to pages.
If you want to make the top-level links non-clickable, you'd need to create a custom template, which would require some decent php coding to figure out.
But an alternate solution that many people use is making it so clicking on one of those top-level links goes to the first sub-page -- this can be done fairly easily with the "replace_link_with_first_in_nav" page attribute. First you need to create this attribute by going to Dashboard -> Pages and Themes -> Attributes, choosing "checkbox" from the dropdown menu and clicking the "Add" button. For the handle, paste in this:
And for the name enter "Replace Link With First In Nav". Don't worry about the other settings. Click the "Save" button.
Now, go to those top-level pages and set this attribute for each one by editing the page, clicking "Properties" in the toolbar, clicking the "Custom Attributes" tab, choosing "Replace Link With First In Nav" from the "**Add Attribute" dropdown, checking the box, and saving.
Fantastic, first-link was my second thought. Currently, focusing on the auto-nav feature, the forums have been a great help.
I have thought about compiling some of the questions and answers in a single document. Would that be considered plagiarism? It seems like auto-nav is one of the most questioned features. There are a lot of questions about specific tweaks so maybe bringing some of them together would help others. My skill level is still a bit lite but maybe I could put it together and get some more experienced people, such as yourself, to review and critique. Of course, that is if aggregating forum answers is not plagiarism or considered unethical. It would be a bit clumsy if credits had to be applied to each answer so maybe a generic credit to all forum responders would be good enough?
I wouldn't consider it plagiarism as long as you credit the authors and/or make it obvious that each answer is by someone else. (And aren't charing money for it). Linking to the original forum posts for each answer would be a good idea -- it would make it clear who the author is and also would allow people to see the full post for more context if they wanted.
I'd be happy to look over anything like that you want to put together. And I think it's great that you want to collect these and try to help others. The biggest challenge with these things, though, is how do people find it? There are already quite a number of small little half-completed documentation projects floating around, and without some central organization it's likely it will just get lost in the shuffle. Perhaps you could write it up more as a how-to and submit it to the Concrete5 documentation itself -- at least then it's in a central place and can be searched?
This is a good idea.
The way that custom template overrides work in Concrete5 is that you can either completely override the default template, or you can make a separate custom template that is chosen from the 'Custom Template' dropdown menu. By simply naming this file "view.php" and putting it in SITEROOT/blocks/autonav, you are overriding the default template -- which means C5 is using that new file instead of the built-in one automatically, without you having to choose it from the list.
It is good that you didn't see anything change when you put this file on your server -- that means it's working! It is intended to provide cleaner HTML, CSS, and PHP code for designers/developers to work with.
But in your case, you just want this ability to denote that a page should not be "clickable" in the menu, and if you look at the comments at the very top of that file, you'll see some explanation of different attributes you can use. The 4th one is new (I just added it, based on your feedback). To make it work, add a new attribute to your system via the "Page Attributes" dashboard page (in 5.4, go to Dashboard -> Pages and Themes -> Attributes, or in 5.5 type "page attributes" into the intelligent search box). Once there, look down at the bottom where it says "Add Attribute", and choose "checkbox" from the list (or it might be called "Boolean" in 5.5), then click the add button. Now for the handle, enter "disable_link_in_nav", and for the name enter "Disable Link In Nav". Leave everything else as-is, then click the "Add" button.
Now you should have the "Disable Link In Nav" attribute available in the Custom Attributes section when you edit a page's properties. Note that it will turn your links into html "spans", which means the styling might get messed up -- you'll need to address this in your theme css if it's a problem.
Hmm... not sure what the problem could be. I just updated the free "Autonav Exclude Subpages" addon in the marketplace to utilize this new template, so you might want to try installing that and see if that works (note that for that to work, you need to click on the autonav block and choose "Custom Templates", then pick "Exclude Subpages" from the list): http://www.concrete5.org/marketplace/addons/autonav-exclude-subpage...
However, in my previous attempts I created another custom template, using Sooperfish - I was googling how to disable the parent link and that came up. I followed those instructions, and made a custom template.
Somehow I used it, and snazzied-upped my autonav, but the custom attribute of the link-disabling effect from earlier did not work.
When I installed, then changed to the 'Exclude Subpages' template, the sooperfish one went away of course, and all the drop downs are now gone as well.
How do I have it all snazzy looking, maybe I missed that somewhere, and with the parent menu disabling effect of your addon (thank you again for making by the way)?
Unfortunately I don't have an easy answer for you. If the dropdowns stopped working, it might be because the CSS styles of the dropdown menu that you're using is not designed to deal with disabled links. In the template I made, disabled links are outputted as <span> tags instead of <a> tags, and it is not a common thing to even have disabled links in nav menus so I am guessing your CSS is not styling the <span> tags as needed. You will either need to modify your dropdown CSS to make it work with the spans, or you could change the template so it outputs <a> tags that go nowhere instead of spans (by setting the "href" of those disabled <a> tags to "#" instead of the URL).
Creating dropdown menus is always a challenge I've found -- requires a lot of experimentation.
The updated c5 system directory should not have any effect on this, because you're overriding the built-in template, not replacing the file itself. Although... just to be sure, you're working in the SITEROOT/blocks/autonav/ directory, correct?