Copied to clipboard

Flag this post as spam?

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


  • Garry Bain 149 posts 124 karma points
    Mar 17, 2009 @ 11:11
    Garry Bain
    0

    Passing parameter back into XSLT

    Hi everyone,

    I have a macro that lists news items (as shown on umbraco.tv) - the problem is, that I need the user to be able to associate an image with the news article, which then displays inside the macro that lists all the news items - so you have a small image for every article.

    The output should look like this:
    [code]

    News Headline





    Teaser goes here



    News Headline 2





    Teaser goes here

    [/code]

    Does anyone know how to pass the parameter for the mediaCurrent back into the news list macro that lists all of the articles?

    Cheers, Garry.

  • Tommy Poulsen 514 posts 708 karma points
    Mar 17, 2009 @ 11:47
  • Garry Bain 149 posts 124 karma points
    Mar 17, 2009 @ 12:00
    Garry Bain
    0

    Hi tommy,

    thanks for the reply but I don't think this will work, as I am inserting the code into an XSLT file that lists news items and not inserting a macro into a template - here is my code if it makes it any clearer:

    [code]
    ]>

    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    exclude-result-prefixes="msxml umbraco.library">






















    [/code]

    EDIT:

    I have simply tried to use

    and this gives the ID of my image node - not sure if this can be fixed to grab the image or not?

    EDIT:

    Sorry I accidentally said "and inserting a macro into a template" above instead of "and NOT inserting a macro..." sorry about that!

  • Tommy Poulsen 514 posts 708 karma points
    Mar 17, 2009 @ 12:09
    Tommy Poulsen
    0

    To access media nodes you would probably want to use something like this (gets the filename):

    [quote]

    [/quote]

    Tommy

  • Garry Bain 149 posts 124 karma points
    Mar 17, 2009 @ 12:13
    Garry Bain
    0

    Cheers Tommy, do you have any idea how you can embed this into html:

    XSLT obviously throws an error if you try to do an

    Thanks for getting me this far anyway,
    Garry.

  • rorythecheese 110 posts 56 karma points
    Mar 17, 2009 @ 12:39
    rorythecheese
    0

    If you save the image url to a variable like
    [code]

    [/code]

    then you can stick it in the like so
    [code]

    [/code]

  • Garry Bain 149 posts 124 karma points
    Mar 17, 2009 @ 12:48
    Garry Bain
    0

    Excellent, thanks very much guys much appreciated.

Please Sign in or register to post replies

Write your reply to:

Draft