Search

Hi

my English isn't perfect but I'll try to be clear:

I use Symphony 2.0.1 (I started learning it and XSLT yesterday so there may be a better way to do some things but I'm still learning and experimenting)

so far I manged to get a list of categories, and list of all articles, now I would like to be able to show only articles from a given category by using the DS filter option (and I manged to do this, but not exactly how I wanted to)

my problem:

I created a datasource to list all articles, and I want to filter it by Categories so I chose:

Source: Articles

Filter results by: Categories, Value: $cat

and I get in xml ( using ?debug):

<entry id="125" comments="0" images="0">
<categories>
<item handle="category-name" id="121">Category Name</item>
</categories>
<title handle="title">Title</title>
</entry>

so I can see that Categories have handle and id, and I would like the filter to use handle, but it works only with id:

if I go to mysite/list-articles/121 it shows only articles from this category but url would look better if it was mysite/list-articles/category but this doesn't work

so is there anything I can do to be able to filter articles by handle?

thanks, Tom

Well, the issue here is that if you're linking to categories via a Select Box Link or some such, it's the category ID that gets stored in that field (which is what you'd want it to do). One alternative, I guess, would be to use a tag list instead.

I do not think that you can filter by handle yet (at least it does not work for me). However, trying to achieve something similar I used the following workaround:

  • Specify a /category page parameter at your list-articles page
  • Set up a datasource "this-category" pulling data from Categories with a filter on "item", value {$category}
  • Set parameter output to use System ID (you can leave XML output empty)
  • Edit your original article datasource and filter results by: Categories, value {$ds-this-category}.
  • Attach both your original and this-category datasources to your list-articles page

Nice workaround.

Thanks, You helped me a lot

Tom

this also helped me :)

would be nice if symphony's filtering got beefed up a bit to allow more filtering options such as this.

Will Carstens solution work on a symphony 2.0.4 build?

I don’t see why not. It’s just basic data source chaining.

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