Search

I'd like to know how to create list of recent articles in symphony.

I think the simplest way would be to include a 'date created' field in your articles section, then create a 'recent articles' datasource. In that DS, sort by the 'date created' field, then enter how many articles you want to output in the 'maximum results' field.

If you only want to show articles within a certain time period (rather than the last x number of articles created, which is what the above solution would provide) you will probably have to filter the DS output in your xsl (using the date/time parameters).

You might also be able to add a filter to the datasource itself; I'm not up on the latest syntax for DS filters, so you might be able to calculate a date (e.g. $today - 30) but I'm not sure.

You can automatically sort your articles by system date. Then you just need to limit it to the latest five entries or however many you wish.

any xml example for doing so? i'm a noob.

bump bump bump bump :(

A Data Source creates XML.

Diomed have you used Data Sources before? You create a Data Source to grab your entries (from your Articles section), to sort them (by date) and expose them as XML.

Navigate to Blueprints > Data Sources in Symphony and create a new one. Then Blueprints > Pages > (your page) and attach the DS to this page. When you view this page on the frontend, append ?debug (the Debug Devkit) to the URL to view your page XML.

oh , sorry nick for double topic. you can delete other one.

I’m just curious what should I write in code to get that list. Can you give me some example.

Have you tried the default “Spectrum” blog workspace that is installed when you download the Symphony zip file? It uses an Articles section and a Data Source called “Articles” to select the latest articles (ordered in reverse date order).

By attaching that Data Source to a page, and appending ?debug on the end of the page you will see the XML output from that DS. You then need to use XSLT in your page with a <xsl:for-each>...</xsl:for-each> or a slightly tricker <xsl:apply-templates.../> to loop over each article.

The Say Hello to the World tutorial guides you through this step by step.

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