Disabling anchors in portlet URLs

In a scenario where you have several portlets arranged vertically on a page and when you click on any action on last portlet on the page, as a result you are then forced to scroll up the browser to see the portlets from top of the page.
Haven't experienced this before?? try it out....

Let me come to the point again..
Basically portal remembers your last action clicked on portlet on a page and shows you that portlet so that you don't require to scroll up or down to see result in your portlet.


This actually happens because portal appends an anchor to the portlet URL and this causes you to manually move the browser up and see the protlets from top of the page.

In situations, you might prefer to have top of the page displayed even if you click on last portlet on the page, to achive thisyou will need to disable anchors.

Here is how you can disable anchor tag
1) Identify Skin applied of your page
2) Navigate to

<wp-profile>\installedApps\<node>\wps.ear\wps.war\skins\html\<SkinName>
3) Open file Control.jsp
4) Search for the word anchor.
5) you will find following

<c-rt:if test="${themePolicy.renderPortletFragmentIDAnchor}"><a name="<%= myPortletID %>"></a></c-rt:if>
6) Comment above line of code.
7) Save Control.jsp

that's it you are good to go.
You can verify this by performing action on last portlet on your page and now you can see that you are already on top of the page.

No comments: