Search

i’m working on a design portfolio website.

on homepage i want to see a very big “last case” and under it another 4 more but in a smaller way…

i don’t know how can i do that, but i have 2 ideeas.

first: make 2 data sources, - one that feeds the first big case (already done that and is woking…) - and another one that feeds the next 4 small teasers… here i don’t know how can i make the data source to skip the first case

second: make 1 data source that exports 5 entries and somehow to use a different template for the first case.

any suggestion is priceless!

I think the second will be your best bet. You can do the following:

<xsl:template match="your-section/entry[1]">
    Your 'last case' template
</xsl:template>

and

<xsl:template match="your-section/entry[position() &gt; 1]">
    Your 'other 4 cases' template
</xsl:template>

Addendum. If you’re not clear on how to apply those templates in separate places, you could do it like so:

<div id="my-featured-case">
    <xsl:apply-templates select="your-section/entry[1]"/>
</div>

<div id="recent-cases">
    <xsl:apply-templates select="your-section/entry[position() &gt; 1]"/>
</div>

oh, thanks craig! i got it from the first post, thanks for the extra example too!!!

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