This project is read-only.

Orchard menu widget problem

Topics: Customizing Orchard, General
May 23, 2013 at 12:32 PM
Hi there,

I have created a menu on one of my pages which I am using for filtering different types of properties.

For example:-

FILTER PROPERTIES: Industrial | Retail For Sale | To Let

I have done this by creating projections and the functionality works great although I can't get it to look right. I have created a menu widget for this. I want to add the text 'FILTER PROPERTIES' at the beginning of the menu but the only way I can do it is to add a custom HTML menu item. I also want to change spacing between different links but using alternates I can't find a way to get in and edit detil of the menu widget, i.e. actual links, its more high level content.

Any ideas on how I can edit the styling of this widget please, preferably using templates?

Thanks, Kirsty
May 23, 2013 at 12:57 PM
In a nutshell, I would like to style individual menu links on a menu widget - any ideas please?
May 23, 2013 at 3:54 PM
To style individual menu links, you need to target them somehow. If it's just about CSS, you probably need the ability to specify a CSS class per menu item. One way to do that is by attaching a TextField to your menu item type. Next, override the menu item template and use the value of this text field to render it as a css class.

There's an upcoming conference called Orchard Harvest in Amsterdam which has a session on theming, which I think is made just for you. :)
May 28, 2013 at 9:59 AM
Hi thanks for you reply again :) Conference sounds great but I am unlikely to get there.

The menu is made up of Projection items. How would I add the text field to the menu? I have gone into the Projection part and added a text field but not sure how use the value of this text field to render it as a css class. Please could you give me an example?

Thanks, Kirsty
May 29, 2013 at 4:34 PM
Ok, so you should add that text field to the content type of the Projection items'. E.g. if the Projection items are Page content items, add the text field to the Page content type. Next, you probably need to override the menu item template to take into account the value of that text field. Which template specifically, I can't say form the top of my head.