liferay-taglibs

Guides selection, verification, and creation of Liferay JSP taglibs and FreeMarker macros.

Updated Jul 24, 2026
One-click install
npx skills add https://github.com/gweone/agent-plugins --skill liferay-taglibs-gweone
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: liferay-taglibs
Source: https://github.com/gweone/agent-plugins/tree/main/plugin/sharpps-liferay/skills/liferay-taglibs
Command: npx skills add https://github.com/gweone/agent-plugins --skill liferay-taglibs-gweone

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers working in Liferay JSP and FreeMarker files often guess tag names, misuse JSP-only syntax in FTL templates, or hand-write HTML that an existing Clay or liferay-ui tag already covers, leading to compile errors, deprecated markup, and inconsistent UI. ## Core Features & Use Cases - Taglib Reference and Selection: Maps JSP prefixes (aui, liferay-ui, clay, portlet) and FTL namespaces (clay, liferay_aui, liferay_ui) to their .tld sources, with guidance on which library fits each UI need. - Verification Workflows: Provides grep and curl commands against the liferay-portal source and live theme CSS to confirm a tag, macro, or CSS class exists before using it. - Custom Taglib Creation: Covers building a custom JSP taglib from scratch, registering it for FTL via taglib-mappings.properties, mounting React components from tags, and extending built-in taglibs through composition. - Use Case: When converting hand-written HTML in a .jsp or .ftl display template to proper Clay tags, use this Skill to pick the right tag, avoid Jasper attribute-parsing pitfalls, and verify the tag is not deprecated. ## Quick Start Ask which Liferay taglib or FTL macro to use for a specific UI element in your .jsp or .ftl file, or how to build and register a custom taglib.

Frequently Asked Questions about liferay-taglibs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use Liferay taglibs in a FreeMarker display template?

FTL files cannot use JSP taglib declarations. Use the pre-bound clay and liferay namespaces directly, such as <@clay.icon symbol="trash" />, or bridged aliases like liferay_aui and liferay_ui defined in each bundle's taglib-mappings.properties file.

What is the difference between aui, liferay-ui, and clay taglibs?

The aui taglib covers form inputs and scripts but many tags are deprecated since 7.4. liferay-ui provides search containers, messages, and icons. clay provides Lexicon components like buttons, labels, and dropdowns and is the preferred modern choice.

How do I verify a Liferay tag or Clay macro exists before using it?

Grep the .tld files in the liferay-portal source for the tag name and check its backing Java class for @deprecated annotations. For CSS classes, fetch the live theme's compiled clay.css and grep it rather than trusting SCSS source.

Why does my JSP fail to compile when nesting a tag inside a custom tag attribute?

Jasper treats a custom tag's attribute value as a plain string or single scriptlet expression, so nested tag calls like <portlet:namespace/> are not evaluated. Use a scriptlet expression such as <%= liferayPortletResponse.getNamespace() + "foo" %> instead.

Can I add a new tag to the built-in liferay-ui or clay taglib?

No, built-in .tld files ship with core modules and are not merge-extensible. Instead subclass the base tag class, declare it in your own .tld with your own prefix, and optionally register it for FTL via taglib-mappings.properties.

How do I make a custom Liferay taglib available in FTL templates?

Add a Provide-Capability header for the jsp.taglib extender in bnd.bnd for JSP use, and create META-INF/taglib-mappings.properties mapping your FTL alias to the .tld path. Both registrations are independent and both are required.