General - .NET User Groups General issues with editing, development and graphic design.
Kentico CMS for .NET User Groups > General - .NET User Groups > Retrieving Tag names instead of Tag IDs(tagid)? View modes: 
User avatar
Guest
support-internetgeeks.co - 7/7/2009 4:19:49 AM
   
Retrieving Tag names instead of Tag IDs(tagid)?
Hi,

The tagcloud webpart posts back the tagid of the tag you click on, but this is a number. I'd like the tagname instead so I can display it at the top of the page as the page heading.

Does anybody know of a simple solution?

Thanks

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 7/7/2009 6:48:17 AM
   
RE:Retrieving Tag names instead of Tag IDs(tagid)?
Hi,

There is “Querystring parameter name:” property in tag could web part. You can change it according your need for example to tagname. Then you can also modify ~\CMSWebParts\TaggingCategories\TagCloud.ascx.cs where you can change following line (about 431):

sb.Append("<span><a href=\"" + paramUrl + "\" style=\"font-size:" + pixelSize.ToString() + "px;\" >" + HTMLHelper.HTMLEncode(dr["TagID"].ToString()) + "</a></span>\n");

to:

sb.Append("<span><a href=\"" + paramUrl + "\" style=\"font-size:" + pixelSize.ToString() + "px;\" >" + HTMLHelper.HTMLEncode(dr["TagName"].ToString()) + "</a></span>\n");

In this way the links generated by this web part will be in following format:

http://localhost/40/cmsgetdoc/f22a42a2-4b95-4af4-92a4-12db71fa9dd3/Tag-cloud.aspx?tagname=WXGA

I hope it will help you to achieve your needs.

Best Regards,
Miroslav Remias