<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Commerce Categories Navigation Template and Key-Value Properties</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121416399" />
  <subtitle>Commerce Categories Navigation Template and Key-Value Properties</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121416399</id>
  <updated>2026-05-07T05:58:27Z</updated>
  <dc:date>2026-05-07T05:58:27Z</dc:date>
  <entry>
    <title>RE: RE: Commerce Categories Navigation Template and Key-Value Properties</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121422387" />
    <author>
      <name>Jeffrey Handa</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121422387</id>
    <updated>2022-05-13T15:09:58Z</updated>
    <published>2022-05-13T15:09:57Z</published>
    <summary type="html">&lt;p&gt;HI Gennaro, &lt;/p&gt;
&lt;p&gt;Sorry, I'm not much of a FreeMarker expert so please don't consider
  my example as a best practice.  You should be able to wrap your code
  in an Attempt/Recover block.  Something like:  &lt;/p&gt;
&lt;p&gt;&amp;lt;#attempt&amp;gt;&lt;br /&gt;     &amp;lt;#if
  assetCategoryPropertyLocalService.getCategoryProperty(categoryId,propertyName)??&amp;gt;&lt;br /&gt;
        
   ${(assetCategoryPropertyLocalService.getCategoryProperty(categoryId,propertyName).getValue())!}&lt;br /&gt;
      &amp;lt;/#if&amp;gt;&lt;br /&gt; &amp;lt;#recover&amp;gt;&lt;br /&gt;     No property
  defined&lt;br /&gt; &amp;lt;/#attempt&amp;gt;&lt;/p&gt;</summary>
    <dc:creator>Jeffrey Handa</dc:creator>
    <dc:date>2022-05-13T15:09:57Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: Commerce Categories Navigation Template and Key-Value Properties</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121422332" />
    <author>
      <name>Gennaro Lippiello</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121422332</id>
    <updated>2022-05-13T10:12:25Z</updated>
    <published>2022-05-13T10:12:24Z</published>
    <summary type="html">&lt;p&gt;Hello Jeffrey, following this example, if I dont have specified
  properties for a category I get this error:&lt;/p&gt;
&lt;p&gt;NoSuchCategoryPropertyException: No AssetCategoryProperty exists with
  the key {categoryId=40816, key=esenzione}&lt;/p&gt;</summary>
    <dc:creator>Gennaro Lippiello</dc:creator>
    <dc:date>2022-05-13T10:12:24Z</dc:date>
  </entry>
  <entry>
    <title>RE: Commerce Categories Navigation Template and Key-Value Properties</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121421469" />
    <author>
      <name>Jeffrey Handa</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121421469</id>
    <updated>2022-05-11T19:04:04Z</updated>
    <published>2022-05-11T19:04:04Z</published>
    <summary type="html">&lt;p&gt;Hi Gennaro, &lt;/p&gt;
&lt;p&gt;You'll need to use the servicelocator to get the
  AssetCategoryPropertyLocalService
  (com.liferay.asset.category.property.service.AssetCategoryPropertyLocalService). 
  That service has a getCategoryProperty that should get you what you
  need.  You can find a quick example here:  https://gist.github.com/jhanda/aa997c302f9f1ad99ee2e62fa07cd8a8.  &lt;/p&gt;</summary>
    <dc:creator>Jeffrey Handa</dc:creator>
    <dc:date>2022-05-11T19:04:04Z</dc:date>
  </entry>
  <entry>
    <title>Commerce Categories Navigation Template and Key-Value Properties</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121416398" />
    <author>
      <name>Gennaro Lippiello</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121416398</id>
    <updated>2022-05-06T13:23:32Z</updated>
    <published>2022-05-06T13:23:31Z</published>
    <summary type="html">&lt;p&gt;Hello. I have a custom Commerce Categories Navigation Template and I
  want to get the category key-value properties. &lt;/p&gt;
&lt;p&gt;How can I do that?&lt;/p&gt;
&lt;p&gt;
  &lt;img alt="" src="/documents/14/0/Immagine+%284%29.png/cd4ebada-1f5d-6642-a3e8-389fc6f9f6ca?t=1651843397762&amp;amp;imagePreview=1" /&gt;
  &lt;br /&gt;  &lt;/p&gt;</summary>
    <dc:creator>Gennaro Lippiello</dc:creator>
    <dc:date>2022-05-06T13:23:31Z</dc:date>
  </entry>
</feed>
