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?
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:
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.
Hi Garry, you can take a look at this example here:
http://blackpoint.dk/umbraco-workbench.aspx?Snippet=/umbraco-workbench/xslt/accessing-media-files.aspx
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!
To access media nodes you would probably want to use something like this (gets the filename):
[quote]
[/quote]
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.
If you save the image url to a variable like
[code]
[/code]
then you can stick it in the like so
[code]
[/code]
Excellent, thanks very much guys much appreciated.
is working on a reply...