Combination View Flat View Tree View
Threads [ Previous | Next ]
kawther JN
liferay theme add submenus
August 8, 2012 2:19 PM
Answer

kawther JN

Rank: Regular Member

Posts: 105

Join Date: August 2, 2012

Recent Posts

hello, I am a very beginner with liferay and I wanna build my own portal , I am going to use a theme already developed but I want to customise it a bit ..I am asking what files are need to be changed if I will add submenus to my theme?
Tejas Kanani
RE: liferay theme add submenus
August 8, 2012 7:25 PM
Answer

Tejas Kanani

Rank: Liferay Master

Posts: 654

Join Date: January 6, 2009

Recent Posts

To add sub menu, you'll have to make modification in navigation.vm file in theme.
Don't modify existing navigation.vm just put it in _diffss/templates/navigation.vm and then make modification in it for adding sub menus.
I would suggest first check out below link which will give you more idea how to develop/modify with Liferay theme.
http://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/creating-liferay-them-7
Priyanka Dhingra
RE: liferay theme add submenus
August 8, 2012 10:18 PM
Answer

Priyanka Dhingra

Rank: Liferay Master

Posts: 501

Join Date: December 19, 2011

Recent Posts

Hi,
Go through basics of theme from documentation and
for creating a theme
http://michi-path.blogspot.in/2012/07/create-theme-from-scratch-liferay.html

after that as Tejas already said
change the navigation.vm under the _diffs/templates folder
Jignesh Vachhani
RE: liferay theme add submenus
August 8, 2012 10:45 PM
Answer

Jignesh Vachhani

Rank: Liferay Master

Posts: 775

Join Date: March 10, 2008

Recent Posts

Adding more to solution given by Tejas.
This is the code which you can use to generate sub menus.
You can put this code in navigation.vm file and override it by putting it into _diff/templates/ folder in theme plugin

 1
 2<div class="" id="navigation">
 3    <ul>
 4        #foreach ($nav_item in $nav_items)
 5                #if ($nav_item.isSelected())
 6                    <li class="active">
 7                    #else
 8                    <li>
 9                    #end
10
11                <span class="s5_outer_active"><span>
12            
13                <a class="" href="$nav_item.getURL()" $nav_item.getTarget()>$nav_item.icon() $nav_item.getName()</a><span class="s5_outerr"></span></span></span>
14
15                #if ($nav_item.hasChildren())
16                    <ul>
17                    <li class="s5_toparrow"></li>
18                        #foreach ($nav_child in $nav_item.getChildren())
19                        
20                           
21                                <li class="noback"><span><span class="span_nonactive">
22                                <a class="sub" href="$nav_child.getURL()" $nav_child.getTarget()>
23                                   $nav_child.getName()
24                                </a></span></span>
25                               
26                                #if ($nav_child.hasChildren())
27                                <ul>
28                               
29                                    #foreach ($nav_chil in $nav_child.getChildren())
30                                    <li class="s5_menutop"></li>
31                                    <li> <span class="parent"> <a class="parent" href="$nav_child.getURL()" $nav_chil.getTarget()>$nav_chil.getName() </a> </span>
32
33                                           
34                                            #if ($nav_chil.hasChildren())
35                                                <ul>
36                               
37                                                #foreach ($nav_chi in $nav_chil.getChildren())
38                                                    <li class="s5_menutop"></li>
39                                                    <li> <span class="parent"> <a class="parent" href="$nav_chi.getURL()" $nav_chi.getTarget()>$nav_chi.getName() </a> </span> </li>
40                                                    #end
41                                                    <li class="s5_menubottom"></li>
42                                                </ul>
43                                            #end
44
45
46
47                                    #end
48                                    <li class="s5_menubottom"></li>
49                                </ul>
50                                #end
51                            </li>
52                           
53                        #end
54                        <li class="s5_menubottom"></li>
55                    </ul>
56                #end
57            </li>
58        #end
59    </ul>
60    </div>
kawther JN
RE: liferay theme add submenus
August 9, 2012 2:10 PM
Answer

kawther JN

Rank: Regular Member

Posts: 105

Join Date: August 2, 2012

Recent Posts

thanks for your help
I did create _diffss/templates/navigation.vm and add the code given by Jignesh but nothing has changed, no submenus generated !!
plz help
Dhrutika Vyas
RE: liferay theme add submenus
August 10, 2012 2:42 AM
Answer

Dhrutika Vyas

Rank: Expert

Posts: 435

Join Date: February 9, 2009

Recent Posts

Hi,

Have you created folder _diffss or _diffs? if its _diffss please change it to _diffs.

Though it doesn't work,attach you theme in forum,so by looking into it we can find out what is the issue.

Regards,
Dhrutika
kawther JN
RE: liferay theme add submenus
August 10, 2012 2:01 PM
Answer

kawther JN

Rank: Regular Member

Posts: 105

Join Date: August 2, 2012

Recent Posts

the folder that I did create is _diffs but it dosnt work !
kawther JN
RE: liferay theme add submenus
August 11, 2012 12:47 PM
Answer

kawther JN

Rank: Regular Member

Posts: 105

Join Date: August 2, 2012

Recent Posts

should I make changes in custom.css to add submenus to my theme or only navigation.vm?
Dhrutika Vyas
RE: liferay theme add submenus
August 12, 2012 11:27 PM
Answer

Dhrutika Vyas

Rank: Expert

Posts: 435

Join Date: February 9, 2009

Recent Posts

Can you attach you theme zip over here? By looking at it I can help you out.

Regards,
Dhrutika
kawther JN
RE: liferay theme add submenus
August 21, 2012 7:58 AM
Answer

kawther JN

Rank: Regular Member

Posts: 105

Join Date: August 2, 2012

Recent Posts

hi,
to create my own portal ,I made an instance of 7Cogs theme to work on it (I like to work with the 7cogs theme), I tried to add submenus to this instance but it didnt work
I did make many changes in navigation.vm and custom.css but nothing work !

plz can any1 give me a solution.
thanx
kawther JN
RE: liferay theme add submenus
August 22, 2012 3:19 AM
Answer

kawther JN

Rank: Regular Member

Posts: 105

Join Date: August 2, 2012

Recent Posts

plz help emoticon