Copied to clipboard

Flag this post as spam?

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


  • Morten 1 post 21 karma points
    Apr 25, 2012 @ 23:34
    Morten
    0

    Newbie question about queries in Umbraco 5

    Hi There,

    Hoping one of you are able to help me out here.

    I've modified the "Image" Media Type to contain tags, and have uploaded a few pictures and tagged them in a folder.

    I've created a property called mediafolder on my "photos" template and pointed that to the above mentioned folder.

    I can get the folder and the images in it, but can't seem to filter the returned list by a given tag.

    this is the code I have on my template:

     

    var mediaFolderProperty = CurrentPage.mediaFolder;

    var mediaFolder = Umbraco.GetDynamicContentById(mediaFolderProperty);

    var mediaItems = mediaFolder.Children;

    foreach (var mediaItem in mediaItems)

    {

            @mediaItem.Name

    }

     

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies