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
Hi all,
Let me describe what I have and what I want to do.
I have some pages (articles):
"Codegarden 09" and "CWS2 is released"
Each of them are the same document type with "Content" tab in Generic properties:
At Content section it looks like this:
So I have fields:
- "News description" with alias "newsdescription" and type "Textbox multiple"
- "News text" with alias "newstext" and type "Richtext editor"
I want to out put content of this two fields on a new page. I use for this macro/xslt:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " ">]><xsl:stylesheetversion="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"> <xsl:output method="xml" omit-xml-declaration="yes"/> <xsl:param name="currentPage"/> <xsl:variable name="itemsToDisplay" select="30" /> <xsl:template match="/"> <xsl:choose> <xsl:when test="$currentPage/@id=2878"><!-- ***************************** Display events for 'EVENTS' page ********************************************************--> <ul style="list-style-type:none;"> <xsl:for-each select="$currentPage/ancestor-or-self::node/node [@id = '2886']/node"> <xsl:sort select="data [@alias = 'date']" order="descending"/> <xsl:if test="position() <= $itemsToDisplay"> <li style="margin-bottom:6px;"> <xsl:value-of select="umbraco.library:FormatDateTime(data [@alias = 'date'], 'dd⁄MM⁄yyyy')"/><br /> <b><xsl:value-of select="data [@alias = 'newsheader']"/></b> <p>Parameter "newsdescription": <xsl:value-of select="data [@alias = 'newsdescription']"/><br /><br /> <p>Parameter "newstext ": <xsl:value-of select="data [@alias = 'newstext']"/> </p> </li> </xsl:if> </xsl:for-each> </ul> </xsl:when> <xsl:otherwise> </xsl:otherwise> </xsl:choose> </xsl:template></xsl:stylesheet>
And the result is:
QUESTION:
why content from "News description" field outputs correctly and content from "News text" field outputs wrong?
Is it a difference in types of properties or else?
What to do to output text and images that published in "News text" field in a new page, using xslt?
Thank you!
You need to escape the content of newstext field so you need to do
<xsl:value-of select="data [@alias = 'newstext']" disable-output-escaping="yes"/>
Regards
Ismail
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
How to output content from richtext editor using xslt?
Hi all,
Let me describe what I have and what I want to do.
I have some pages (articles):
"Codegarden 09" and "CWS2 is released"
Each of them are the same document type with "Content" tab in Generic properties:
At Content section it looks like this:
So I have fields:
- "News description" with alias "newsdescription" and type "Textbox multiple"
- "News text" with alias "newstext" and type "Richtext editor"
I want to out put content of this two fields on a new page. I use for this macro/xslt:
And the result is:
QUESTION:
why content from "News description" field outputs correctly and content from "News text" field outputs wrong?
Is it a difference in types of properties or else?
What to do to output text and images that published in "News text" field in a new page, using xslt?
Thank you!
You need to escape the content of newstext field so you need to do
Regards
Ismail
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.