I have 50 product numbers all with the same description. How can I use the Global:Paragraph.Content so I only have to edit the description one?
I don't use the Weight value, so I would like to use that value to load the Paragraph ID, something like this:
<xsl:if test="Ecom.Product.Weight != '0'">
<span class="longdesc">
<xsl:variable name="DescriptionID" select="Ecom.Product.Weight" />
<xsl:value-of select="GlobalTags/Global.Paragraph.Content($DescriptionID)" disable-output-escaping="yes" />
</span>
</xsl:if>
This does not work, so I hope that some of you XSLT experts has the answer?
Developer forum
E-mail notifications
Get Global:Paragraph.Content in product details
Posted on 01/12/2010 11:12:54
Replies
Nicolai Høeg Pedersen
Posted on 01/12/2010 11:17:13
Global:Paragraph and Global:Page tags are different than the rest of the global tags.
They are applied after the total rendering of the markup have completed.
So in your xslt you have to insert the tag as a normal html template tag - something like this:
<xsl:if test="Ecom.Product.Weight != '0'">
<span class="longdesc">
<xsl:variable name="DescriptionID" select="Ecom.Product.Weight" />
<!--@Global:Paragraph.Content($DescriptionID)-->
</span>
</xsl:if>
They are applied after the total rendering of the markup have completed.
So in your xslt you have to insert the tag as a normal html template tag - something like this:
<xsl:if test="Ecom.Product.Weight != '0'">
<span class="longdesc">
<xsl:variable name="DescriptionID" select="Ecom.Product.Weight" />
<!--@Global:Paragraph.Content($DescriptionID)-->
</span>
</xsl:if>
Posted on 01/12/2010 11:52:33
The DescriptionID value is right (507),
but the tag Global:Paragraph.Content does not output anything.
I have tried both:
<!--@Global:Paragraph.Content($DescriptionID)-->
<!--@Global:Paragraph.Content(507)-->
Nicolai Høeg Pedersen
Posted on 01/12/2010 11:59:30
Is the template tag in the output after the xslt is applied? Can you find it when viewing source of the generated page?
What is the output type of your xslt - html or xml? It could be that the template tag is stripped or somehow handled by the xslt parser.
Otherwise I'll need a link to the page you are working on.
What is the output type of your xslt - html or xml? It could be that the template tag is stripped or somehow handled by the xslt parser.
Otherwise I'll need a link to the page you are working on.
Posted on 01/12/2010 12:13:01
I have send it in an email to you...
Nicolai Høeg Pedersen
Posted on 01/12/2010 13:09:27
Problem was that the paragraph that was included was not published (inactive.)
Posted on 01/12/2010 13:43:54
The paragraph ID 507 is active.
<!--@Global:Paragraph.Content(507)--> does not work when used in the XSLT template, but if I paste it into a paragraph html source code it will include the paragraph ID 507.
Posted on 01/12/2010 15:58:56
It did not work out as I wanted, so I ended up with just including <!--@Global:Paragraph.Content(ParagraphID)--> in the Long description field.
You must be logged in to post in the forum