Copied to clipboard

Flag this post as spam?

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


  • Martyn 4 posts 24 karma points
    Aug 08, 2012 @ 08:15
    Martyn
    0

    Upload and List Documents

    Hi there,

    I am using Umbraco 4.7.2 SQL2008

    I wish to upload and display a list of documents/media files on a product details page.

    Admin user would upload one or more documents for a product

    Visitor would see those documents displayed in a list with ability to click and download

    Thanks!
    Martyn

  • Ben Norman 167 posts 276 karma points
    Aug 15, 2012 @ 00:27
    Ben Norman
    0

    Here is a razor script called ImageGallery that I wrote last night.

    @using umbraco.MacroEngines
    @foreach (var item in Model.MediaById(Model.RelatedMedia).Children)
    {
      <p><img src="@item.umbracoFile" alt="@item.Name" /></p>
    }

    How it works is as follows:

    Place a Media Picker Property on the Document Type for the page called RelatedMedia that will show the image gallery.

    Create a Folder in the Media Section and add your images to it.

    Then update the Related Media Property and open the browser to the url for the page to test it.

Please Sign in or register to post replies

Write your reply to:

Draft