Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Sushil Mayengbam
Question: $theme.include($top_head_include)?
September 27, 2011 7:22 AM
Answer

Sushil Mayengbam

Rank: Junior Member

Posts: 53

Join Date: February 16, 2010

Recent Posts

can anyone let me know what this line is doing at portal_normal.vm? I sense that it's including a JSP page ('top_include.jsp') but HOW?
where this $theme object is defined? I don't think this object is the one defined in init.vm.
Jelmer Kuperus
RE: Question: $theme.include($top_head_include)?
September 27, 2011 8:17 AM
Answer

Jelmer Kuperus

Rank: Liferay Legend

Posts: 1190

Join Date: March 10, 2010

Recent Posts

top_head_include is defined in init.vm as this

1#set ($top_head_include = "$dir_include/common/themes/top_head.jsp")


$theme is an instance of com.liferay.taglib.util.VelocityTaglib that is placed in the velocity context. and yes it basically includes a jsp using the request dispatcher

1    public void include(ServletContext servletContext, String page)
2        throws Exception {
3
4        RequestDispatcher requestDispatcher =
5            servletContext.getRequestDispatcher(page);
6
7        requestDispatcher.include(_request, _response);
8    }


As far as i can tell it is used to include liferay's js and css files in the head section of a theme
Sushil Mayengbam
RE: Question: $theme.include($top_head_include)?
September 27, 2011 6:24 PM
Answer

Sushil Mayengbam

Rank: Junior Member

Posts: 53

Join Date: February 16, 2010

Recent Posts

jelmer kuperus:
top_head_include is defined in init.vm as this

1#set ($top_head_include = "$dir_include/common/themes/top_head.jsp")


$theme is an instance of com.liferay.taglib.util.VelocityTaglib that is placed in the velocity context. and yes it basically includes a jsp using the request dispatcher

1    public void include(ServletContext servletContext, String page)
2        throws Exception {
3
4        RequestDispatcher requestDispatcher =
5            servletContext.getRequestDispatcher(page);
6
7        requestDispatcher.include(_request, _response);
8    }


As far as i can tell it is used to include liferay's js and css files in the head section of a theme



cool! this is the information I'm looking for. Many thanks!!!
Sushil Saini
RE: Question: $theme.include($top_head_include)?
December 1, 2012 6:27 PM
Answer

Sushil Saini

Rank: Regular Member

Posts: 102

Join Date: July 27, 2011

Recent Posts

jelmer kuperus:
top_head_include is defined in init.vm as this

1#set ($top_head_include = "$dir_include/common/themes/top_head.jsp")


$theme is an instance of com.liferay.taglib.util.VelocityTaglib that is placed in the velocity context. and yes it basically includes a jsp using the request dispatcher

1    public void include(ServletContext servletContext, String page)
2        throws Exception {
3
4        RequestDispatcher requestDispatcher =
5            servletContext.getRequestDispatcher(page);
6
7        requestDispatcher.include(_request, _response);
8    }


As far as i can tell it is used to include liferay's js and css files in the head section of a theme


Thanks Jelmer... for posting this information ...