1

I am developing MVC Portlet and want to open specific page of my portlet through menu link via Controller. In velocity template I have portlet name of my portlet.

How can i get plid of that portlet?

My code is as below:

#if ($nav_item.getName().equalsIgnoreCase("specific menu link"))

#set ($myURL = $portletURLFactory.create($request,"portletname_WAR_portletnameportlet",$getterUtil.getLong($plid),"RENDER_PHASE"))
$myURL .setParameter("view","methodName") //Controller paramter
<a href="$myURL" > $nav_item.getName()</a>
#end

Its appending my paramters to current url and staying on current page.

I have added my portlet on another page and tried using hard coded plid, it works fine but for different servers it will create problems.

So, How can i get my portlets plid at runtime in vm file to use while creating URL?

PKumar
  • 10,971
  • 6
  • 37
  • 52

1 Answers1

0

we have maintain some where else in configuration.. i can give you the tip some thing store PlId value in portlet preferences .. in the velocity get portlet preference by portlet id .. then get the plid.

some times portlet may be places in many pages so we may get multiple plids.

Use same page names across all portal based on page name fetch plid.

Meera Prince
  • 177
  • 3