I am making custom theme in drupal6. I want to assign different css classes to different menu. how can i do this. Please help.
The easiest way would be to use the Menu Attributes module.
From the module's project page:
You should use this module when
You want to "nofollow" certain menu items to sculpt the flow of PageRank through your site
You want to give a menu item an ID so you can easily select it using jQuery
You want to add additional classes or styles to a menu item
The module currently allows you to set the following attributes for each menu item:
Id
Name
Target
Rel
Class Style
Accesskey
Related
I have a menu in joomla that appears on all pages. Some of the items in the menu should be the same on every page, while others need to be dynamically updated based on the page the user is on. I am trying to create an override for the "external url" menu item type (listed under system links), that would allow me to create a menu item parameter the user could populate. Then, I could use this parameter in the menu template to determine what needs to be added to that particular link.
I understand Joomla overrides for the most part, but I can not figure out where the xml file for these system link menu items is located. If my understanding is correct, overrides should be stored in templates > myTemplate > html > com_myComponent or mod_myModule. I would assume if I knew what component the system links fall under, I could create an override for the xml file. Is this correct or way off?
TL;DR: Where is the xml file for menu item type "external url"?
It seems there is no specific xml-files for the system links, as they are defined directly in
administrator/components/com_menus/views/menutypes/view.html.php
which means there is no xml-file to override. You can, however, override the view class MenusViewMenutypes, which is defined in the view.html.php-file. This is done by writing a system plugin loading a file containing the same class. The recipe is simply and beautifully described here.
I am busy trying to customize Joomla's Menu Parameters so that in the administrator area when you create a new menu item, You have an additional option of "1 Column" or "2 Column", And this has to be both accessible by the index file of the template and also Joomla! Update Friendly..
And this is basically just to give the user the freedom of selecting the layout style of a particular page.
What Would be the Best way to go about this?
Any Help Greatly Appreciated.
UPDATE
what i am trying to achieve is similar to when you select a category for a menu item in Joomla!, I want to append it to the url exactly like a category, so you select 1 of 2 columns when creating a menu item and then in the url it should say: &col=1 or &col=2.
Joomla already has a built in parameter for selecting the layout used for a menu item which is the concept of an alternative menu layout. You add the layout to your template html folder with the appropriate xml file. Then that layout will show up in the list of menu options when you select a menu type.
I have two simple solutions without core haking and that are update friendly.
SOLUTION 1 :
Make 2 different templates with the 2 different layouts call them 1 column and 2 columns. When you make your menu link you can choose between them (Template style dropdown).
SOLUTION 2 :
(the one I would recomend)
In your css file make your 2 different layouts based on 2 different css Classes. For example class="1_column" and class="2_columns".
When you make your menu link , under "page display options" you can choose a class for the page it links to. And there you are you can choose between your two layouts.
Hope this helps!
I am running Joomla and using the ChronoForms plug component to create Forms.
I have a problem in that I want to set menu items on a menu in Joomla but want to make use of querystrings so more than one menu item might have the same Form Name but a different querystring. However it isn't possible to use querystrings in menu items with ChronoForms.
One possible solution I am investigating is to do away with querystrings and just check on Form Load which menu item has been selected and then process the form accordingly.
Has someone any ideas how to do this?
I am not sure what you are asking here, but i you wish to have multiple menu items pointed to the same form, you can do this by manually editing the menu item alias. Am I following what you are trying to accomplish?
Look at the menu link created by ChronoForms, when you add it to a menu (without querystring). You can use that as a base for an 'external URL', where you can add whatever you want to it.
I want to edit the top navbar on Magento so that it's main categories are each a different colour, rather than the present bar which is one colour. I know how to do this using html/css but not how to tweak it through Magnento. Has anyone got any pointers please?
1) Add a new Category Attribute. We will use this attribute to store the colour code you want to use for each category. You could store a class name to add into the element, or just a colour code that's upto you :)
http://inchoo.net/ecommerce/magento/how-to-add-new-custom-category-attribute-in-magento/
2) Modify Navigation block to inject the colour/style into the nav when it's rendered.
Mage_Catalog_Block_Navigation::_renderCategoryMenuItemHtml()
what you need to do here will depend on the version of Magento you are using.
I've created a custom coponent for joomla and I've created a menu which uses that component and set a template for that menu. The thing is when I go to the url
test.com/index.php?option=com_mycomponent, it still uses the default template instead of the template that I set it to.
in short: The component works, only it's using the wrong template.
You are missing the Itemid for the menu item in your URL. The Itemid is what Joomla uses to look up the menu item, which is what your secondary template is assigned to. Without the Itemid, Joomla uses the system defaults.
If you have the search engine friendly links turned on, Joomla will look up the corresponding menu item in the database for you. In that case, you would not have to specify the Itemid, but you would have to use the menu item's URL as the base instead of index.php?option=com_mycomponent.
FP is right-on about the Itemid. In addition, you can also append a &template=[templatename] to the URL to force any component in Joomla to use the specified template.
matt