I'm pretty new to Drupal, I've done some maintenance works on some websites, but nothing very complicated.
I'm developing now a website with Drupal 7 and I would like to get some advice about the structure of my content to get what I need.
Here is the structure of my Main-menu:
|About us
| - item_about 1
| - item_about 2
| - item_about 3
|Contact
| - item_contact 1
| - item_contact 2
| - item_contact 3
In my main navigation, I have only the top level items of Main-menu (About us and Contact) without any drop down for sub items.
I would like to have a secondary menu (on the left) on About us page with sub items of About us. And I would like them to open inside About us page as a sub content, not in a new page.
Do you see what I mean? :)
Can I do this only with my Main-menu structure or do I need to change my content structure?
I check the Node Hierarchy module, but I'm not sure to see exactly how I can use it to fit my needs.
On the homepage, I would like to have three blocks with Contact's sub items content (and a Read more button).
How can I "query" like my Main-menu structure to get Contact's sub item linked page content?
Once again, is it possible with my current structure or not?
Please check below the solution to get menu blocks on desired page and set target attributes for the links
Menu Blocks
Menu Attach Blocks
Menu Attributes - allows you to set target attributes for links.
These three modules allowed you to achieve the desired one.
Hope this will help you.
Answer to your prayers is menu block module:
https://www.drupal.org/project/menu_block
With standard drupal installation when ever you make some menu you automatically get menu block for it. But it doens't have too much options.
Manu block allows you to create another block(s) out of your menu, but with more options. One of them is to select just a branch instead of whole menu tree and to select what levels of menu should be displayed in menu block you create.
If you need some more advanced block placing manipulation (what block to place where in what situation) check out on conntext module too:
https://www.drupal.org/project/context
Related
I have a main page (let's call it "GROUP") accessible from a site-wide navigation bar. I've created other sub-pages ("SUB1" through "SUBn") and set their Parent item to "GROUP" in the Edit Basic page panel, but am at a loss as to how I can get each such SUBn to show up on the GROUP page.
I could simply create a <ul> of permalinks to the SUBn's, but that seems a bit inelegant and inflexible. Is there a native Drupal way of doing this?
Add GROUP to a menu (usually Primary Links for a small site), then add SUB1...SUBn as subpages on the menu, so you have an arrangement like:
Home
GROUP
SUB1
...
SUBn
Contact Us
Etc
Then use Menu Block from http://drupal.org/project/menu_block to create a block that shows entries at the first level and have the block show up on the pages where you want the subpage list to appear.
You can also use Bones module to automate the node/menu structure creation.
i have got a menu structure like this:
-menu item level 1
--menu item level 2
---menu item level 3
all items are linking to the same node. now, if i visit the node only the first two items are displayed. what i found out is: when i change the link of the first level menu item to something else, all level get displayed right.
menu modules i use:
Menu block
Menu Settings per Content Type
Menu Trails
Administration menu
Auto Menu Title
Hierarchical Select
any ideas?
thanks
lukas
googletorp is right-- Drupal's core menu system isn't designed to handle this. However you can use a workaround.
Let's say that you'd like to create a nested menu in which one of the children links to the same path as its parent. Something like:
people/friends
people/friends
people/family
people/neighbors
This works in theory-- the menu items will take you to the correct page. But if you're relying on Drupal to correctly set the active trail and expand the correct sub menus, you'll have to use a bit of a workaround. You're basically going to create dummy nodes that will redirect to the desired page rather than creating two menu links that have the exact same path. The parent (in menu) will redirect to the child's node.
Method 1 (D6 only):
Download and install CCK Redirection
Create a Content Type 'Redirect Node' and add a CCK Redirection field to the content type
Create a page node (node 1) with URL "people/friends" and add a menu link
Create a 'Redirect Node' (node 2) and create a menu link for this new node.
Set CCK Redirection field to the URL node 1 (people/friends).
Set node 2's menu item to be the parent of node 1's
Method 2 (D6&7):
If you want to get really fancy, you can take a more user friendly approach by combining CCK's Node Reference module with the Rules module.
Download and install the Rules module (and Rules UI) and enable CCK's Node Reference module
Create a Content Type 'Redirect Node' and add a Node Reference (D6) (D7) field 'field_redirect_target'. Be sure to configure this so that it is required, and users cannot select nodes of type 'Redirect Node'
Add a new rule via the Rules module when content is going to be viewed if content is of type 'Redirect Node'
Redirect to page: [node:field_redirect_target-path]
Create node 1 of type page
Create node 2 of type 'Redirect Node'
Set Node Reference field to Node 1
Set node 2's menu item to be the parent of node 1's
This method is a bit nicer for users, since it doesn't require them to find the system path for the target node.
Depending on your setting, the menu module will show the active link it it's children. It is, however, not designed to search for more than a single link. This is why you wont get the full nested menu structure. My guess is, that the top one is the link it finds first, and that is where it stops. I can't remember the algorithm for the menu structure, you might have luck rearranging the menu structure, making menu 1 the last child. This is, however, not something the Drupal menu system is designed for, and you will not have an easy time changing this.
What are you trying to accomplish by linking the same node several times is a nested menu structure?
I solved my problem using menu first child. I didn't look at the code it uses, but it simply works. It's really a bummer that this doesn't work out of the box and you have to use such workarounds. But actually this increased usability for my case.
I've just started using Drupal and I must admit its brilliant. Im still finding my way around it, so this might be a stupdi question, but Id like to know what the best and least perofrmance impacting way to achieve the below.
I have created a view with the "Node: Nid" argument to bascially list certain information about additioanl information about an artist, his events, albums etc..... The path has been set using the %. The idea being that when a particular artist node is in the node URL it will display all of the other info.
What I would like to do is add a link to the artist page called more info. So when clicked it takes you to that particular view and display all the other information.
I have realised that you cannot create menu items, using % argument.
How you would you guys do this ?
thanks :)
Charles
You are correct that you can't use wildcards in menus.
However, you can create a fake menu block outside the normal Drupal menu system that contains the menu items you want: just create a view and use the HTML list style. Each row in the view will correspond to one of your fake menu's items. When you're finished creating the view, create a block display for that view.
Add the block to a region using Site Building -> Blocks, and style it to look like your other menus.
I am building a website www.etutornetwork.com, in top menu I have included a link to a new content type [services]. I want to add a link in dropdown menu as soon as I publish new content in services.
Please Help, Thanks in advance.
and one more question, I dont want to give any name to one of the menu in the site. I tried using or leaving it blank, but it does'nt like this.
You can attach it in node creation time (see Menu fieldset), or use module like Auto Menu. Some more details about this module (from its project page):
The Auto Menu module automatically generates menu entries on node creation/edition. Parent menu item can be specified on a per content type basis.
This module acts when the menu section of a node is left empty only. So, users can still organize menus manually. Moreover, default setting for content types is to not create menu items automatically.
I use Taxonomy Menu, to create my secondary menu. It is very flexible to use. Some more details about this module (from its project page):
Features
Custom Menu per vocabulary
Uses the default taxonomy term path or custom paths
Integrate with Views
Integrate with Pathauto: use URL/path aliases
Does not interfere with other menu modules
You can take away the permission from users dealing with menus. Then when you are publishing submitted content from them, you can assign them a menu entry and control the title.
Other than that, you could use Views (since Services is a content type) to create a block that lists all Services with links directly to the node.
Either way, someone will have to title the nodes/menu items. It's easier administrative wise to remove menu permissions from users submitting content.
I'm developing a site that requires some duplication of links within the menu:
Section A
-- Introduction
-- Testimonials
Section B
-- Introduction
-- Testimonials
Testimonials
-- Section A
-- Section B
So 'Section A > Testimonials' and 'Testimonials > Section A' point to the same node. But regardless of which menu link people use, I want the person to be in Section A.
The problem is that D6 doesn't like duplicate menu items, and it assigns the active and active-trail classes rather unpredictably.
So my thought was to create a placeholder node for each item in the Testimonials menu, and then set the URL to something like "testimonials/redirect/section-a", and then use mod_rewrite to redirect over to "section-a/testimonials".
With this solution, I will have no duplicate paths in the menu. I'm just hoping this doesn't somehow hurt my SEO.
Does anyone know a better solution?
I also have this problem. When multiple menu items link to the same content, Drupal will use the item with the lowest menu id as canonical - no matter which menu link you click, you'll get the active trail for the lowest menu id.
The best way I know to fix it, which I don't like, is to point your non-canonical menu items to a node that will redirect to the node you want (you could use the php input filter with a drupal_goto, or something similar)
Unfortunately, the path_redirect module will not solve this problem as the redirect paths it creates cannot be used as menu items.
I'm not sure why there aren't more people with this use case in d6 - it's pretty common in my experience to want top level menu items to point to the first child, and to want to set active trail to the first child.
nodesymlinks module solves the reverse use case - it allows you to set up multiple menu items, each with its own path, pointing to the same node. so, depending on which link you click in the menu, you get a different active trail. this module would be a good model for a "canonical menu item" module.
We had the same problem in our project and we managed to have the active trail working correctly setting in each duplicated menu item a "#n" at the end. For example:
Section A
-- Introduction -> node/1#1
-- Testimonials
Section B
-- Introduction -> node/1#2
-- Testimonials
Testimonials
-- Introduction -> node/1#n
-- Section B
is not the prettiest solution but definitely the faster one :) The only inconvenient we found is that if a user click first in "Section A -- Introduction" and right after in "Section B -- Introduction" the page will not be reloaded.
Hope this help
Multiple Node Menu might do the trick:
This module modifies the "Menu settings" in standard node editing form
to allow managing multiple menu links to a node. The Drupal standard
behavior is to only care about a single menu link for anode, all other
menu links must be added through menu administration.