Well i found a way to do this. But ofbiz shows a really strange behavior. I think this is a bug.
In Common Menus i have this: <menus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-menu.xsd "> <menu name="CommonAppBarMenu" default-menu-item-name="main" id="app-navigation" *menu-container-style=""* type="simple" title="${applicationTitle}&nbsp;" default-selected-style="selected" *menu-container-style="button-bar tab-bar"* selected-menuitem-context-field-name="headerItem"> <menu-item name="main" title="${uiLabelMap.CommonMain}"> <condition><not><if-empty field="userLogin"/></not></condition> <link target="main" link-type="anchor"/> </menu-item> </menu> ... So the default menu-container-style is button-bar tab-bar. The other, empty one was created by me in order to make it work. Also in AccountingMenus.xml i had to add *menu-container-style="${activeApp}* and with this, i get the class i wanted. *The problem now is:* Altough i do have the right class now, *id="app-navigation"* is missing. And so are the classes *button-bar *and *tab-bar*. This behavior is not expected at all and i believe it is also wrong and a bug. The two classes button-bar and tab-bar are actually never shown... Not even in the original ofbiz with no changes made. In Short this means when adding a class to a menu, the id disapears. If you could point me to the place where those xml are translated to html, i could investigate further. On 19 May 2014 11:29, Adrian Stern <[email protected]> wrote: > Hi Nicolas > > Thanks for your answer. There ist this fucntions used in the > CommonAppBarMenu: title="${applicationTitle}. On the same location where > the value of applicationTitle is defined the is another variable called > *ActiveApp* which probably contains the app name: accounting, ar, ac, > warehouse, etc. > > What engine is used to preprocess those elements in the xml? > > > On 19 May 2014 10:55, Julien NICOLAS <[email protected]> wrote: > >> Hi Adrian, >> >> If I understand well, you want to add css class in menu. >> If I use the CommonMenus.xml located in framework/common/widget, you can >> see this : >> >> <menu name="CommonAppBarMenu" default-menu-item-name="main" >> id="app-navigation" type="simple" title="${applicationTitle}&nbsp;" >> default-selected-style="selected" menu-container-style="button-bar >> tab-bar" selected-menuitem-context-field-name="headerItem"> >> <menu-item name="main" title="${uiLabelMap.CommonMain}"> >> <condition><not><if-empty field="userLogin"/></not></ >> condition> >> <link target="main" link-type="anchor"/> >> </menu-item> >> </menu> >> >> where : >> id="app-navigation" will be the html element type >> >> name="CommonAppBarMenu" will be the html id >> >> default-selected-style="selected" will be the selected class >> definition for css >> >> menu-container-style="button-bar tab-bar" will be the main class for >> css >> >> I think that if you want to add a css class in your menu, you have to put >> it in "menu-container-style" >> >> And if you want to use a different menu style for different application, >> you have to create several "common" menu that will be used as extends in >> your application menus. >> >> hope it help, >> >> Julien. >> >> Le 19/05/2014 08:49, Adrian Stern a écrit : >> >> Hi Adrian. Ok i got this and thanks for the clarification. >>> >>> But just in sake for a better understanding of Ofbiz. Where would i add a >>> css Class to an Element which is defined in Xml like the bespoken Menu? >>> >>> >>> On 16 May 2014 16:54, Adrian Crum <[email protected] >>> >wrote: >>> >>> The current markup and styling follows the OFBiz HTML and CSS Best >>>> Practices: >>>> >>>> https://cwiki.apache.org/confluence/display/OFBADMIN/ >>>> HTML+and+CSS+Best+Practices >>>> >>>> Having application-specific CSS classes violates the concept of visual >>>> themes. The styling should always work the same - regardless of the >>>> application. >>>> >>>> >>>> Adrian Crum >>>> Sandglass Software >>>> www.sandglass-software.com >>>> >>>> On 5/14/2014 6:40 AM, Adrian Stern wrote: >>>> >>>> I've played around with visual themes and so far i really like the >>>>> ease of >>>>> use. But something bothers me anyways. >>>>> >>>>> There seems to be no CSS-classes given to elements besides some very >>>>> basic >>>>> ones. This makes it basically impossible to style forms relative to the >>>>> Application they're in. >>>>> >>>>> A global div-wrap with class=app-application would already help a big >>>>> deal. >>>>> Also a class telling me which sub menu is selected would be valuable. >>>>> >>>>> app-accounting = application >>>>> app-acc-payments = app navigation >>>>> app-screen-name = maybe better than app navigation >>>>> >>>>> I think from something like this, everyone would benefit and I would >>>>> happily do it. What does the community think? Maybe there is a reason >>>>> for >>>>> the lack of this? >>>>> Would it be possible to arrange such an improvement? >>>>> >>>>> Such an improvement would not break any themes but instead opening the >>>>> door >>>>> for new, more beautiful themes. >>>>> >>>>> >>>>> >> >
