<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>How to customize the content of navigation menu in Liferay</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=94612791" />
  <subtitle>How to customize the content of navigation menu in Liferay</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=94612791</id>
  <updated>2026-04-06T06:01:23Z</updated>
  <dc:date>2026-04-06T06:01:23Z</dc:date>
  <entry>
    <title>RE: How to customize the content of navigation menu in Liferay</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=94781393" />
    <author>
      <name>Karl Chin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=94781393</id>
    <updated>2017-09-12T09:27:47Z</updated>
    <published>2017-09-12T09:27:47Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi Massimo,&lt;br&gt;&lt;br&gt;Yes, you are right. Your code is responsive to mobile.&lt;br&gt;&lt;br&gt;Therefore, together with what's in https://web.liferay.com/community/forums/-/message_boards/message/94161220, I have add the following code in sitepages.ftl in the templates folder in a custom theme to customize my navigation menu.&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;
&amp;lt;div aria-expanded="true" class="collapse navbar-collapse" id="navigationCollapse"&amp;gt;
&amp;lt;ul class="nav navbar-nav"&amp;gt;    
        &amp;amp;lt;#assign  count = 0 /&amp;amp;gt;
        &amp;amp;lt;#list nav_items as nav_item&amp;amp;gt;
            &amp;amp;lt;#assign  count = count +1  /&amp;amp;gt;
            &amp;amp;lt;#assign  nav_item_class = "item-" + count /&amp;amp;gt;
    
            &amp;amp;lt;#if count == 1&amp;amp;gt;
                &amp;amp;lt;#assign  nav_item_class = nav_item_class + " first" /&amp;amp;gt;
            &amp;lt;!--#if--&amp;gt;

            &amp;amp;lt;#if nav_item.isSelected() &amp;amp;gt;
                &amp;amp;lt;#assign nav_item_class = nav_item_class + " selected" /&amp;amp;gt;
            &amp;lt;!--#if--&amp;gt;
            
            &amp;lt;li class="${nav_item_class}"&amp;gt;
                &amp;lt;a href="${nav_item.getURL()}" ${nav_item.gettarget()}&amp;gt;
                    &amp;lt;span&amp;gt;${nav_item.getName()}&amp;lt;/span&amp;gt;
                &amp;lt;/a&amp;gt;
            &amp;lt;/li&amp;gt;
            
            &amp;amp;lt;#if nav_item.hasChildren()&amp;amp;gt;
                &amp;amp;lt;#list nav_item.getChildren() as nav_child&amp;amp;gt;
                   &amp;amp;lt;#if nav_item.isSelected()&amp;amp;gt;
                        &amp;lt;li class="selected sub"&amp;gt;
                        &amp;lt;/li&amp;gt;
                    &amp;amp;lt;#else&amp;amp;gt;
                       &amp;lt;li class="sub"&amp;gt;
                    &amp;lt;!--#if--&amp;gt;
                            &amp;lt;a href="${nav_child.getURL()}" ${nav_child.gettarget()}&amp;gt;${nav_child.getName()}&amp;lt;/a&amp;gt;
                        &amp;lt;/li&amp;gt;
                &amp;lt;!--#list--&amp;gt;
            &amp;lt;!--#if--&amp;gt;
        &amp;lt;!--#list--&amp;gt;
    
		&amp;amp;lt;#assign linkUrl = themeDisplay.getPortalURL() /&amp;amp;gt;
        
		&amp;amp;lt;#assign screenName = themeDisplay.getUser().screenName /&amp;amp;gt;
		
			&amp;lt;li class="${nav_item_class}"&amp;gt;
				&amp;lt;a href="${linkUrl}/user/${screenName}"&amp;gt;My Dashboard&amp;lt;/a&amp;gt;
			&amp;lt;/li&amp;gt;
		
			&amp;lt;li class="${nav_item_class}"&amp;gt;
				&amp;lt;a href="${linkUrl}/web/lportal/sign-out"&amp;gt;Sign Out&amp;lt;/a&amp;gt;
			&amp;lt;/li&amp;gt;
  &amp;lt;/ul&amp;gt;
    &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;Also remember to apply the sitepages.ftl in portal_normal.ftl by changing the code like:&lt;br&gt;&lt;pre&gt;&lt;code&gt;
					&amp;amp;lt;#if has_navigation&amp;amp;gt;
						&amp;amp;lt;#--include "${full_templates_path}/navigation.ftl" /--&amp;amp;gt;
						&amp;amp;lt;#include "${full_templates_path}/sitepages.ftl" /&amp;amp;gt;
					&amp;lt;!--#if--&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;You really save my day, thank you very much! Expert!&lt;br&gt;&lt;br&gt;All the best,&lt;br&gt;Karl Chin&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Karl Chin</dc:creator>
    <dc:date>2017-09-12T09:27:47Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to customize the content of navigation menu in Liferay</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=94777019" />
    <author>
      <name>Massimo Bevilacqua</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=94777019</id>
    <updated>2017-09-12T07:33:51Z</updated>
    <published>2017-09-12T07:33:51Z</published>
    <summary type="html">Hi,&lt;br /&gt;&lt;br /&gt;are you sure it is not responsive?I use sitepages in my theme and it is responsive.&lt;br /&gt;&lt;br /&gt;By the way if you need to customize navigation menu you can change navigation.ftl, sitepages.ftl and put your css style inside _custom.scss.&lt;br /&gt;&lt;br /&gt;My suggestion is: take an existing free theme (porygon or 1975 London) and look inside the code(templates, css....) in this way you can understand how customize navigation menu(in porygon theme you can find _header.scss and _navbar_porygon.scss).&lt;br /&gt;&lt;br /&gt;Best regards &lt;br /&gt;&lt;br /&gt;Massimo</summary>
    <dc:creator>Massimo Bevilacqua</dc:creator>
    <dc:date>2017-09-12T07:33:51Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to customize the content of navigation menu in Liferay</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=94770979" />
    <author>
      <name>Karl Chin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=94770979</id>
    <updated>2017-09-12T04:41:02Z</updated>
    <published>2017-09-12T04:41:02Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi Massimo,&lt;br&gt;&lt;br&gt;You code in sitepages.ftl will work on web, however, it is still not mobile responsive.&lt;br&gt;&lt;br&gt;I can see there is a code in navigation.ftl.&lt;br&gt;&lt;pre&gt;&lt;code&gt;
		&amp;amp;lt;@liferay.navigation_menu
			instance_id="main_navigation_menu"
			default_preferences="${freeMarkerPortletPreferences}"
		/&amp;amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;I am wondering if  we can customize it (liferay.navigation_menu)? &lt;br&gt;&lt;br&gt;I can only see some guideline on the customization of product menus. (https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/product-navigation)&lt;br&gt;&lt;br&gt;&lt;br&gt;All the best,&lt;br&gt;Karl Chin&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Karl Chin</dc:creator>
    <dc:date>2017-09-12T04:41:02Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to customize the content of navigation menu in Liferay</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=94738354" />
    <author>
      <name>Massimo Bevilacqua</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=94738354</id>
    <updated>2017-09-11T10:40:17Z</updated>
    <published>2017-09-11T10:40:17Z</published>
    <summary type="html">I have never overide liferay JS, I only added some function inside my code.&lt;br /&gt;Try to write your function and add it inside your sitepage.ftl otherwise you can search on google how to insert your js file in liferay</summary>
    <dc:creator>Massimo Bevilacqua</dc:creator>
    <dc:date>2017-09-11T10:40:17Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to customize the content of navigation menu in Liferay</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=94733161" />
    <author>
      <name>Karl Chin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=94733161</id>
    <updated>2017-09-11T09:45:01Z</updated>
    <published>2017-09-11T09:45:01Z</published>
    <summary type="html">Hi Massimo,&lt;br /&gt;&lt;br /&gt;Thanks for your code.&lt;br /&gt;&lt;br /&gt;Can I just change some .js to fulfill the customization on the content of the navigation menu? Actually, I am trying to search in the source but not yet identified which one does the work. &lt;img alt="emoticon" src="@theme_images_path@/emoticons/bored.gif" &gt;&lt;br /&gt;&lt;br /&gt;All the best,&lt;br /&gt;Karl Chin</summary>
    <dc:creator>Karl Chin</dc:creator>
    <dc:date>2017-09-11T09:45:01Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to customize the content of navigation menu in Liferay</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=94655397" />
    <author>
      <name>Massimo Bevilacqua</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=94655397</id>
    <updated>2017-09-08T06:47:35Z</updated>
    <published>2017-09-08T06:47:35Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi,&lt;br&gt;&lt;br&gt;I guess I found it in a theme called atrek and the file is "sitepages.ftl"&lt;br&gt;&lt;br&gt;put it inside templates folder&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;h2&amp;gt;&amp;lt;span&amp;gt;Site Pages&amp;lt;/span&amp;gt;&amp;lt;/h2&amp;gt;
	&amp;lt;ul&amp;gt;
		&amp;amp;lt;#assign  count = 0 /&amp;amp;gt;
		&amp;amp;lt;#list nav_items as nav_item&amp;amp;gt;
			&amp;amp;lt;#assign  count = count +1  /&amp;amp;gt;
			&amp;amp;lt;#assign  nav_item_class = "item-" + count /&amp;amp;gt;
	
			&amp;amp;lt;#if count == 1&amp;amp;gt;
				&amp;amp;lt;#assign  nav_item_class = nav_item_class + " first" /&amp;amp;gt;
			&amp;lt;!--#if--&amp;gt;
	
			&amp;amp;lt;#if nav_item.isSelected() &amp;amp;gt;
				&amp;amp;lt;#assign nav_item_class = nav_item_class + " selected" /&amp;amp;gt;
			&amp;lt;!--#if--&amp;gt;
			
			&amp;lt;li class="${nav_item_class}"&amp;gt;
				&amp;lt;a href="${nav_item.getURL()}" ${nav_item.gettarget()}&amp;gt;
					&amp;lt;span&amp;gt;${nav_item.getName()}&amp;lt;/span&amp;gt;
				&amp;lt;/a&amp;gt;
			&amp;lt;/li&amp;gt;
			
			&amp;amp;lt;#if nav_item.hasChildren()&amp;amp;gt;
				&amp;amp;lt;#list nav_item.getChildren() as nav_child&amp;amp;gt;
					&amp;amp;lt;#if nav_item.isSelected()&amp;amp;gt;
						&amp;lt;li class="selected sub"&amp;gt;
					&amp;amp;lt;#else&amp;amp;gt;
						&amp;lt;/li&amp;gt;&amp;lt;li class=" sub"&amp;gt;
					&amp;lt;!--#if--&amp;gt;
							&amp;lt;a href="${nav_child.getURL()}" ${nav_child.gettarget()}&amp;gt;${nav_child.getName()}&amp;lt;/a&amp;gt;
						&amp;lt;/li&amp;gt;
				&amp;lt;!--#list--&amp;gt;
			&amp;lt;!--#if--&amp;gt;
		&amp;lt;!--#list--&amp;gt;
	&amp;lt;/ul&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Massimo Bevilacqua</dc:creator>
    <dc:date>2017-09-08T06:47:35Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to customize the content of navigation menu in Liferay</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=94651595" />
    <author>
      <name>Karl Chin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=94651595</id>
    <updated>2017-09-08T04:02:43Z</updated>
    <published>2017-09-08T04:02:43Z</published>
    <summary type="html">Hi Massimo,&lt;br /&gt;&lt;br /&gt;I cannot find site_pages.ftl in the source. Where is the file location? under ../templates? Could you please provide some sample code on that?&lt;br /&gt;&lt;br /&gt;TIA.&lt;br /&gt;&lt;br /&gt;All the best,&lt;br /&gt;Karl Chin</summary>
    <dc:creator>Karl Chin</dc:creator>
    <dc:date>2017-09-08T04:02:43Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to customize the content of navigation menu in Liferay</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=94611806" />
    <author>
      <name>Massimo Bevilacqua</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=94611806</id>
    <updated>2017-09-07T09:13:14Z</updated>
    <published>2017-09-07T09:13:14Z</published>
    <summary type="html">I don&amp;#39;t know if I understand your question...but try also to check site_pages.ftl</summary>
    <dc:creator>Massimo Bevilacqua</dc:creator>
    <dc:date>2017-09-07T09:13:14Z</dc:date>
  </entry>
  <entry>
    <title>How to customize the content of navigation menu in Liferay</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=94612790" />
    <author>
      <name>Karl Chin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=94612790</id>
    <updated>2017-09-07T08:17:05Z</updated>
    <published>2017-09-07T08:17:05Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi Experts,&lt;br&gt;&lt;br&gt;I am working on a portal project using Liferay 7 GA4. How can I customize the navigation menu? &lt;br&gt;&lt;br&gt;I have checked navigation.ftl in a theme project and there is a section for showing the menu.&lt;br&gt;&lt;pre&gt;&lt;code&gt;
&amp;amp;lt;@liferay.navigation_menu
			instance_id="main_navigation_menu"
			default_preferences="${freeMarkerPortletPreferences}"
		/&amp;amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;After some googling, hook may be a direction. However, it is also said that OSGi module is the preferable way for customization.  &lt;br&gt;&lt;br&gt;Therefore, here is the question: &lt;br&gt;Which jsp is being used to control the behavior of com.liferay.site.navigation.menu.web OSGi module?&lt;br&gt;&lt;br&gt;All the best,&lt;br&gt;Karl Chin&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Karl Chin</dc:creator>
    <dc:date>2017-09-07T08:17:05Z</dc:date>
  </entry>
</feed>
