Search

I have a section 'pictures' that is section-linked to the section 'gallery', so one gallery can contain several pictures. Now I linked 'galleries' to 'articles' with a select box. On the 'articles'-page, I want to show the pictures associated with the gallery associated with the article. The workflow would be to create a gallery, then create pictures within the gallery, and then link the gallery to an article with the select box.

I created a DS named article-pictures, but don't know how to filter the pictures by gallery.

I could filter them by selecting 'Gallery' in the filter select box, but I don't know which parameter to pass it. The gallery an article links to is not a param, and I can't use {ds-articles} because I allready need this for filtering comments.

The only way I can think of would be to pass the filter some XPath-evaluation like '/data/article/entry/gallery/item/@handle', but this don't work.

If you have your galleries section-linked to a specific article, shouldn't that gallery appear in your xml when you call that particular article?

No, I don't have the galleries section-linked because I want them to be independent from the articles. I have a seperate 'Pictures'-page where the galleries are displayed. The linking from an article is optional, so I linked them with the select-box. Just like articles and categories are linked in 'Spectrum'.

Take a look at Output Options for your article and gallery data sources. You want to output a parameter using the System ID field so that you can use that parameter to filter your data source.

For instance, using your gallery and pictures sections, in the gallery data source output a parameter using the System ID field. Then, in your pictures data source filter the section link field (that is linked to gallery) with the output parameter created by the gallery data source, $ds-gallery. Parameters outputted by data sources consist of $ds- + name of data source (spaces in a data source's name are replaced with -).

Chaining data sources like this allows you to limit the XML produced so that only relevant entries(i.e. galleries and pictures) are outputted.

Okay, I can see now where I was wrong. I thought you could link sections not only with section links, but also with select boxes. I think section links don't fit for my purpose.

What I want is this:

I have a 'Picture' page where galleries are shown. Those galleries are section-linked with pictures, so a gallery can contain several pictures.

And I have an 'Article' page where I want to link one or more galleries, to display the pictures from a gallery within an article.

If I would section-link them all together like this:

pictures section-linked with galleries section-linked with articles,

I only could create a gallery from within an article. I would lose the possibility to create a gallery on it's own, independent from an article. Which is not what I want. It should be optional to 'apply' a gallery to an article, not the default.

Since section-linking is not an option, I thought I could use a select box instead. So that a user could create an article and choose which galleries' pictures should be displayed in the article.

I'm half way through, encountered strange behaviour...

In my 'Gallery'-section, I have a select box called 'Article' which has article->title as dynamic option. All I need now is a data source that puts out the article title as parameter.

Because I use the output option from my article DS to put out the articles' system id, I created a fake DS that has only the purpose to put out the articles' title. The parameter is called '$ds-article-gallery-filter'.

Next I create a DS that gives me all galleries corresponding to the article. It's called 'article-gallery'. This DS can be filtered by Article because of the above mentioned select box. This filter needs the title of an article, so it gets {$ds-article-gallery-filter}.

DS 'article-gallery' has the system id as output param, so I can filter the DS 'articel-pictures' by this param because of the section linking between galleries and pictures.

Now the strange part: The filter applied in 'article-galleries' won't give any results if the name to filter by contains the character " ' ". So if {$ds-article-gallery-filter} evaluates to "An example draft article", it works correct. But if it evaluates to "A primer to Symphony 2's default theme", it don't show any results. I checked it with several entries, double checked if they are really linked, but always the same result: If the string contains " ' ", the filter fails.

Could this be a bug?

Could this be a bug?

Indeed it is. I've added a bug report, but this might not get fixed for Beta 5 since RC 1 handles param output a little differently, so this problem does not occur.

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