The xslt code generates a link element with an image for all nodes under $source. The src of the image is empty while the data in the node is available.
Selecting the foto1 url fails, and I don't know why.
Actually it should really be changed to the below - since the
property is on the current node in the loop you don't need to use the
GetXmlNodeById function
<xsl:value-ofselect="foto1"/>
Secondly, what type of field is foto1?
I'm assuming it's an upload field or media picker. If it's an upload
field then the above code should work as it should contain the path to the image.
<xsl:value-ofselect="foto1"/>
If it's a media field, you'll need to get the path using the GetMedia function, something like this:
Have you placed the image to be shown directly on a node using the upload property? Or do you select it from the media section using a media picker?
If you select the image using a media picker you should use the umbraco.library:GetMedia extension instead, which is documented here: http://our.umbraco.org/wiki/reference/umbracolibrary/getmedia (Make sure to look at the examples for umbraco 4.5.x)
If you're uploading the image directly to the node you should just make <xsl:value-of select="yourimagepropertyname" />
Yes
I use Umbraco 4.5+. I did not realize that the xml scheme changed so
dramatically. Could you point me to a list of changes between new xml schema and the one before?
I think you could have a look at the umbraco.config in the app_data folder to get an idea about how the new schema looks. Instead of saving all as attributes in a data element they're are now saved as elements with the name of your property. That's really the main difference.
If you have a site running v4.0.x and you need to upgrade it you don't need to change the XSLT files though since you can use the legacy schema by changing the <UseLegacyXmlSchema> from false to true in the umbracoSettings.config in the config folder.
Selecting data in a node
Hi,
The xslt code generates a link element with an image for all nodes under $source. The src of the image is empty while the data in the node is available.
Selecting the foto1 url fails, and I don't know why.
Kind regards,
Bas Wensveen
Hi Bas,
First of all, are you on Umbraco 4.5+ ? If so you'll want to change how you are calling 'foto1' for the new schema
to
Actually it should really be changed to the below - since the property is on the current node in the loop you don't need to use the GetXmlNodeById function
Secondly, what type of field is foto1?
I'm assuming it's an upload field or media picker. If it's an upload field then the above code should work as it should contain the path to the image.
If it's a media field, you'll need to get the path using the GetMedia function, something like this:
<xsl:if test="string(foto1) != ''">
<xsl:value-of select="umbraco.library:GetMedia(foto1,false())/umbracoFile"/>
</xsl:if>
Let us know if this works..
Thanks,
Tom
Hi Bas
I assume that the foto1 property contains a direct path to an image. And as far as I can see you are using the new XML schema.
If that's all correct you kan probably just change this line:
<xsl:value-of select="umbraco.library:GetXmlNodeById(@id)/data [@alias='foto1']"/>
to this:
<xsl:value-of select="./foto1"/>
/Kim A
Hi Bas
Have you placed the image to be shown directly on a node using the upload property? Or do you select it from the media section using a media picker?
If you select the image using a media picker you should use the umbraco.library:GetMedia extension instead, which is documented here: http://our.umbraco.org/wiki/reference/umbracolibrary/getmedia (Make sure to look at the examples for umbraco 4.5.x)
If you're uploading the image directly to the node you should just make <xsl:value-of select="yourimagepropertyname" />
Hope this helps
/Jan
Damn...way to slow. You rock guys :-)
/Jan
Hi Tom,
Yes I use Umbraco 4.5+. I did not realize that the xml scheme changed so dramatically. Could you point me to a list of changes between new xml schema and the one before?
You solution solved the issue, thanks!
Kind regards,
Hi Bas
I think you could have a look at the umbraco.config in the app_data folder to get an idea about how the new schema looks. Instead of saving all as attributes in a data element they're are now saved as elements with the name of your property. That's really the main difference.
If you have a site running v4.0.x and you need to upgrade it you don't need to change the XSLT files though since you can use the legacy schema by changing the <UseLegacyXmlSchema> from false to true in the umbracoSettings.config in the config folder.
/Jan
Hi Bas
In this wiki you there's a comparison between the old and the new XML schema. It's gives you a nice overview of how the schema has changed.
/Kim A
Thanks guys,
I will look into the information you gave me.
Happy new year!
Regards,
is working on a reply...