there's something I don't quite understand here. Let's say that the first when is true (meaning that $mediaId is empty), then you want to show a field from he currentPage called $field right?
If you are using the new XML schema you should change this:
I noticed that there's not easy way to print an <img .. /> tag in Umbraco out of box if I have a media already uploaded in the media section of the umbraco admin tool. So I want to make a Macro that either uses a mediaId if known or uses a media picker value to render an image tag.
I'm puzzled why this works and prints the XML in the original post above
So the /macro/field is actually also a media id written directly inside an input field and the /macro/mediaId is a media picker that chooses an image from the media section? Or is it the other way around or something third?
I noticed that there's not easy way to print an <img .. /> tag in Umbraco out of box if I have a media already uploaded in the media section of the umbraco admin tool. So I want to make a Macro that either uses a mediaId if known or uses a media picker value to render an image tag.
I'm puzzled why this works and prints the XML in the original post above
yes, that's correct macro field mediaId is a number ..... macro field named 'field' is text. If I give this macro I'm making media Id, it should use that ... otherwise, use the value of the "field" macro.... this way I can have this generic macro to print me <img .../> tags from the media's people upload.
again the copy-of results shows that that part works..... it's that one line that is meant to print the umbracoFile which doesn't work
Did you ever solve this problem. I came to think that you might needed to change the value-of to copy-of in the code that I provided above. But could be nice to know if you ever solved this or you just "forgot" about this issue an found another solution.
image
hi guys,
I'm trying to get this xslt to print an image tag for me. This xslt
prints
however this xslt gives me error
Post the error....
Zagros,
+1 to what Darren said, however, I think you need:
HTH,
Benjamin
the error is "Unable to parse xslt". If I attach to IIS and debug I get this error:
I don't think I need that /Image since I tried it and the error didn't go away.
Plus if I just do this on the page it works:
Hi Zagros
there's something I don't quite understand here. Let's say that the first when is true (meaning that $mediaId is empty), then you want to show a field from he currentPage called $field right?
If you are using the new XML schema you should change this:
that's the first thing.
Now the variable contains the content from that field, then you are using tha content in the value-of.
This will never work.
Could you say something about what you want to achieve with this code? What can be choosen in the /macro/field? Is this a textstring or what is it?
I guess that you want to display content from a field on the current page if this is choosen, otherwise you want to render an image. Is that correct?
/Kim A
hi Kim,
I noticed that there's not easy way to print an <img .. /> tag in Umbraco out of box if I have a media already uploaded in the media section of the umbraco admin tool. So I want to make a Macro that either uses a mediaId if known or uses a media picker value to render an image tag.
I'm puzzled why this works and prints the XML in the original post above
however I can't do that $media/umbracoFile
So the /macro/field is actually also a media id written directly inside an input field and the /macro/mediaId is a media picker that chooses an image from the media section? Or is it the other way around or something third?
/Kim A
hi Kim,
I noticed that there's not easy way to print an <img .. /> tag in Umbraco out of box if I have a media already uploaded in the media section of the umbraco admin tool. So I want to make a Macro that either uses a mediaId if known or uses a media picker value to render an image tag.
I'm puzzled why this works and prints the XML in the original post above
however I can't do that $media/umbracoFile
yes, that's correct macro field mediaId is a number ..... macro field named 'field' is text. If I give this macro I'm making media Id, it should use that ... otherwise, use the value of the "field" macro.... this way I can have this generic macro to print me <img .../> tags from the media's people upload.
again the copy-of results shows that that part works..... it's that one line that is meant to print the umbracoFile which doesn't work
Okay, so actually both of the macros parameters contains media id's?
If that's the case maybe you can try changing your code to something like this:
/Kim A
Hi Zagros!
Did you ever solve this problem. I came to think that you might needed to change the value-of to copy-of in the code that I provided above. But could be nice to know if you ever solved this or you just "forgot" about this issue an found another solution.
/Kim A
is working on a reply...