Copied to clipboard

Flag this post as spam?

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


  • maanehunden 61 posts 105 karma points
    Apr 13, 2012 @ 08:57
    maanehunden
    0

    How to get at Media NodeTypeAlias field

    Hi fellow umbracians 

    I am trying to filter out sertan media –nodes from my media library by using media-nodetype alias, but it seems that the media object doesn’t have such a member.


    Here’s a parallel example using nodes from content.

    string alias = “news”;
    Node parent = new Node(some id);
    Node result = parent.ChildrenAsList.Where(x => x.NodeTypeAlias == alias).FirstOrDefault();

    Is it possible to do something similar using Media object.

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Apr 13, 2012 @ 10:52
    Hendy Racher
    0

    Hi Maanehunden,

    To get the alias of a media item you can use:

    media.ContentType.Alias

    HTH,

    Hendy

  • maanehunden 61 posts 105 karma points
    Apr 13, 2012 @ 12:59
    maanehunden
    0

    Good heavens,..  that did the trick,.  

    Tnx Hendy

Please Sign in or register to post replies

Write your reply to:

Draft