Copied to clipboard

Flag this post as spam?

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


  • Pixelpushr 12 posts 34 karma points
    Mar 01, 2014 @ 10:51
    Pixelpushr
    0

    Getting images from a child page

    In the past Ive always setup image galleries by just adding the media to the media library and writing some code to just point at the folder.

    Now what I want to do is setup images beneath the homepage like below :

    Each "slide" has an media picker and a richtext editor which im going to use as a place for detailed captions over the image.

    My current code is this:

    :

    Whats the 'best' practice to get the image ("galleryImage") displaying here?

    Thanks

  • Fuji Kusaka 2203 posts 4220 karma points
    Mar 01, 2014 @ 13:30
    Fuji Kusaka
    0

    Hi,

    What i usually do is have a my slides unde the media section. Some of them do have captions as you mentioned, so in this situation i usually create a new Media Type  under settings. Then add  all the fields that i might be using to make my slides e.g RTE if needed.

    Here what are you planning to do ? Do you want to display slides on every single page or only on the homepage ?

    If only the homepage i would be doig this in my Home Template.

    var slide = Mode.MediaById(1234);
    var folder= slide.Children;
    if(slide>1) {
    foreach(var  s in folder) {
    @s.Name 
    }
     }

     

  • Pixelpushr 12 posts 34 karma points
    Mar 01, 2014 @ 16:09
    Pixelpushr
    0

    That gallery is just for the homepage, and I literally just need the url to the image. Cant seem to get umbracoFile to work

  • Fuji Kusaka 2203 posts 4220 karma points
    Mar 01, 2014 @ 16:55
    Fuji Kusaka
    0

    Well if its only for the homepage then you can either do it as i mentioned or another way would be by adding a folde under the homepage node then just add all images.

    Can you post your code we have a look ?

  • Pixelpushr 12 posts 34 karma points
    Mar 01, 2014 @ 19:00
    Pixelpushr
    0

    It doesnt matter I've done it a different way, and Id posted my code above already in the first post!

    how do you delete a thread

Please Sign in or register to post replies

Write your reply to:

Draft