selectliferayportletdocuments

Preselect category filter in LIferay Documents and Media Portlet


I want to set a specific category as selected when creating new document in Documents and media portlet. I only have the category Id passed as parameter in the url. Any idea how to do this?


Solution

  • You can do this using parameter assetCategoryIds. In url this parameter might look like _20_assetCategoryIds_22902 and _20_ is a portlet namespace (Documents and Media) and _22902 is your vocabulary id.

    Example url:

    http://localhost:8080/web/guest/home?p_p_id=20&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=column-2&p_p_col_count=2&_20_repositoryId=20182&_20_fileEntryTypeId=0&_20_cmd=add&_20_struts_action=%2Fdocument_library%2Fedit_file_entry&_20_folderId=0&_20_assetCategoryIds_22902=22904