Forums de discussion

site map template with velocity

juan meza, modifié il y a 10 années.

site map template with velocity

Regular Member Publications: 228 Date d'inscription: 06/01/14 Publications récentes
hi, i want to use the site map portlet, with a custom template in velocity, but i cant seem to be able to get the page url when iterating the pages... how can this be done?

this is what i have:


<div>
<ul id="submenu">
#if (!$entries.isEmpty())
	#foreach ($curPage in $entries)
		<li>
		    <a href="$curPage.getFriendlyURL($locale)"> $curPage.getName($locale)</a>
		</li>
		#end
#end
</ul>
</div>



but $curPage.getFriendlyURL($locale) only gives me the page url (/page-url), and when its a subpage i cant seem to know how to get the first part of the url (/group/site-url/)

how can i do this? i guess i could get the current url and then make a split and concatenate but there should be an easier way

any help is apretiated emoticon

thanks!
juan meza, modifié il y a 10 années.

RE: site map template with velocity

Regular Member Publications: 228 Date d'inscription: 06/01/14 Publications récentes
to answer my own question


$curPage.getRegularURL($request)

that gives the correct url

hope it helps someone emoticon
thumbnail
nicolas saubi, modifié il y a 7 années.

RE: site map template with velocity

Junior Member Publications: 43 Date d'inscription: 28/10/09 Publications récentes
Thanks just helped me emoticon