Search

I have a set of entries that are sorted by random in the Datasource, and output into a carousel for the frontend.

The client has expressed that one of these entries should never be visible first or second in the carousel. I'm guessing position() will come into this somewhere.

How can I re-order the entries, still randomly, yet moving the specific card to position 3, only if it is in position 1 or 2.

Would doing

<xsl:apply-templates select="entry[show-only-in-third = 'no']" />
<xsl:apply-templates select="entry[show-only-in-third = 'yes']" />

solve this?

I don't know...

I could add another attribute, but I was hoping to do it by ID...

By ID? Weird. :-) But yea, change the predicate a bit and it should be fine

<xsl:apply-templates select="entry[not(@id = '30')]" />
<xsl:apply-templates select="entry[@id = '30']" />

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