Fórum

Icon not shown for child menu

Gwowen Fu, modificado 8 Anos atrás.

Icon not shown for child menu

Expert Postagens: 315 Data de Entrada: 27/12/10 Postagens Recentes
Hi,
I want to set icon on child menus. I select icon for each menu in Site Pages -> Advanced page. Only the root menu shows icon, the child menu doesn't show the icon.
Should the icon displayed for child menu of the root menu?

I am using the OOB Classic theme and Liferay is Portal Enterprise Edition 6.2.10 EE GA1

Thank you!
Gwowen
thumbnail
David H Nebinger, modificado 8 Anos atrás.

RE: Icon not shown for child menu

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
That's a question for your theme developer. If it's not in the navigation.vm, it's not going to be in the menu.
Gwowen Fu, modificado 8 Anos atrás.

RE: Icon not shown for child menu

Expert Postagens: 315 Data de Entrada: 27/12/10 Postagens Recentes
David H Nebinger:
That's a question for your theme developer. If it's not in the navigation.vm, it's not going to be in the menu.


Hi David, I am using the OOB Classic theme. because the icon is configurable through the control panel so I though it should work for any menu item no matter it is a child menu or not.
thumbnail
David H Nebinger, modificado 8 Anos atrás.

RE: Icon not shown for child menu

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
The classic theme doesn't support inner icons.

The main nav has the following:

<a aria-labelledby="layout_$nav_item.getLayoutId()" $nav_item_attr_has_popup class="$nav_item_link_css_class" href="$nav_item.getURL()" $nav_item.getTarget() role="menuitem">
<span>$nav_item.icon() $nav_item.getName() $nav_item_caret</span>
</a>

However, the child nav items has simply:

<a aria-labelledby="layout_$nav_child.getLayoutId()" href="$nav_child.getURL()" $nav_child.getTarget() role="menuitem">$nav_child.getName()</a>

As you can see, it's a matter for the theme developer. In this case the classic theme dev did not include icons for the child menu items.
Gwowen Fu, modificado 8 Anos atrás.

RE: Icon not shown for child menu (Resposta)

Expert Postagens: 315 Data de Entrada: 27/12/10 Postagens Recentes
David H Nebinger:
The classic theme doesn't support inner icons.

The main nav has the following:

<a aria-labelledby="layout_$nav_item.getLayoutId()" $nav_item_attr_has_popup class="$nav_item_link_css_class" href="$nav_item.getURL()" $nav_item.getTarget() role="menuitem">
<span>$nav_item.icon() $nav_item.getName() $nav_item_caret</span>
</a>

However, the child nav items has simply:

<a aria-labelledby="layout_$nav_child.getLayoutId()" href="$nav_child.getURL()" $nav_child.getTarget() role="menuitem">$nav_child.getName()</a>

As you can see, it's a matter for the theme developer. In this case the classic theme dev did not include icons for the child menu items.


David, Thank you! Adding $nav_child.icon() to the child menu item solved the issue.
thumbnail
Juan Gonzalez, modificado 8 Anos atrás.

RE: Icon not shown for child menu

Liferay Legend Postagens: 3089 Data de Entrada: 28/10/08 Postagens Recentes
Hi Gwowen,

I guess David is right, if you look at the navigation.vm file in classic theme (6.2.3 GA4) you can see this:

https://github.com/liferay/liferay-portal/blob/6.2.3-ga4/portal-web/docroot/html/themes/classic/_diffs/templates/navigation.vm#L26

So, just create a custom theme and customize navigation.vm to add the icon wherever you want.
Gwowen Fu, modificado 8 Anos atrás.

RE: Icon not shown for child menu

Expert Postagens: 315 Data de Entrada: 27/12/10 Postagens Recentes
Juan, thank you for the reply. Do you know why the icon code is not added to the Classic template since the icon is already configurable in the control panel?
thumbnail
David H Nebinger, modificado 8 Anos atrás.

RE: Icon not shown for child menu

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
I can't speak for them, but any theme decision is based upon the UI requirements.

I think it's a mistake to see the classic theme as something that you should use as-is. It contains a number of assumptions that may (or may not) match your own UI requirements.

But remember it's really there to demonstrate what is capable in a Liferay theme. Think of it more like a demo theme and less like a foundation for your site.
Gwowen Fu, modificado 8 Anos atrás.

RE: Icon not shown for child menu

Expert Postagens: 315 Data de Entrada: 27/12/10 Postagens Recentes
David H Nebinger:
I can't speak for them, but any theme decision is based upon the UI requirements.

I think it's a mistake to see the classic theme as something that you should use as-is. It contains a number of assumptions that may (or may not) match your own UI requirements.

But remember it's really there to demonstrate what is capable in a Liferay theme. Think of it more like a demo theme and less like a foundation for your site.


Thank for the information, that is good to know.