Hi Amit,
How about copying the photo upload mechanism from Contacts? That's by far the
quickest way to get category icons.
Add the image control:
1. Copy /modules/data/dialogs/contact/personalTab/photo to
/modules/data/dialogs/category/mainTab.
2. Rename the copied node to "icon".
3. Edit some categories to add icons to them.
Render icons next to category labels:
1. Edit the categoryCloud.ft paragraph script. It's in the Categorization
module JAR but you can test this out by creating a template in resources and
referencing it from the paragraph definition instead.
2. Assign icons to categories.
[#assign itemLevel = item.level]
[#assign itemLink = model.getCategoryLink(itemName)!]
[#assign itemIcon = item.icon!]
3. Render.
<li class="${itemLevel}">
[#if item.icon?exists]
<img src="${stk.createImageLink(itemIcon)}" />
[/#if]
<a href="${itemLink}" >${itemDisplayName}</a>
</li>
If you prefer a DAM control:
1. Copy a DAM control from
/modules/standard-templating-kit/dialogs/generic/controls/tabImage/image.
2. Rename to "iconDMS".
3. Upload some icons into DMS and browse to them from categories with the new
DAM control.
4. In paragraph script, assign.
[#assign itemIcon = item.iconDMS!]
5. Render.
[#if item.iconDMS?exists]
<img src="${stk.getAssetLink(item, 'iconDMS')}" />
[/#if]
--Antti
On Mar 15, 2011, at 3:44 PM, Magnolia Forums (on behalf of Amit Patel) wrote:
>
> Hi,
>
> I want to assign different image icons for different category. How can I do
> that. I found dialog in Config/modules/data/dialog under Data module in Admin
> Central. Can I add DMS control here to get image? If yes then how should I
> export and bootstrap the bundle?
>
> Thanks & Regards,
> Amit Patel
>
> --
> Context is everything:
> http://forum.magnolia-cms.com/forum/thread.html?threadId=6893847a-092e-4e6c-a45d-99437b7a5c45
>
>
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------