|
Home > Archive > WebSphere Portal Server > November 2005 > Getting list of titles and URLs to pages
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Getting list of titles and URLs to pages
|
|
| zuker_wsa 2005-11-23, 5:56 pm |
| We now have over 60 sub-pages/tabs listed under our Welcome tab. Most pages are identical to each other in portlet content and layout, except that each has a portlet unique to a client. Each client obviously can't see anyone else's sub-tabs.
As an administrator though it's getting tedious to click the left/right arrows to scroll the horizontal list of these tabs to find a particular client's tab, so I'm tring to make an admin-only portlet that lets you link to a tab from a drop-down menu.
Obviously a more manual method would be to create custom "friendly" URLs for each of these tabs, but looks to be considerable upfront work and would require ongoing maintenance as pages are added/deleted. I'm hoping a portlet can dynamically generate this
information.
Is there a way to get the portlet to:
a) retrieve a list of tabs under a particular page
b) get their titles
c) generate a URL to these pages
Thanks
| |
|
| If it's only available to administrators, I would suggest adding it to the theme so that you can make the leap to page from anywhere. This is the code I use in my customized admin bar JSP:
<wps:urlGeneration contentNode="wps.Administration">
<script type="text/javascript" language="JavaScript">
<!--
function jump(fe){
var opt_key = fe.selectedIndex;
var uri_val = fe.options[opt_key].value;
window.open(uri_val,'_top');
return true;
}
//-->
</script>
<wps:if navigationAvailable="yes">
<td>
<form name="jumpto" method="GET" style="margin-bottom: 0">
<select name="url" onChange="return jump(this);" size="1">
<option value="">Select a link</option>
<wps:navigation startLevel="2" stopLevel="2">
<wps:navigationLoop>
<option value="<%=wpsNavModelUtil.createSelectionChangeURL(wpsNavNode)%>">
<%=LocaleHelper.getTitle((Localized)wpsNavNode, com.ibm.wps.engine.RunData.from(pageContext.getRequest()).getLocale())%>
</option>
</wps:navigationLoop>
</wps:navigation>
</select>
</form>
</td>
</wps:if>
</wps:urlGeneration>
The wps:urlGeneration tag makes sure that the enclosed content is only included for those who can see the administration link. You should set stopLevel to however deep you want to go.
You will want to make sure this doesn't interfere with your other navigation. You could try to stick the code in a portlet JSP if it doesn't play nice in the theme.
|
|
|
|
|