Include in Date Nav but not Auto-Nav

Permalink 1 user found helpful
Hi,

Apologies if someone has already answered this question here. If they have could someone point me towards the answer.

What's the best way, if possible with the standard blog tool (the one which comes as part of the release), to get blog posts to display in the Date Nav block but not in AutoNav, as I don't want the user to mouse over "Blog" in AutoNav and their screen to be flooded with menu links to all blog posts.

Many Thanks.

 
codingpenguins replied on at Permalink Reply
Well you can use the date nav, this is in the marketplace as an addon. its part of the core ones. Heres a video link to use it by Frz,http://vimeo.com/5740825. Let me know if you need more info.
skisy replied on at Permalink Reply
Thanks.

Though unless I'm missing something that would not have actually solved the problem I had. I was selecting most of my blog posts (i.e. instances of the blog page type) to be excluded from nav, so they were not displayed in my main navigation (which is an auto nav). But doing this meant that they were also excluded from other navigations such as the date nav. Fortunately I solved the issue anyway by editing the controller.php for the date nav to not include that argument.

Problem solved.

(If anyone else has this issue I'd be happy to explain exactly what I changed, if you're not too sure about PHP, the only reason I haven't already explained is because without having the file open in front of me I can't remember the exact code)
codingpenguins replied on at Permalink Reply
Thanks funny, but that would work. But I do not have concrete at my house, but I thought you could select different attributes to exclude. Like the ones from main nav, is different from the page nav. Also you could edit the block to only show sub-pages below blog. Also your blog pages should be below blog (not at the same level) - not sure how familiar you are with concrete, but you could view this on the sitemap single page. The main nav should only display the pages at the top level. Let me know if this makes sense. The only reason I am saying all this because what if you want to you that check later on.
skisy replied on at Permalink Reply
Hmmm. Well they were definitely child pages and were definitely still being displayed in autonav before I checked the "Exclude from Nav" attribute. Perhaps an alteration of the block's code in the theme I am using.

Under the custom attributes, Excluding from just the autonav block is not an option. Exclude from Page List, Search Index, sitemap or 'nav' are the available options. I don't know if you can add attributes to the list of the drop down menu which you can then apply to your page or not in concrete though. To me it seems you have to select from the ones in the list.

Hopefully I won't need to change it at any point, but I guess if I do, I'll just write a new argument into the code, more fun that way, anyway. =)

Thanks again though.
jordanlev replied on at Permalink Reply
jordanlev
I'm not sure if this will help your exact situation here, but you might want to try this:
http://www.concrete5.org/marketplace/addons/autonav-exclude-subpage...
bw1 replied on at Permalink Reply
Sorry for the late reply out of nowhere on this, but what?

"The main nav should only display the pages at the top level." -codingpenguins

I'm not exactly sure what you meant here, but the main nav is almost *always* used to display the main and at least the second - if not more - levels of pages...
jordanlev replied on at Permalink Reply
jordanlev
Are you having the same problem and trying to solve it, or just wanting to jump into the discussion (from last year)?

If you are actually having this problem, note that it can be solved easily now by using the free "Autonav Exclude Subpages" addon (http://www.concrete5.org/marketplace/addons/autonav-exclude-subpage... ), which among other things introduces a new attribute called "Exclude Subpages from Nav" -- you could check this on the top-level blog page to have all of the blog's child pages be excluded (without having to check the "exclude page" box on each and every one of them). Since this addon is a custom template for the autonav block only (not the date nav block), it won't have any effect on how the date nav block works so you can isolate the "exclude"-ness between these two blocks.
bw1 replied on at Permalink Reply
I was currently looking into that plugin. My brief look so far seemed like I'd have to go to each of the blog post pages individually? I've got around 100 posts in this blog, so if that's the case it's not out of the question, but it's not something I'd look forward to.

Trying to get the date navigation block for the main blog page to work, but have [exclude from navigation] on all posts so far.
codingpenguins replied on at Permalink Reply
Wow thanks for bring back a year old thread. But I was giving an example and most website I make the main header nav only displays the pages below the "home" (main) page. You can make it do whatever you like but it was just purely used as an example. : )
bw1 replied on at Permalink Reply
No, no -- and I'm not so much criticizing you as pointing out to anyone else running across this thread, especially if they're new at concrete, that that's the norm because I believe most people do use drop-downs and list multiple levels of pages from the main navigation. Obviously there can be circumstances where that's not the case; I just didn't want to lead any new-comers the wrong way.

It may be an old thread, but I'm trying to figure something out and ran across it, so I imagine others do too.

Sorry! :)
teeps1981 replied on at Permalink Reply
Hey. I have this issue. Could you tell me your secret :D
jordanlev replied on at Permalink Reply
jordanlev
I think the easiest way would be to use the Autonav Exclude Subpages addon:
http://www.concrete5.org/marketplace/addons/autonav-exclude-subpage...

...apply that custom template to your top-level nav, and set the top-level blog page to "Exclude Subpages". Then it will not show the sub-blog-pages in your main nav, but they will still show up in the date nav.
teeps1981 replied on at Permalink Reply
tried that, messed with my nav up cause i was using a custom template for a drop down menu. Its okay though. Fixed it by simply changing

$pl->filterByAttribute('exclude_nav',false);


in the controller.php of the date-nav block to:

$pl->filterByAttribute('exclude_nav',true);


Yeah..i may run into issues should i want to exclude some pages in date nav as well as other nav but ill cross that bridge when i ever come to it.

Cheers
mehreenbaakza replied on at Permalink Reply
mehreenbaakza
I know this thread is from last year, but in case someone stumbles upon it...if you're trying to hide child pages without hiding the parent page, Jordan's "autonav_exclude_subpages" addon isn't compatible with version 5.6 and higher because the feature is built-in to the core now but it's not blatantly obvious how to enable it. Here's how to hide child pages:

1. In the Dashboard, go to "View Full Dashboard"
2. Pages & Themes > Attributes
3. Scroll all the way down to "Add Attribute"
4. From the dropdown, select checkbox and click "Add"
5. In Handle, enter
exclude_subpages_from_nav

6. In Name, enter
Exclude Subpages from Nav

7 Click "Add"
8. Now go to "Page Properties" of the parent page
9. Click the "Custom Attributes" tab
10. In the left column, find the new attribute "Exclude Subpages from Nav" that you just added and click on it so it gets crossed out
11. Now scroll back up and check the "Exclude Subpages from Nav" box under the "Selected Attributes" section
12. Click "Save"
13. Now check your autonav, the parent page should appear, but child pages should be hidden.

If you find that this method is not working, make sure that you're using a recent version of view.php in your custom autonav template, because that's where the autonav checks for hidden subpages.
1. You can either grab a copy at concrete/blocks/autonav/view.php
2. Or you can grab the code Jordan's clean blocks template from https://github.com/jordanlev/c5_clean_block_templates/blob/master/au...
3. Put the template wherever your custom autonav template is, for example SITEROOT/blocks/autonav/templates/dropdown_menu/view.php

Hope this helped somebody!
anete replied on at Permalink Reply
anete
Thank you, that was really helpful...just what I needed!