Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
Srividhya Mohanasundaram
Web Content Template in portal_normal.vm
January 11, 2013 11:41 AM

Srividhya Mohanasundaram

Rank: New Member

Posts: 22

Join Date: June 29, 2012

Recent Posts


I want to include web content which has a structure and template in portal_normal.vm file. I have attached my web content and structure files. And here is my template. If you look at the template none of the variables $request.get("attributes").USER_ID are getting resolved. It works fine if I select this web content through web content display portlet

#set($userId = $request.get("attributes").USER_ID)
#set($userLocalService= $serviceLocator.findService("com.liferay.portal.service.UserLocalService"))
#set($user = $userLocalService.getUserById($getterUtil.getLong($userId)))

<div id="header-con">
<div id="user">
<div id="user-fullname">
#if ( $user.getFirstName() )
#if ( $user.getLastName() )

Here is my portal_normal.vm

<!DOCTYPE html>

#parse ($init)

<html class="#language("lang.dir")" dir="#language("lang.dir")" lang="$w3c_language_id">

<title>$the_title - $company_name </title>

<body class="$css_class">


#if ($is_signed_in)

<div id="wrapper">
<a href="#main-content" id="skip-to-content">#language("skip-to-content") </a>

<header id="banner" role="banner">

<div id="$header_class">
#set ($header-content-id = "109606")
#set ($header-template-id = "109603")
#set($header-content=$journalContentUtil.getContent($group_id, $header-content-id,$header-template-id,"$locale",$themeDisplay))

<div id="content">

#if ($selectable)


$theme.wrapPortlet("portlet.vm", $content_include)







Attachments: Screen Shot 2013-01-11 at 2.15.59 PM.png (58.6k), Screen Shot 2013-01-11 at 2.16.16 PM.png (56.8k)
Parikshit Sharma
RE: Web Content Template in portal_normal.vm
January 17, 2013 4:50 AM

Parikshit Sharma

Rank: New Member

Posts: 21

Join Date: January 16, 2013

Recent Posts

$journalContentUtil.getContent(groupId,articleId, templateId, viewMode, languageId, themeDisplay) it won't work until you create the object of themeDisplay in velocity.What we is( key- value) pair not the object of themeDisplay class,so check the ThemeDisplay class and set the required values same as we do in Java and you will get the required Object of theme and then above method will worked out.