Copied to clipboard

Flag this post as spam?

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


  • Bert 128 posts 251 karma points
    Apr 21, 2009 @ 16:07
    Bert
    0

    Load Media Item From Child Page

    Document types:
    - overview page (no extra properties)
    - child page: (richtext fulltext, richtext introduction, mediapicker picture)

    Document layout:
    - overview page
    -- child page

    Goal:
    Show a small introduction and picture of all the child pages on the overview page.

    [code]

    [/code]


    this code gives an error @


    Would like to know how to get the image from the childpage media picker.

  • Daniel Lindstrom 454 posts 271 karma points
    Apr 21, 2009 @ 16:47
    Daniel Lindstrom
    0

    Is the error reported when saving the xslt , or on the front end?

    If the problem arises when saving:
    Try skipping testing when saving the xslt. There is a checkbox for that.

    For a more permanent fix do like this:



    Notice the if test around the img tag.

    GetMedia fails if there is no media id supplied, and when testing on save it is tested against a fake xml doc that may not contain that property.

  • Bert 128 posts 251 karma points
    Apr 21, 2009 @ 17:16
    Bert
    0

    The error was while saving so your solution worked.

    Aha didn't know the tester tested against a fake xml doc.
    Feel stupid I never tried to save while skipping errors :)

    Thanks for the quick help!

    +1 to my Umbraco experience points ^^

  • 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