Developer forum

Forum » Templates » Get Global:Paragraph.Content in product details

Get Global:Paragraph.Content in product details


Reply
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?

Replies

 
Nicolai Høeg Pedersen
Reply
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>
 
 
Reply

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
Reply
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.
 
Reply
I have send it in an email to you...
 
Nicolai Høeg Pedersen
Reply
Problem was that the paragraph that was included was not published (inactive.)
 
Reply

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.

 
Reply
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