Developer forum

Forum » Templates » @Include in XSLT

@Include in XSLT


Reply
Hi

I can't seem to get this working. The code is more or less from Sebastians example here:

http://engage.dynamicweb-cms.com/Forum-5.aspx?action=ShowThread&ThreadID=1614

His example is used to include page- or paragraph-content, but i thought it might work with the Include-tag to.

My code is this:

<xsl:comment>
    <xsl:value-of select="concat('@Include(../../HTML/Includes/', GlobalTags/Global.Area.ID, '.html)')" />
</xsl:comment>

And the result in the template is:

<!--@Include(../../HTML/Includes/104.html)-->

So the output is correct but Dynamicweb doesn't seem to parse it as code/templatetag.

Am I missing something?  

Best regards
Jesper Sørensen


Replies

 
Nicolai Høeg Pedersen
Reply
You cannot do that due to the way the template engine loads html and xslt differently. So includes are handled on template load and works only for html templates, and global tags (like paragraphs) are handled post parsing of templates and works for both types.

 

 
Reply

Hi,
You can include content by packing your Include into a xsl:text and CDATA like this:


{xsl:text disable-output-escaping="yes"}{![CDATA[{!--@Include(login.html)--}]]}{/xsl:text}


Where "{" = less than and "}" = greater than... I was not sure if this editor would otherwise replace my markup - hope you understand.

The rule is: Dynamicweb will see your template as a string, and will do replace of known tags - so you need to create tags as they look in a "normal" HTML tag.
 

/Sten Hougaard

 

You must be logged in to post in the forum