Search

Hi,

I'm just having a mess around with symphony trying things out and I'm stuck :)

I made a new section, data source, utility and page once and everything went smoothly, however I've tried to make another (by exactly the same process as far as I can tell, but with different fields) and something is wrong.

On the ?debug page I have this: http://textsnip.com/74b473/html

Which gets the get-links.xsl here: http://textsnip.com/85b918/html

Which gets stuff from the xml created here: http://textsnip.com/26c4ea/html

But all I get out at the end is:

...Some Links - Add <div class=blah></div>...

What am I missing? (as you may have guessed I'm not exactly an expert) I realise this is probably a stupid question.

Thanks in advance,

o~

I think you're applying templates too many times. Try a call template to start the links XSLT like this:

 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="data">
        <xsl:call-template name="link-list"/>
    </xsl:template>

    <xsl:template name="link-list">
        <h3>
            <xsl:text>Some links</xsl:text>
            <xsl:if test="$is-logged-in = 'true'">
                <xsl:text> &#8212; </xsl:text>
                <a href="{$root}/symphony/publish/{section/@handle}/new/">Add</a>
            </xsl:if>
        </h3>
        <div class="blah">
            <ul>
                <xsl:apply-templates select="links/entry"/>
            </ul>
        </div>
    </xsl:template>

    <xsl:template match="entry">
            <li>
                <a href="{link-url}">
                    <xsl:value-of select="link-name"/>
                </a>
            </li>
    </xsl:template>
 </xsl:stylesheet>

Thank you very much. That was very helpful.

I think I was mixing up apply-templates and call-template :|

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