Copied to clipboard

Flag this post as spam?

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


  • Mark W. Nielsen 13 posts 33 karma points
    Aug 09, 2011 @ 08:46
    Mark W. Nielsen
    0

    Download list based on a folder in the media section

    Hello all you Umbraco-holics :P

    I'm hoping that some of you might can help me with a small(read: huge) issue i got. I'm still pretty new to Umbraco and the entire XSLT world.

    I got a folder in my media section of my Umbraco site. Inside that folder i got 3 sub-folders, and its within thoose 3 folders i got the files i want to display in the download list. Here's a view of my document structure:

    Download

    -- Newsletters

    ---- Newsletter 1

    ---- Newsletter 2

    ---- Newsletter 3

    -- Pictures

    ---- Picture 1

    ---- Picture 2

    -- Manuals

    ---- Manual 1

    ---- Manual 2

    ---- Manual 3

     

    What i was to show is:

    <h3>Newsletters</h3>

    <ul>

    <li>Newsletter 1</li>

    <li>Newsletter 2</li>

    </ul>

    <h3>Pictures</h3>

    You know what i mean the rest of the way.

     

    But there is 1 more thing. I need to change the display depending on what the parent folder is called. So if its the newsletter list i want 1 kind of display, if its pictures i want another.

     

    I hope you undestand what i mean by all this, and that your able to help me.

     

    Regards,
    Mark W. Nielsen

  • Rich Green 2246 posts 4008 karma points
    Aug 09, 2011 @ 10:30
    Rich Green
    0

    Hey Mark,

    Make 4 different doctypes:

    - Newsletter Folder

    - Newsletter

    - Picture Folder

    - Picture

     

    The allow 'Newsletter' under 'Newsletter Folder' and allow 'Picture' under 'Picture Folder'

    Add two xslt files, when you add them choose the 'List Sub Pages from Current Page' template, place one on your Newsletter folder template and one on your  Picture folder template.

    Change the your markup in the XSLT depending on which template it's in (basically if it's a picture or newsletter)

    You really only need one XSLT file but this will get you started I hope.

    Rich

     

  • Mark W. Nielsen 13 posts 33 karma points
    Aug 09, 2011 @ 11:01
    Mark W. Nielsen
    0

    Well, i can see where you going with this. But i would be REALLY happy if I could avoid creating a seperate page for each file i want to add to the download list. Thats why i wanted to make it all from the media section of the website. So i could just create a folder, and then add all the items to that folder. Make 1 macro, and put it on the Download page.

  • Rich Green 2246 posts 4008 karma points
    Aug 09, 2011 @ 11:11
    Rich Green
    0

    Hey Mark,

    Sorry, totally misread your post!

    I would have a look at this package http://our.umbraco.org/projects/website-utilities/media-iterator and tweak it as you need to.

    Regards

    Rich

     

     

     

  • Mark W. Nielsen 13 posts 33 karma points
    Aug 09, 2011 @ 14:45
    Mark W. Nielsen
    0

    Thats alot Rick! Wan't what i was looking for, but 10% better than what i wanted! :)

Please Sign in or register to post replies

Write your reply to:

Draft