Copied to clipboard

Flag this post as spam?

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


  • Tim Spanoudakis 2 posts 22 karma points
    Jul 10, 2014 @ 15:03
    Tim Spanoudakis
    0

    umbraco 7 razor for document library solution

    I have a macro partial that I am trying to create. I am an umbraco newbie. I have a folder in media with sunflowers . I would like to display a list of files from each sunflower based on the name of the page that the user is on. This name corresponds to the folder name in the library.

    I can list files from the folder but cannot seem to filter using a where clause

    @inherits Umbraco.Web.Macros.PartialViewMacroPage

    <h2>@CurrentPage.title</h2>
    @{
      var gallery = new umbraco.MacroEngines.DynamicMedia(1124);
    }
     @foreach (dynamic item in gallery.Descendants())
     {
    
                <a href="@item.File" target=_blank>@item.title</a><br/>
                @item.synopsis <br/>
    
      }

    What I want to do is restrict the list based on the folder name by taking the

    @CurrentPage.title and feeding that to the list. Also to filter by file date.

    Am I approaching this in the correct way?

Please Sign in or register to post replies

Write your reply to:

Draft