Peter
Peter

Reputation: 1

Displaying taxonomy on DotNetNuke Page

I've added tags to the pages on my dnn site and I would like to display a simple list of the tags that the page is assigned to at the bottom of the page.

I'm using DNN 6 and I've read that this is possible by adding some lines to the skin file. I've added

<%@ Register TagPrefix="dnn" TagName="TAGS" Src="~/Admin/Skins/Tags.ascx" %>

and <dnn:tags runat="server" id="dnnTags" /> as per online suggestions

When I view the page there are no tags, and in the source the only thing outputted is an empty div <div class="horizontal"></div> This does suggest that the tags.acsx is being called ok

I thought maybe tags weren't working, but when I put a ContentList module on the page and visit the page with ?Tag=test appended to the link it does pick up all the pages and modules with that tag, including the page I am testing.

Has anyone experienced anything like this before?

Thanks


I've now found that removing the below section of code from tags.ascx.cs allows the page to display the list of tags

 string resultsUrl = Null.NullString;
var objModules = new ModuleController();
int searchTabId = 0;
ModuleInfo SearchModule = objModules.GetModuleByDefinition(PortalSettings.PortalId, "Search Results");
if (SearchModule == null)
{
return;
}
else
{
searchTabId = SearchModule.TabID;
}

Upvotes: 0

Views: 648

Answers (1)

Mitchel Sellers
Mitchel Sellers

Reputation: 63126

There are two parts to the addition of the skin object. Part 1

<%@ Register TagPrefix="dnn" TagName="TAGS" Src="~/Admin/Skins/Tags.ascx" %>

Then you need to actually add it to the page where you need it.

<dnn:TAGS id="mytags" runat="server" />

Upvotes: 1

Related Questions