Our Forum has Moved

This site is our old forum and is only here for achive until we get proper 301 redirects setup to make Google happy.

Please use our new community site - Our Umbraco - which contains an improved forum, documentation wiki, package repository and a member locator.

Go to Our Umbraco now

Learn everything about Umbraco
Macro not working on sub nodes Options
norphf
Posted: Sunday, June 14, 2009 5:23:27 PM
Rank: Enthusiast

Joined: 7/21/2007
Posts: 26
Location: Ringe, Denmark
I have a "Main site Layout" Doc type, and some content sub pages.
On the layout doc type I have an imagepicker to pick a logo.
On the frontpage which uses the main doctype itself works flavless, but when I Click on a content sub page I just get Error parsing XSLT file: \xslt\ImgGen.xslt

Not sure where the error is, but if it's some xslt related then here is the code:
Quote:
<img>
<xsl:attribute name="src">
<xsl:text>/umbraco/ImageGen.ashx?image=</xsl:text>
<xsl:value-of select="umbraco.library:GetMedia($currentPage/data [@alias=$imgAlias], 'false')/data [@alias='umbracoFile']" disable-output-escaping="yes"/>
<xsl:text>&amp;width=130</xsl:text>
<xsl:text>&amp;height=150</xsl:text>
<xsl:text>&amp;constrain=true</xsl:text>
</xsl:attribute>
</img>


Not sure wether or not the disable-output-escaping should be there, just thought it might be the solution, but no.

Why do I get an error on the sub pages?

/Lars Mortensen
fdo
Posted: Sunday, June 14, 2009 7:36:22 PM

Rank: Devotee

Joined: 6/7/2007
Posts: 71
Location: Copenhagen, Denmark
When it works fine on the main (front) page, it's usually the url thats wrong.

What about:

<xsl:text>../umbraco/ImageGen.ashx?image=</xsl:text>
norphf
Posted: Sunday, June 14, 2009 11:32:52 PM
Rank: Enthusiast

Joined: 7/21/2007
Posts: 26
Location: Ringe, Denmark
fdo wrote:
When it works fine on the main (front) page, it's usually the url thats wrong.

What about:

<xsl:text>../umbraco/ImageGen.ashx?image=</xsl:text>

Hi

I have tried your line, but the same.

And I don't think the error is about the url, because then it would display the redcross'ed picture here instead of a picture I get the text "Error parsing XSLT file: \xslt\ImgGen.xslt"

Look here: Working page / front page
And here: Non working / sub page.

Any other thoughts?

/Lars
daniel_l
Posted: Monday, June 15, 2009 10:42:07 AM
Rank: Fanatic

Joined: 6/25/2007
Posts: 336
Location: Malmo, Sweden
If the property is not set on the current content node but on a parent page you need to call the property recursively.

Is it me or umbraco? Umbraco Certified Professional Level 2.
daniel_l
Posted: Monday, June 15, 2009 10:50:47 AM
Rank: Fanatic

Joined: 6/25/2007
Posts: 336
Location: Malmo, Sweden
Here you can find intructions on how to call a property recursively:
http://forum.umbraco.org/yaf_postst2751_XSLT-Tip--Display-a-field-recursively.aspx

If the parameter for GetMedia is empty you will get a parser error.

Is it me or umbraco? Umbraco Certified Professional Level 2.
norphf
Posted: Thursday, July 02, 2009 10:12:22 PM
Rank: Enthusiast

Joined: 7/21/2007
Posts: 26
Location: Ringe, Denmark
Hey

Saw that I haven't reply to this thread.
But thank you the recursive worked.

/nOrphf

The forum has moved

This forum is no longer in use, so you can't reply to this message - please go to Our Umbraco

Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.