Foren

accessing navigation.vm in web content template.

Rehan Khan, geändert vor 7 Jahren.

accessing navigation.vm in web content template.

New Member Beiträge: 2 Beitrittsdatum: 30.11.16 Neueste Beiträge
Hi everyone,

I want to access navigation.vm file in web content template.

Is this possible? If so please provide me a solution. and if not possible what is alternate to this?

Thanks in advance
thumbnail
Samuel Kong, geändert vor 7 Jahren.

RE: accessing navigation.vm in web content template.

Liferay Legend Beiträge: 1902 Beitrittsdatum: 10.03.08 Neueste Beiträge
You're referring to the navigation.vm in the theme, correct?

Not possible.

Instead of trying to load the theme's VM file (and I'm not sure why you would want to do this), just add the logic you want to the web content template.
Rehan Khan, geändert vor 7 Jahren.

RE: accessing navigation.vm in web content template.

New Member Beiträge: 2 Beitrittsdatum: 30.11.16 Neueste Beiträge
thanks Samuel Kong for your quick response,
Yes exactly i am telling about the theme vm file.

Why i am doing this because we have two type of menu i.e horizontal (up to 2 level) and vertical menu (from 3rd to 4th level).
the vertical menu should be display inside the content div.

Now if i add the .vm for the vertical menu inside the content div. this will disturb the layout for other pages which dont have a 3rd and 4th level menu.

Hope you understand.
I have only one theme.
thumbnail
Samuel Kong, geändert vor 7 Jahren.

RE: accessing navigation.vm in web content template.

Liferay Legend Beiträge: 1902 Beitrittsdatum: 10.03.08 Neueste Beiträge
You probably shouldn't try to include the menu in a web content.

If your 3rd/4th level menu is a part of the theme, then it should go in your theme. However, if it's a part of your theme, you won't be able to include it within your content div. It's just not possible unless you use some sort of client side JS to move the menu.

If you really want it within your content div, you can try using adding a Navigation portlet. However, you'll have to manually add this to every page that needs it.