Fórumok

How to use Category Selection from Add Web Content?

thumbnail
Christian Schulze, módosítva 12 év-val korábban

How to use Category Selection from Add Web Content?

Junior Member Bejegyzések: 87 Csatlakozás dátuma: 2009.11.19. Legújabb bejegyzések
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
Mayur Patel, módosítva 12 év-val korábban

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

Expert Bejegyzések: 358 Csatlakozás dátuma: 2010.11.17. Legújabb bejegyzések
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
Christian Schulze, módosítva 12 év-val korábban

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

Junior Member Bejegyzések: 87 Csatlakozás dátuma: 2009.11.19. Legújabb bejegyzések
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
Mayur Patel, módosítva 12 év-val korábban

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

Expert Bejegyzések: 358 Csatlakozás dátuma: 2010.11.17. Legújabb bejegyzések
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
Christian Schulze, módosítva 12 év-val korábban

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

Junior Member Bejegyzések: 87 Csatlakozás dátuma: 2009.11.19. Legújabb bejegyzések
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
Mayur Patel, módosítva 12 év-val korábban

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

Expert Bejegyzések: 358 Csatlakozás dátuma: 2010.11.17. Legújabb bejegyzések
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
Sagar A Vyas, módosítva 10 év-val korábban

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

Liferay Master Bejegyzések: 679 Csatlakozás dátuma: 2009.04.17. Legújabb bejegyzések
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
Mayur Patel, módosítva 10 év-val korábban

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

Expert Bejegyzések: 358 Csatlakozás dátuma: 2010.11.17. Legújabb bejegyzések
Thanks a lot Sagar emoticon
Javier Vera, módosítva 9 év-val korábban

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

New Member Bejegyzések: 18 Csatlakozás dátuma: 2014.08.01. Legújabb bejegyzések
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
Mayur Patel, módosítva 9 év-val korábban

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

Expert Bejegyzések: 358 Csatlakozás dátuma: 2010.11.17. Legújabb bejegyzések
Actually, I have removed the blog as it was not well formatted. I will post very soon here.

Thanks.
thumbnail
Mayur Patel, módosítva 9 év-val korábban

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

Expert Bejegyzések: 358 Csatlakozás dátuma: 2010.11.17. Legújabb bejegyzések
Sorry for the late reply.

Refer this blog

Thanks.