Hello,

I've been a Joomla user for a fiew months and there are alot of templates for sale for a reasonable price. A basic feature of these templates is the ability to have a top tabbed navigation with a secondary navigation in the sidebar. The top navigation would be highlighted indicating that you are within this tab as you select different secondary navigation in the sidebar. I'm not finding this available in any drupal themes.

I'm interested in moving over to drupal, but this featue is critical for the sites that I build. Any advice? Is this even a theme issue in Drupal. Or is it something else?

If it is a theme issue then where would I begin to add this functionality to a drupal theme. The available ones on this site that I have tried for 5x don't have this feature.

Thanks,

Sean

Comments

mpare’s picture

I think that you could use Primary and Seconday Menus. Just set the primary and secondary to the same menu under "http://www..com/admin/build/menu/settings" or "http://www..com/?q=admin/build/menu/settings" if you don't have clean urls enabled. The following text is copied and pasted straight from that menu settings page.

Primary and secondary links provide a navigational menu system which usually (depending on your theme) appears at the top-right of the browser window. The links displayed can be generated either from a custom list created via the menu administration page or from a built-in list of menu items such as the navigation menu links.

...If you select the same menu as primary links then secondary links will display the appropriate second level of your navigation hierarchy.

There are alternative methods to doing this as well. I believe there are a few modules that do this. And I personally have used seperate menus and gave them block visibility settings. I actually wrote a script to do this and posted it under the snippets category in the handbook, Block Visibility And Parent Term CSS Class Function.

Again there are several ways of doing this, you just need to find the one that works best for you and your site. If you have any more questions or need more help please hollar back.

Peace,
-mpare
www.paretech.com

Did you figure out how to do something? Did you find documentation on Drupal.org inadequate? Well now it's your turn. Document your Success!

newdru’s picture

Would you be able to modify that so that instead of visibility being enabled on taxonomy term that applies to node, it's enabled if any of the url path "parts' equals 1 or a number of choices?

What i mean by parts is similar to arg0/arg1/arg2/... and includes everything but the final node in the path. the key here is that the number of args can be variable so you have to test for all 'parts' except the last part.

An example will be more clear:

here are a number of paths (url aliased of course):

/products/big/cars/
/products/animals/fish/
/products/

Lets say i want to be able to search each of these url paths for matches on ANY of the pieces (the subdirectories in the path or arg(#)) EXCEPT THE LAST NODE (the pseudo file) which in my example is always in brackets <>. Make sense?

So lets say i want display the block for paths that match any one of the following:

products/big
cars
products/animals
fish

I imagine that my match list would be an array but maybe it only needs to be a string with a defined separator?

How would you amend your theme function to do this?
If not the whole function, just the code required to extract a match on the url path from an array of possible targets?

Ideally, i'd like to start from the right side and work my way left.. finding the first match in that order if for instance two or more matches are possible:

e.g.
moving right to left in the url path a match on:

fish would take precedence over...
products/animals which would take precedence over...
products

Make sense?

NOTE: i know i can do this by typing in paths in teh block visibility panel itself but I'm trying to do the code dynamically so it can be used elsewhere to display the nearest parent menu...

And even if you don't understand why i want to do it (and you probably don't).. just helping with the immediate question at hand would be great..

thanks for any help you can provide

mpare’s picture

If I understand what your asking the function actually already works that way. See you could use in css without passing anything and it would out put something like class="products big" so you could then target it your css like .products.big {} or just .products {} or just .big{}. And it should work for your block visibility as well because it checks for "in_array" so any term that you pass it will be visible on not just the root. Its been a little while and I don't exactly remember. I would do some tests with it just in your page.tpl.php just printing the results to see if it gives you the desired output.

Again I hope that helps, else hollar back.

Peace,
-mpare
www.paretech.com

Did you figure out how to do something? Did you find documentation on Drupal.org inadequate? Well now it's your turn. Document your Success!

newdru’s picture

your function doesn't do what i asked..

your function is all VOCAB based. It matches on a nodes vocab terms. What i was talking about was PATH BASED.. I want to match the node based upon 'parts' of it's path. Note that a node can be path aliased so it won't always look like node/1 or node/55.. It can look like products/animalis/cats/simese. I want to match on the path.

your fucntion could probably be modified so that whereever your code uses vocab, vocab could be replaced with getting the current URL PATH and then the $match could be converted into AN ARRAY of termS not a single term to match on. Then the code has to be adjusted go through that array of patterns and figure out if each pattern matches ANY PART OF THE PATH.

That's what i'm trying to do...

I'm not really interested in the css ids for what i'm trying to do all though that's a good idea!

thanks for the input

mpare’s picture

I'm sorry I read over that too fast. Ya I't could be modified to do that, but I think in most cases a simple case would work, but depending on your usage building it into a function could be helpful. Shoot me an email if you don't mind and I'll see if I can cook you up something. Sorry I can't do it right this second, kinda busy at work. But do send me an email!

Peace,
-mpare
www.paretech.com

Did you figure out how to do something? Did you find documentation on Drupal.org inadequate? Well now it's your turn. Document your Success!

mpare’s picture

Now that I think about it a preg_match might be the easiest way. So what you could do is store all matches into an array then do whatever you want from there.

Peace,
-mpare
www.paretech.com

Did you figure out how to do something? Did you find documentation on Drupal.org inadequate? Well now it's your turn. Document your Success!

kushi_iiim’s picture

I am having BOth Primary and secondary menu What i wasnt is TABBED menu like menus in TABs
also i want to restrict my secondary menu Onlu for Logged in users how to do this ?
how to do it ?