Displaying tags in Tag cloud web part from another site

This articles describes the configuration of the web parts if you want to display tags in Tag cloud web part from another site within the same instance of Kentico CMS.
You need to set the Site name to appropriate site name and Alias path under it to the path from where the tags should be obtained (you should use “/%” at the end of the path, so all tags underneath are selected). The drop down list for Tag group name should be set to "none". Document list URL property is not mandatory at this moment. With these settings are the tags from specified alias path and site displayed fine.

Now, you need to modify the Document list URL property in code, so the URL will point to the second site.
Please open this file: ~\CMSWebParts\TaggingCategories\TagCloud.ascx.cs and about line 400 should be this code:

// Base URL of the links
string url;
if (String.IsNullOrEmpty(this.DocumentListURL))
url = UrlHelper.CurrentURL;
url = CMSContext.GetUrl(this.DocumentListURL);

You can see that there is used current URL or the setting from the document list URL property - right now there is no information about the other site. So, you can e.g. change it to text box in the web part’s properties configuration in Site Manager -> Development -> Web parts, so in the web part configuration you can add the whole URL or with more modification you can use relative paths.

See also: Modifying the code of standard web parts

Applies to: Kentico CMS 4.0
Share this article on   LinkedIn

Juraj Ondrus

Hi, I am the Technical support leader at Kentico. I'm here to help you use Kentico and get as much as possible out of it.