Tags version 0.2 released for EPiServer CMS

Posted on September 5, 2011 by Frederik Vig in EPiServer

I’ve done a few updates to the Tags module for EPiServer CMS. The major change is that it’s now using the page’s PageGuid instead of PageLink (PageReference). This guaranties that the reference to the page will be correct, even when used with mirroring.

The other updates I’ve done is added a scheduled job that cleans up and check’s that the tagged pages still exist and that they still have their tag. You’ll need to manually set this up in admin mode. Depending on the size of the site I’ll usually set this to 30 minutes. The job goes through all pages that have a tag and validates them.

Tags maintenance job in EPiServer admin mode

I’ve also implemented the TagEngine. This is a very first version so expect a few updates here soon. Here’s ITagEngine.cs

using System.Collections.Generic;
using EPiServer.Core;
using Geta.Tags.Models;
 
namespace Geta.Tags.Interfaces
{
    public interface ITagEngine
    {
        PageDataCollection GetPagesByTag(string tagName);
        PageDataCollection GetPagesByTag(Tag tag);
        PageDataCollection GetPagesByTag(string tagName, PageReference rootPageReference);
        PageDataCollection GetPagesByTag(Tag tag, PageReference rootPageReference);
        IEnumerable<PageReference> GetPageReferencesByTags(string tagNames);
        IEnumerable<PageReference> GetPageReferencesByTags(IEnumerable<Tag> tags);
        IEnumerable<PageReference> GetPageReferencesByTags(string tagNames, PageReference rootPageReference);
        IEnumerable<PageReference> GetPageReferencesByTags(IEnumerable<Tag> tags, PageReference rootPageReference);
    }
}

You’ll of course find Tags for EPiServer CMS on nuget.episerver.com. Go and give it a try – please let me know how things go and if you have any feedback, leave a comment, tweet me or send me an email.

Related Posts: