Taglib Description Guidelines

Important: This article has been moved and is no longer being actively maintained. The current version of Liferay's Taglibdoc Guidelines can be found on Github here.

We welcome you to contribute tag descriptions for Liferay's taglibs. Please follow these guidelines as you describe tags in Liferay's .tld files.

Please create an LRDOCS ticket for the description, with API issue type, and be sure to reference the ticket number in any commits you make.

You can commit your changes in a branch based on the master branch of https://github.com/liferay/liferay-portal. Then send a pull request to user liferay, making sure to mention Cody Hoag (GitHub handle: @codyhoag) so he can review your changes. In the pull request description, mention any other version of Liferay you'd like the changes to be ported to.

You must generate the API docs locally to verify the syntax is correct, before sending a pull request.

Start All <tag> descriptions with a verb.

Include a screenshot of the tag at the end of the tag's description for reference, if applicable.

For tags inside of the liferay-portal repo place the screenshot in the liferay-portal/util-taglib/src/META-INF/images/[taglib prefix] folder. Create the folder if it does not currently exist. Include the image in CDATA tags, pointing to the relative path of the image. For tags inside of a module repo, place the screenshot in the module-name/module-name-taglib/src/main/tlddoc/images folder. You will need to create the tlddoc and images directories. The relative path would then be ../images/screenshot.png. The size of the image should be just enough to render the UI element.

Liferay Portal Repo Example:

<description>Creates a tabbed UI of section dividers that each house their own content.<![CDATA[<br /><br />Example:<br /><img src="../images/liferay-ui/tabs.png"/>]]></description>

How to Generate Taglib API Docs Locally

Navigate to the liferay-portal/util-taglib directory in the command line and run `ant taglibdoc`. The docs will be generated in your liferay-portal/api/taglibs directory. Open index.html to view the docs.

Generate taglib docs for Liferay Portal core tags:

ant taglibdoc

Use the Gradle tlddoc task to build taglib docs for modules

Navigate to the liferay-portal/modules/apps/module-name/module-name-taglib directory in the command line and run `../../../../gradlew tlddoc`. The docs will be generated in your module-name-taglib/build/docs/tlddoc directory. Open index.html to view the docs.

Generate taglib docs for modules:

../../../../gradlew tlddoc

How to Generate Taglib Jars Locally

Use the Gradle jarTlddoc task to generate jar files for your modules

Navigate to the liferay-portal/modules/apps/module-name/module-name-taglib directory in the command line and run `../../../../gradlew jarTlddoc`. The `com.liferay.modulename.taglib-version-taglibdoc.jar` file will be generated in your liferay-portal/tools/sdk/dist directory, containing the docs information, along with any images you included as well.