Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jacob Polden 67 posts 177 karma points
    Sep 30, 2013 @ 16:51
    Jacob Polden
    0

    How to test the tag group on a content node

    Having an issue with the "Tags" datatype in Umbraco. I am using the GetNodesWithTags method to return all the nodes with the relevant tags. That's great. However I have multiple Tags datatypes which sometimes have the same tags.

    What I ideally want is some sort of test to check the group of tags property on the document type. Is there anyway to do this. See code:

     

    var matchingNodes = Tag.GetNodesWithTags(searchFor).ToList();

    <ul>

          @foreach (var node in matchingNodes)

          {

            dynamic dn = new DynamicNode(node.Id);

        if(dn.Tags.Group == "TDNewsEventsTags") // This what I would ideally want to work. However .Tags returns a string so it doesn't work

    {

            <li><a href="@dn.Url">@dn.Name</a></li>

    }

          }

          </ul>

     

    Any help would be greatly appreciated :)

    Jacob

Please Sign in or register to post replies

Write your reply to:

Draft