Skip to content

Instantly share code, notes, and snippets.

@farmerbradllc
Created September 28, 2011 17:47
Show Gist options
  • Save farmerbradllc/1248634 to your computer and use it in GitHub Desktop.
Save farmerbradllc/1248634 to your computer and use it in GitHub Desktop.
Grab Hidden Nav Items for Footer Navigation
#set($layoutLocalService = $serviceLocator.findService("com.liferay.portal.service.LayoutLocalService"))
#set ($localizationUtil = $portal.getClass().forName('com.liferay.portal.kernel.util.LocalizationUtil'))
#set($topPublicLayouts = $layoutLocalService.getLayouts($layout.getGroupId(),false))
<ul>
#foreach ($layout_item in $topPublicLayouts)
#if ($layout_item.getHidden())
$languageId
$language_id
$theme_display.languageId
$layout_url
$home_url
$page.getPlid()
#set ($layout_item_name = $localizationUtil.getLocalization($layout_item.name, $theme_display.languageId))
<li><span>$layout_item_name</span></li>
<ul class="child">
#foreach ($layout_child in $layout_item.getChildren())
#set ($layout_child_name = $localizationUtil.getLocalization($layout_child.getName(), $theme_display.languageId))
#set ($layout_child_url = $localizationUtil.getLocalization($layout_child.getName(), $theme_display.languageId))
<li>
<span>$layout_child_name</span>
#if($layout_child.hasChildren())
<ul class="grand-child">
#foreach ($layout_grand_child in $layout_child.getChildren())
#set ($layout_grand_child_name = $localizationUtil.getLocalization($layout_grand_child.getName(), $theme_display.languageId))
##set ($layout_grand_child_url = $localizationUtil.getLocalization($layout_grand_child.getUrl(), $theme_display.languageId))
##set ($layout_grand_child_target = $localizationUtil.getLocalization($layout_grand_child.getTarget(), $theme_display.languageId))
$layout_grand_child.getTypeSettingsProperties().getString('url')
$layout_grand_child
<li><a href="$layout_grand_child_url" target="$layout_grand_child_target"><span>$layout_grand_child_name</span></a></li>
#end
</ul>
#end
</li>
#end
</ul>
</li>
#end
#end
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment