掲示板

How to use Category Selection from Add Web Content?

thumbnail
12年前 に Christian Schulze によって更新されました。

How to use Category Selection from Add Web Content?

Junior Member 投稿: 87 参加年月日: 09/11/19 最新の投稿
Hello,
I want to use the Selection of Categories which I see in the Create New Web Content view. All I found was this in edit_view.jsp inside portal-web/docroot/html/portlet/journal :

<aui:input classPK="<%= classPK %>" name="categories" type="assetCategories" />


But that didn't work, because I miss some js-Code or Scripplet to generate the Tree or so.

How can't I get a Category-Tree and the need js-Dialog to select it?

regards
Chris
thumbnail
12年前 に Mayur Patel によって更新されました。

RE: How to use Category Selection from Add Web Content?

Expert 投稿: 358 参加年月日: 10/11/17 最新の投稿
Hi Christian,

That is very interesting !!!

If you want to use that in custom portlet then you can directly use <liferay-ui:asset-categories-selector> tag in custom portlet

<aui:input classPK="<%= classPK %>" name="categories" type="assetCategories" />


This will go in to the Page.jsp inside /portal-web/docroot/html/taglib/aui/input/page.jsp and that will check for type assetCategories

    <c:when test="<%= (model != null) &amp;&amp; type.equals(&quot;assetCategories&quot;) %>">
		<liferay-ui:asset-categories-selector className="<%= model.getName() %>" classPK="<%= _getClassPK(bean, classPK) %>" contentCallback="<%= portletResponse.getNamespace() + &quot;getSuggestionsContent&quot; %>" />
	</c:when>


Take a look at logic of asset-categories-selector also /portal-web/docroot/html/taglib/ui/asset_categories_selector/page.jsp,

The tag <liferay-ui:asset-categories-selector> uses
AssetCategoryServiceUtil.getCategories(className, classPK) to get the list of categories and populates the curCategoryIds from this list.

You can refer the same in my blog

See Asset Framework also.

Thanks,
Mayur
thumbnail
12年前 に Christian Schulze によって更新されました。

RE: How to use Category Selection from Add Web Content?

Junior Member 投稿: 87 参加年月日: 09/11/19 最新の投稿
Thanks, thats very helpfull.

But one question remain, it is possible to set the Focus to one AssetVocabulary? In this example I see all Vocabularys.

regards
Chris
thumbnail
12年前 に Mayur Patel によって更新されました。

RE: How to use Category Selection from Add Web Content?

Expert 投稿: 358 参加年月日: 10/11/17 最新の投稿
Thanks for reply,

Thats right, you can focus on asset-vocabulary.

<liferay-ui:asset-categories-selector curCategoryIds="<%= Validator.isNull(vManag) ? &quot;&quot; : categoryIds %>" />

Here,
categoryIds - set category Ids for which you want set Focus for particular items if its empty then it will not focus any items

For that Particular content you may be storing CategoryIds in Database, so you need to fetch all Ids for that particular content and set it here

Tell me if you can face any other Issues emoticon

Regards,
Mayur
thumbnail
12年前 に Christian Schulze によって更新されました。

RE: How to use Category Selection from Add Web Content?

Junior Member 投稿: 87 参加年月日: 09/11/19 最新の投稿
I think we speak about different things.

In your blog I see only that you select the currentCategoryIds with this.
But I need to Focus on an exact AssetVocabulary in the Select-Dialog, so that there are only the AssetCategory under this exact AssetVocabulary.
thumbnail
12年前 に Mayur Patel によって更新されました。

RE: How to use Category Selection from Add Web Content?

Expert 投稿: 358 参加年月日: 10/11/17 最新の投稿
I'm not sure about that,I cant find any other attributes which focus AssetVocabulary,
May be you need to do some coding and you need to filter out curCategoryIds for that particular AssetVocabulary and pass it.

If you have any other idea then you can share that will be great !!!
thumbnail
10年前 に Sagar A Vyas によって更新されました。

RE: How to use Category Selection from Add Web Content?

Liferay Master 投稿: 679 参加年月日: 09/04/17 最新の投稿
Mayur Patel:
Hi Christian,

That is very interesting !!!

If you want to use that in custom portlet then you can directly use <liferay-ui:asset-categories-selector> tag in custom portlet

<aui:input classPK="<%= classPK %>" name="categories" type="assetCategories" />


This will go in to the Page.jsp inside /portal-web/docroot/html/taglib/aui/input/page.jsp and that will check for type assetCategories

    <c:when test="<%= (model != null) &amp;&amp; type.equals(&quot;assetCategories&quot;) %>">
		<liferay-ui:asset-categories-selector className="<%= model.getName() %>" classPK="<%= _getClassPK(bean, classPK) %>" contentCallback="<%= portletResponse.getNamespace() + &quot;getSuggestionsContent&quot; %>" />
	</c:when>


Take a look at logic of asset-categories-selector also /portal-web/docroot/html/taglib/ui/asset_categories_selector/page.jsp,

The tag <liferay-ui:asset-categories-selector> uses
AssetCategoryServiceUtil.getCategories(className, classPK) to get the list of categories and populates the curCategoryIds from this list.

Refer this to implement Asset Category Functionality in your portlet,

See Asset Framework also.

Thanks,
Mayur



Thanks Mayur your input is really helps lot.

Nice detailed forum .Good Job.

Thanks,
Sagar Vyas
thumbnail
10年前 に Mayur Patel によって更新されました。

RE: How to use Category Selection from Add Web Content?

Expert 投稿: 358 参加年月日: 10/11/17 最新の投稿
Thanks a lot Sagar emoticon
9年前 に Javier Vera によって更新されました。

RE: How to use Category Selection from Add Web Content?

New Member 投稿: 18 参加年月日: 14/08/01 最新の投稿
Mayur Patel:
Thanks a lot Sagar emoticon



hey, its been quite a long time since someone seems to have googled this question. i wonder where is your blog? i saw your name all over the net about Liferay however your blog is empty. You gone mad about Liferay? emoticon
peace
thumbnail
9年前 に Mayur Patel によって更新されました。

RE: How to use Category Selection from Add Web Content?

Expert 投稿: 358 参加年月日: 10/11/17 最新の投稿
Actually, I have removed the blog as it was not well formatted. I will post very soon here.

Thanks.
thumbnail
9年前 に Mayur Patel によって更新されました。

RE: How to use Category Selection from Add Web Content?

Expert 投稿: 358 参加年月日: 10/11/17 最新の投稿
Sorry for the late reply.

Refer this blog

Thanks.