Search

I'd like to have comments on multiple pages. For this purpose, I want to have one get-comments.xsl which is utilized by all the different pages.

I call get-comments from the pages like this:

<xsl:apply-templates select="comments">
  <xsl:with-param name="section" select="section/@handle"/>
</xsl:apply-templates>

get-comments:

<xsl:template match="comments">
<xsl:param name="section"/>

  <xsl:if test="$is-logged-in = 'true'">
    <a class="edit" href="{$root}/symphony/publish/kommentare/?filter=artikel:{/data/{$section}/entry/@id}">bearbeiten</a>
  </xsl:if>
  <xsl:apply-templates select="entry"/>
  <xsl:apply-templates select="error"/>
</xsl:template>

But the "filter"-part is not working. I get an XSLT Processing Error. I also tried

bearbeiten

, but this won't work either. How is the correct syntax to call a variable from within the filter?

booker

Stumbled across this problem again:

      <input name="fields[articel]" value="{galleries/entry/@id}" type="hidden" />

works, but not

      <input name="fields[artikel]" value="{$section/entry/@id}" type="hidden" />

Althought I get no errors this time, just no results.

Try:

  <input name="fields[artikel]" value="{[name() = $section]/entry/@id}" type="hidden" />

No success. Error Message is:

XSLTProcessor::importStylesheet(): Invalid expression XSLTProcessor::importStylesheet(): Attribute 'value': Failed to compile the expression '[name() = $section]/entry/@id' in the AVT. XSLTProcessor::transformToXml(): No stylesheet associated to this object

Oops, try this:

<input name="fields[artikel]" value="{//self::node()[name() = $section]/entry/@id}" type="hidden" />

Works!

Thanks a lot!

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details