Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
<xsl:param name="currentPage"/><xsl:variable name="minLevel" select="1"/><xsl:template match="/"><xsl:value-of select="$currentPage/ancestor-or-self::root/WebSiteSettings [@isDoc]/logo"/>
This should work:
@Model.AncestorOrSelf("WebsiteSettings").Logo
It looks up the tree and finds the first node with the NodeTypeAlias of WebsiteSettings and then takes the Logo value that's there.
Don't work. I've NULL error. WebSiteSetting node is a sibling of "it" node ( child of default CONTENT node ).
Are you sure the logo has a value?
How about:
@Model.AncestorOrSelf().DescendantsOrSelf("WebsiteSettings").First().Logo
This in XSLT works:
<xsl:param name="currentPage"/><xsl:template match="/"><xsl:value-of select="$currentPage/ancestor-or-self::root/WebSiteSettings [@isDoc]/logo"/></xsl:template>
Razor script no. I've error null or empty value.
Here is the cheaty way:
@Model.XPath("//WebSiteSettings [@isDoc]").First().logo
Looks like I just got the casing wrong: WebSiteSettings != WebsiteSettings. So the code should be:
@Model.AncesterOrSelft("WebSiteSettings").First().logo
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to convert this in Razor?
<xsl:param name="currentPage"/>
<xsl:variable name="minLevel" select="1"/>
<xsl:template match="/">
<xsl:value-of select="$currentPage/ancestor-or-self::root/WebSiteSettings [@isDoc]/logo"/>
This should work:
It looks up the tree and finds the first node with the NodeTypeAlias of WebsiteSettings and then takes the Logo value that's there.
Don't work. I've NULL error. WebSiteSetting node is a sibling of "it" node ( child of default CONTENT node ).
Are you sure the logo has a value?
How about:
@Model.AncestorOrSelf().DescendantsOrSelf("WebsiteSettings").First().Logo
This in XSLT works:
<xsl:param name="currentPage"/>
<xsl:template match="/">
<xsl:value-of select="$currentPage/ancestor-or-self::root/WebSiteSettings [@isDoc]/logo"/>
</xsl:template>
Razor script no. I've error null or empty value.
Here is the cheaty way:
Looks like I just got the casing wrong: WebSiteSettings != WebsiteSettings. So the code should be:
is working on a reply...