Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-31202

Allow <aui:input> to set default values for tags and categories

Details

    • Feature Request
    • Status: Completed
    • Minor
    • Resolution: Implemented in Platform
    • 6.1.1 CE GA2, 6.1.20 EE GA2, 6.2.0 CE M3
    • None
    • None
    • Accept

    Description

      Liferay Portal does not allow to set default values for tags and categories when using <aui:input>. You can easily allow this by adding these lines:

      'curCategoryIds="<%= (String) value %>"' at https://github.com/liferay/liferay-portal/blob/master/portal-web/docroot/html/taglib/aui/input/page.jsp#L52
      'curTags="<%= (String) value %>"' at https://github.com/liferay/liferay-portal/blob/master/portal-web/docroot/html/taglib/aui/input/page.jsp#L60

      After this change one can for example hook https://github.com/liferay/liferay-portal/blob/master/portal-web/docroot/html/portlet/document_library/edit_file_entry.jsp#L377,L379 and https://github.com/liferay/liferay-portal/blob/master/portal-web/docroot/html/portlet/document_library/upload_multiple_file_entries_resources.jsp#L232,L234 and add a default value to the <aui:input> tags.

      Example:
      <aui:input classPK="<%= assetClassPK %>" model="<%= DLFileEntry.class %>" name="categories" type="assetCategories" value="20305,20307" /> <%-- Adds the default categories with the categoryIds 20305 and 20307 --%>
      <aui:input classPK="<%= assetClassPK %>" model="<%= DLFileEntry.class %>" name="tags" type="assetTags" value="My Tag 1, My Tag 2" /><%-- Adds the default tags "My Tag 1" and "My Tag 2" --%>

      I'm using it to set default values for documents depending on the folder it's created in.

      Attachments

        Activity

          People

            jonathan.mak Jonathan Mak (Inactive)
            mod David Kubitza (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Packages

                Version Package