I've been playing with the category module and it's associated category menu module lately.

I like the fact that it can automatically take nodes tagged under a section category and make a menu such as this:

[container] (hidden on menus)
Section1 (cat)
- node
- node
- node
Section2 (cat)
- node
- node
- node
etc...

Now....

1) When i click on a node, i get a full node listing. Great!

2) When i click on a section (cat), the section (cat) node body itself is printed out PLUS ALL NODES TAGGED WITH THAT SECTION CATEGORY.. Not so great (for me in this instance).

What i really want is ONLY THE SECTION BODY to be displayed when you click on a section category. That way it functions purely as static page with NO dynamic content displayed (the nodes tagged underneath it).

Anybody know how i can do this?

thanks

I'm basically using these two modules to create simple navs for site sections (if that makes sense).

Comments

venkat-rk’s picture

Option 1:
Try setting the weight of the hidden container to 0 instead of -1. And, in category_display settings, turn off the 'show node listings'. But this might take the nodes off the menu and fail to display the category too. Not sure.

Option 2:
Insert a hidden container as the parent for each of your categories (Section 1 (cat)). Set the weight of each of those hidden containers to 0 and turn off 'show node listings'. Again, I am not sure if this will take the nodes off the menu or even fail to display the body portion of the categories.

If both these options fail, a slight tweak to the code might do the trick, but I have no idea where to start.

Previously user Ramdak. Feeling comfortable enough to use my real name after two years with drupal;-)

newdru’s picture

thanks for the post.. i'm not sure i follow the logic but i'll give it a shot a little later..

I have another question though:

My section (cat) is automatically being placed in a menu block. The menu block header automatically gets its default name from the title of the block, which ironically happens to be the same name as the section (cat)! The net effect is that my blocks have two "headers" named the same thing:

1) the block header is called 'section1' but isn't a link
2) the first item in the

    in the block is my section (cat) 'section1' as a link.

    Possible solutions (i'd prefer #1 if possible)

    1) Anyway to HIDE the category 'section1' [i know containers can be hidden but can categories]?

    2) Disable the block title

    thanks in advance

venkat-rk’s picture

I am not sure if I understand the problem, but it sounds like you defined a custom menu for your category hierarchy. Try going to ../admin/menu, locating your custom menu, and editing it to change the name of the menu. This way, your menu block's header will be different from the category (Section 1) that is placed there automatically.

----
Previously user Ramdak. Feeling comfortable enough to use my real name after two years with drupal;-)

newdru’s picture

No I don't want to change the block header to something else.. i want to get rid of one or the other..

let's say my section1 cat is actually named "About Us"

the menu block is also named "About Us" (it's actually functionnig as a submenu block for a section)

There's no need for anything else to be in that header except "About Us".. therefore it will look stupid to change it to anything else.. I just want to supress either the block header or the section cat..

understand?

venkat-rk’s picture

Thanks, got it. The following search gives some interesting answers:
http://drupal.org/search/node/hiding+block+titles

It seems the easiest way is to locate the block id and set its display to none in the css.
----
Previously user Ramdak.

newdru’s picture

after prowling a few of the links, it kind of gives me some options but not what i want exactly.

1) display:none isn't really a solution (more of a hack that can break)
2) i really want to convert the main section LI into an H2 LINK for the block but still have it function as if it's a part of the menu list heirarchy. i don't think this can really be done. I probably will have to use a workaround by styling the section item LI differently from the rest of the child LIs

thanks

newdru’s picture

When i click on a section LINK IN THE MENU, the menu tree remains displayed. Great.

However, when i click on a node LINK IN THE MENU, the node page is displayed BUT THE MENU BLOCK DISAPPEARS!!! Is there any way to keep the menu block visible when you click to display a node in the category????

Below is the following menu tree from the original post for reference:

[container] (hidden on menus)
Section1 (cat)
- node
- node
- node
Section2 (cat)
- node
- node
- node
etc...

Now....

venkat-rk’s picture

However, when i click on a node LINK IN THE MENU, the node page is displayed BUT THE MENU BLOCK DISAPPEARS!!!

Are your nodes in the menu aliased? If so, you can go to ..admin/block, find the relevant menu block and in its visibility settings, put category-name*, save the changes and save the block again. This should keep the menu block visible on node view.

If your nodes are not aliased, then this behaviour is strange because to get the nodes in the menu, you would have already checked in your hidden container's category_menu settings, the radio button under 'Menu items for assigned nodes' that says 'Enabled'. I seem to recall that when cat_pathauto was broken for a while many months ago, this was the only way to get the menu block to display on the node view.

----
Previously user Ramdak.

newdru’s picture

First let's look at your second scenario in the prior post.

My assigned nodes are NOT aliased which means their links in the subnav still reference paths like node/1, node/2 etc.... I think i figured out why the submenu block disappears when i click on an assigned node. It's because i only wanted the submenu block to show on certain sections. So i typed in about* in the menu block in admin/blocks to restrict the visibility.

This means the UNALIASED node paths never match the section menu block visibility rules.

If i can rephrase what i've learned from this (and correct me if i'm wrong), it's that YOU CAN'T MIX BOTH RESTRICTING BLOCK VISIBILITY WITH UNALIASED NODES.

This brings me back to your first suggestion. Lets say i've got this:

About (Section cat) [Subnav for the the About Us site section]
- History (assigned node)
- Location (assigned node)

In order for my About Submenu to only show on child pages and the section itself i would:

1) have to restrict block visibility to about* in admin/blocks

AND

2) enter url aliases on all assigned child nodes like "about/history" and "about/location"

Is this correct?

That seems like extra work to have to type the "about/" in addition to every alias for every node.

Since the cat_menu module automatically creates a menu item for every assigned node in the "right" place when i assign it to a category, it already knows teh relationship to the parent 'about'. Why should i have to type that in again?

I guess what i'm saying is, if the category and cat-menu modules are smart enough to create a structural heirarchy for each menu item (i can see that it does.. it creates a menu and breadcrumbs), why do i have to explicitly type in the same exact path as an url alias (not sure you follow that but it's pretty clear to me now).

I think the thing is most people use the category and cat-menu module primarily to create one nav menu that is visibile all the time. which means you don't have to worry paths and block visibility. the minute you want to use cat-menu to show sub-navs that only display on a given section, you are forced to type in url aliases. i don't know if their is any way around that but i wish there was.

any thoughts?

thanks

venkat-rk’s picture

the minute you want to use cat-menu to show sub-navs that only display on a given section, you are forced to type in url aliases.

No. I messed around with my broken site to test this for you. You can see on my site that the menu block shows fine even when nodes are unaliased.

Both section 1 (category) and test page (created with page module) are unaliased nodes. I created a hidden container called 'test', then created a menu at ../admin/menu, edited 'Section1' and made the new menu its parent.

That was it. I didn't even have to touch the block visibility settings. Sorry if I misled you on that. The container's cat_menu settings are 'menu items within this container' set to enabled and 'menu items for assigned nodes' also set to enabled. The container (test) alone is aliased as I didn't bother to change the pathauto setting for that, but I doubt if that's the reason it works on my site.

Try again. It might work for you too. This is why category is such a brilliant module. You can't do anything like this (menu blocks visible on node views of unaliased nodes) with the core taxonomy module.

----
Previously user Ramdak.

newdru’s picture

isn't replicating what i want...

Your blah blah blah menu BLOCK ALWAYS SHOWS ALL THE TIME ON EVERY PAGE OF YOUR SITE. So NOT aliasing will work as far as keeping the menu block visible for assigned nodes because it's always visible all the time. That's the rule i tried to explain above.

Lets assume you have primary links nav at the top of your test site with your primary nav set to:

Home | Blah Blah Blah

What i want is blah blah blah menu BLOCK only to show when you click Blah Blah Blah. When you click Home, i want blah blah blah menu BLOCK to disappear. Basically it's functioning as a separate SUBmenu for a given section.

As far as i can tell, the only way to make the blah blah blah menu BLOCK APPEAR IN CONTEXT is via admin/block visibility settings. Once you set that, you have to differentiate the block in some way - which to the best of my knowledge in this case you can only use a path - e.g. section*, etc.

Do you understand what i'm trying to do? See if you can replicate that on your test site and get back to me. I would be ecstatic if you can make that work without paths.

As you stated and as both you and i have proved, category DOES automatically keep a menu TREE open BUT ONLY WHEN THE BLOCK IS VISIBLE 100% OF THE TIME.

In otherwords, i'm trying to use the cat module to create *SEPARATE* SUBMENU BLOCKS that ONLY APPEAR ON ENTERING CERTAIN SECTIONS OF THE SITE. As far as i can tell, the default behavior of category module was designed to work best on menu blocks that are ALWAYS VISIBLE 100% OF THE TIME. The minute you want to break up your menus into subsections that are only visibile under certain subsections of a site, your only option is to set the block visibility by path, which then forces you to set path aliases on all content you create under that category module heirarchy tree.

Hope you follow that. Again try to replicate the scenario with a top nav and see if you can do it.

thanks

venkat-rk’s picture

In otherwords, i'm trying to use the cat module to create *SEPARATE* SUBMENU BLOCKS that ONLY APPEAR ON ENTERING CERTAIN SECTIONS OF THE SITE.

You are quite right. Without paths, an unaliased menu block will show on all the pages of the site. However, this is not specific to the category module- blocks in drupal work based on paths, not node ids, as far as I understand. I have no idea how you would achieve sub-section menu blocks the way you want without aliasing.

----
Previously user Ramdak.

newdru’s picture

Is there anyway to:

1) make the current category or assigned node title show up in the breadcrumb?

e.g. when i click on about: history in the sub menu the breadcrumb only shows Home > about instead of Home > About > History

i guess for me i think counter to the way breadcrumbs are implemented in drupal. for me, it makes more sense to include the currently displayed node in the breadcrumb versus leave it off.

2) is there any way to get rid of Home in the breadcrumb?

That looks kind of stupid to me and serves no real purpose, especially when you have a home nav link thats common on every page that has ever existed on the web. What is more important for me is that when i'm on a subsection, the subsection itself becomes the pseudo home for the section)

btw.. thanks for all the info you've shared