How to make parent menu active when the child menu was active in menu block using drupal 7? - menu

I have created menu and its child links like
About
contact us
portfolio
our location
I have used menu block to display sub menu only when about in click and display sub menus in another layer.
Now my requirement is when i click on any sub menu in parent menu then the parent menu should be active. To achieve this task i searched a lot off and found menu position module for this purpose. I have configured and specify page path in Restricted to certain pages, but now it is now working. What i have mistake or any other solution for this problem. Please let me know the right solution.
<?php
$block = module_invoke('menu_block', 'block_view', '1');
print render($block['content']);
?>
I am adding this code below the topbar menu. but inside the menubar wrapper.

If my understanding clear then you will need this menu - Menu Position https://www.drupal.org/project/menu_position
This module allows for the creation of rules that will dynamically add the current page into the menu system at the requested spots.
If you dont want to use this module then you will need to append menu-id in the menu link's li and then through jquery / js will need to add certain classes to parent menu items.

Actually there is no requirement to use any module for this situation. What i have done to achieve it. I just modified template.php of zurb foundation theme. i have copied the code(foreach loop code) from here and added to the template.php file as mentioned in the page and added the css like below:
#main-menu li.active-trail a,
#main-menu li a.active, #main-menu li a:hover {
background:#fec325;
/* IE6-9 */
}
and that's it. i have achieve what i want. I hope anybody who is looking same kind of problem can find this solution useful for this kind of requirement.

Related

Drupal 8 Twig Template - Show menu if node has a menu item

I am creating custom twig templates for a Drupal 8 theme. I want to render a menu in a region only if the node has a menu link (i.e. when editing the node the menu settings on the right has been configured so the “provide a menu link” box has been checked).
Ideally I would like to create this in the twig template so I can change the layout accordingly, but any pointers greatly appreciated!
Usually this issue is handled differently(by creating a separate content type and set visibility) but for the sake of the question I'll give some solutions.
Solution 1: Block Visibility Groups.
If that is not enough.
Solution 2: hook_block_view_alter(or any other hook_ENTITY_TYPE_view_alter) where you can deactivate the access to menu block after you check if condition is met with Drupal::routeMatch() to check what node is displayed.

TestComplete Menu Item

I am new to TestComplete. I have a question and it may be something impossible or too simple. I have a toolbar containg File, Edit, View, etc. I want to get one item (eg. Edit) to mapped objects. I can get the whole toolbar only. I want to simulate a click event on Edit. How can I do this?
As a rule, TestComplete does not work with menu items as with separate objects. It works with a menu object or even only with a menu's parent object and you can specify which item to select by passing the caption of this item to the corresponding method of a menu object. For example:
objMenu.Click("Edit|Paste");
// or
parent.MainMenu("Edit|Paste");
Please find more details on how TestComplete interacts with menus in the Working With Menus help topic.

How can I disable manually the remove button from the rich:pickList?

I'm working with the rich:pickList and it's working fine. I just need to find a way to disable the remove button at the moment I select an item located in the target list.
I suppose it could be done with JavaScript or JQuery but I have no experience with that.
The most I've done is to get the text of the selected item of the target list, but I would like to obtain the entire object represented by that item. Besides, I have looked for the button in the DOM tree but the button has no id, so I can't figure out how to find the button in order to can give it the right style class to disable it, and how to do this!
Try setting the attribute of rich:pickList removeVisible. This will display/undisplayed the remove button in the component.
Hope this helps.
-cheers

SharePoint 2007 - add additional menu to Global Navigation in a Master Page

In the source code for a master page, there is a section that has the following ASP.NET item: . This contains the "Welcome (User Name)" and Site Actions menus.
How do I create an additional menu that is similar to the look and feel of the Welcome menu? I've tried to create Front End HTML that behaves similar to the out of the box SharePoint menus, but it isn't quite right. I would prefer to utilize an ASP.NET or SharePoint control that acts similar to the SharePoint menu if that is possible.
For example, is <SharePoint:AspMenu> the appropriate control to use?
Thanks,
Robert
i am sure you will get better answer than this but just wanted to point what i have done to do this
i have added javascript library (JQuery) (for some other reason ) and when time come to do this thing i just added a JQuery code that creates another item in the navigation list with appropriate style and css class with the needed link and caption.
You could try another instance of the PersonalActions control with a custom GroupId. But when the control is rendered, it might also say "Welcome, [User]" just like the original.

Joomla nested ul menu

everyone! What I'm trying to do is to get Joomla! to desplay the menu items in a nested ul menu, like this:
Item
Subitem
Item2
Subitem2
Sub Subitem
currently I'm using a custom HTML for this, I've written a custom jquery script for this accordion and I'd like to use it with the Joomla's menu system. I've also downloaded Extended Menu module. Please let me know of any ideas.
P.S forgot to say that I don't want to create a dropdown menu that works on hover. My menu should slide down on .click()
You are in luck. The standard Joomla mod_mainmenu module builds menus exactly like that. You can basically take the entire module, add some IDs and classes to suit your accordion code and add in the JS to have a fully functioning menu with minimal effort. Just to be sure, I moved some menu items around on one of my demo sites. Take a look at the Resources menu here - http://www.internextion.com/
That is a basic Joomla menu module with the items nested as you illustrated.

Resources