Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Commerce Categories Navigation Template and Friendly URL
Hello everyone,
I'm creating a Widget Template (Commerce Categories Navigation).
I'm working with AssetCategory class (https://learn.liferay.com/reference/latest/en/dxp/javadocs/portal-kernel/com/liferay/asset/kernel/model/AssetCategory.html) and I'm wondering how can I get the friendly url.
Liferay Community Edition Portal 7.4.3.13 CE GA13
Hi ,
You can try below code for fetching friendly url
<#if entries?has_content>
<#list entries as curAssetCategory>
<#assign
categoryHref = cpAssetCategoriesNavigationDisplayContext
.getFriendlyURL(curAssetCategory.getCategoryId(), themeDisplay)
/>
${categoryHref}
</#list>
</#if>
Thank you very much, I tried and it works!
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™