Search

I hope someone can tell me wether what I'm trying to do is possible or not:

I've got two sections:

  1. Publisher, which contains just one field, a text input for newspaper names.

  2. Articles, where a select box is dynamicly filled with the newspaper names. Multiple is not possible.

In Articles, what I've is a number of fields, for heading, intro, body and so on. And for each article I obviously want to assign a publisher where the article has been in print.

Now, I want to create a DS that returns articles printed in by a certain publisher. I've set up a page, where I've got 'publisher' as page parameter.

I've then created the DS with Articles as source. I've set 'Publisher' as filter option, based on the parameter {$publisher}.

When I access the page without a page parameter, the XML contains entries in the node 'publisher-articles'. But as soon as I enter a page parameter, all I get is

 <articles-by-publisher>
   <section id="16" handle="articles">Articles</section>
   <error>No Records Found.</error>
 </articles-by-publisher>

What am I doing wrong here?

Just out of curiosity (while you wait for a proper answer!): I'm wondering why you decided to use a separate section with a singe "name" field for your newspaper names, rather than just using "Categories" for this? Using Categories (I think, though I cannot be sure!) would have got you the same functionality with less hassle. Or is the idea that you can develop the "Publisher" section at some point in the future?

David.

I'm not quite sure what you mean by "categories". I can't find no such field type in Symphony. And the way I've implemented the publisher bit, which sure is just another name for categories, is the same way as it's done in the default template. But if you have another idea on how to do it, please share :-)

But I think the way I've started to do it suits me better. There is just a single name-field today, but there might be some additional fields, like url and phone number, in the future.

Anders

What you are doing looks to be correct and I'm not sure why you're not getting the desired result you want. Is there more information you could give us? Is there an online copy we can look at?

No, no online copy at the moment. But since you say I'm on the right track, I'll have another look at it myself. If I not succeed, I'll post more information.

Thanks.

My Publisher fields had some spaces in them. Deleted them, and suddenly it works. Now, why did Symphony choke on the spaces?

My Publisher fields had some spaces in them. Deleted them, and suddenly it works

Glad you got it figured out.

Now, why did Symphony choke on the spaces?

Filters for all but textarea's need to be exact matches, however, spaces shouldn't be causing any problems. So, the publisher names had spaces at the beginning and end?

No, there where spaces inbetween the names, within the Text Field, like "Anders Thoresson". In retrospect, I can see that this is converted to "anders%20thoresson" in the url, while the XML contains "anders-thoresson". That explains why the names with spaces didn't match. But there were also some names without spaces, and they didn't work either.

Anyway, I'll go with two fields then. One without spaces, for the internal Symphony processing, and one with spaces which are used in the rendered HTML.

Another question related to this: When I change the names in the Publisher section, the entries in Articles isn't updated with the new names. Is this intended?

This is strange. Suddenly, when I've the param {$publisher} set as filter in the data source, the rendered page is blank. Nothing. But if I add one of the values from Publisher as the filter, the page is shown.

Also, if I spell the param name wrong, like {$publiser}, the page renders. (But not correct, of source, since the param used for filtering isn't the same as the param name passed by the URL.

Since I couldn't get filtering in the Article section based on what Publisher the user had choosen, I tried another approach.

First, to recap. Two sections:

Section 1 - Publisher, used as a category field in Section 2 - Articles. Articles has a Select Box that has dynamic options set to the field Publisher::publisher.

When trying to make a DS based on Articles, and having it filtered on the Publisher field, I couldn't get Symphony to give me the expected XML back. Instead, the <articles-based-on-publisher> node was always empty when the URL param 'publisher' was set.

So, Take II - try Symphony's new DS linking feature.

First, create a DS based on Publisher, call it publisher-choosen filter on the same URL param 'publisher' and have it return the content in the field Publisher::publisher as Parameter output.

Second, create a DS based on Article, and filter it on $ds-publisher-choosen.

Voila. Stuff works.

Now, why did I have to take the extra route over the DS publisher-choosen? When I look at the debug information, I see a difference in the params

$ds-publisher-choosen is set to 'Paper One', while $publisher (the URL param) is set to 'paper-one'.

So, from this it looks like the different formatting, where Symphony replaces the spaces with a dash in the urls is the cause. At that seems like a possible explanation, since the value in the Articles::publisher field is "Paper One" and not "paper-one".

But then, on the other hand, why is the default them successfully filters on titles like "this-is-a-title" on the Article page?

The way I've solved it, it works. But that approach will eventually clutter the component column with extra DSs to achieve this. That why I want to know: Is my solution the only one?

Hope this is clear enough to result in an answer. ;-)

this looks like information that could be very helpful .... thanks.

I could really use some input on my last post. Anyone?

I would consider this a bug. What part, I'm not sure :-)

Can you post a bug report explaining the inconsistency.

$ds-publisher-choosen is set to 'Paper One', while $publisher (the URL param) is set to 'paper-one'.

So, from this it looks like the different formatting, where Symphony replaces the spaces with a dash in the urls is the cause. At that seems like a possible explanation, since the value in the Articles::publisher field is "Paper One" and not "paper-one".

But then, on the other hand, why is the default them successfully filters on titles like "this-is-a-title" on the Article page?

I've encountered the same bug. If you want to see the same bug for the article page, create a category that has a space in it, then filter by category.

The differences in the xml are:

<entry>
    <categories>
        <item handle="the-hope">The hope</item>
        <item handle="symphony">Symphony</item>
    </categories>
</entry>

<entry>
         <title handle="a-primer-to-symphony-2s-default-theme">
              A primer to Symphony 2's default theme
         </title>
</entry>

The category node is more nested with the item tag

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