RE: Using Clay taglib for Clay components from ADT

thumbnail
Aritz Galdos, modified 6 Years ago. Expert Posts: 416 Join Date: 5/15/07 Recent Posts
Hi community

What would be the correct way to render clay components from a Freemarker template?

Can I use the clay taglib from within a Freemarker template? How?

​​​​​​​Regards!
thumbnail
Aritz Galdos, modified 6 Years ago. Expert Posts: 416 Join Date: 5/15/07 Recent Posts
All right.. the answare was in the online doc

https://dev.liferay.com/es/develop/tutorials/-/knowledge_base/7-1/using-the-clay-taglib-in-your-portlets
​​​​​​​

The Liferay Clay taglib is also available via a macro for your FreeMarker theme templates and web content templates. Follow this syntax:
[code]<@clay["tag-name"] attribute="string value" attribute=10 />
Yannik Horndt, modified 5 Years ago. New Member Posts: 9 Join Date: 1/31/19 Recent Posts
Although being totally correct, it threw me off as to why you had the "\[code\]" tag in front of it. But realizing after a minute that it's probably some sort of forum mishap that this is still shown.

I wanted to give an example as to how I used it in a freemarker template in DXP 7.2.
<@clay["icon"] symbol="angle-down" />


I think that the Liferay space is overflowing with information, and although there have been improvements to the documentation from the side of the organisation, there's still a lot to be done, so I try to add snippets that I've used to relevant topics, because often, that's what I needed when searching for an answer.

(I know that this is a year old post) But thanks for posting the answer to your own question, this is very helpful to people searching the same thing and double frustrating if the op just writes "Never mind, found the answer" but doesn't post the answer ;).
thumbnail
Satyanarayana kolliboyin, modified 5 Years ago. Junior Member Posts: 26 Join Date: 6/23/10 Recent Posts
I wanted to give an example as to how I used it in a freemarker template in DXP 7.2.
<@clay["icon"] symbol="angle-down" />
In my case under page fragments need to use with square brackets instead of less than and greather than symbols.
Example 1: [@clay["icon"] symbol="angle-down" /]
Example 2: <a class="text-black"
    href="http://www.facebook.com/pages/Liferay/45119213107" 
    target="_blank">
      <span class="hide">Facebook</span>
      [@clay["icon"] symbol="social-facebook" /]
    </a>