Developer forum

Forum » Templates » Paragraph content in xslt template

Paragraph content in xslt template

Tomasz Lach
Reply
Hello. I have a problem with xslt menu template. I want to return a paragraph text in a specific location in xslt (in attachment, location is a comment). This text must be from a specific paragraph whose name is "Description" (this paragraph is also in section "Description area") from the current (active) page. I try many trick but without success. Thank You for help.

Replies

 
Vladimir
Reply
This post has been marked as an answer
Hi Tomasz,
I think that you can use <!--@Global:Paragraph.Content(id)--> tag.
But  problem how to get needed paragraph id...
What if you set for page's property NavigationTag the id of needed paragraph?

In this case your xslt might look like this:
        <xsl:if test="@NavigationTag>'0'">
        <xsl:comment>@Global:Paragraph.Content(<xsl:value-of select="@NavigationTag"/>)</xsl:comment>
         </xsl:if>
Best regards,
Vladimir

Votes for this answer: 0
 
Tomasz Lach
Reply
Hi Vladimir,
Thanks for reply. <xsl:value-of select="@NavigationTag"/> returns nothing.
I try to connect this param with this solution http://developer.dynamicweb-cms.com/forum/templates/globalpage/paragraph.content%28%29.aspx, but this don't work too. Temporary I was use a jQuery to replace a div content. How can I return all tags which can I use in xslt? A &SaveTemplateXML=true don't work (or I do something wrong).
Thanks for help.
 
Vladimir
Reply
Try to use &SaveXML=true parameter - xml file(s) should appears in  \Files\Templates\Designs\YourTemplate\Navigation folder
I think you find @NavigationTag in obtained xml :)

Best regards,
Vladimir

 
Tomasz Lach
Reply
Thanks for help. &SaveXML=true is working, but in obtained xml I don't find a @NavigationTag. I think that I don't understand Your first answer:)  What this is mind: "What if you set for page's property NavigationTag the id of needed paragraph?" I must manualy enter a paragraph ID somewhere in pages properties? If yes, how can I do this?:) Sorry if I don't know a DynamicWeb structure and options but I'm just started working in DW. Thanks for reply.

Best regards,
Tomasz
 
Vladimir
Reply
Hi Tomasz!
Yes, the only way that I imagine to transfer requered paragraphID it is pass manualy throught page's NavigationTag.
Page properties are accessed from backend, when you right click on page, then appeared a menu with Properties option.
Then Options tab -> Navigation button (in ribbon menu)
And Id of paragraph is showed in url in the bottom of a brouser

Kind regards,
Vladimir

NavigationTag.png paragraphId.png
 
Tomasz Lach
Reply
Hi Vladimir,
This was very helpful. Thanks!

Best regards,
Tomasz

 

You must be logged in to post in the forum