symphonycms: Filtering not working for multi value URL parameters (GET request)

Let’s say I have a section with tags, and another section with multiple select box that selects from tags.

If I want to filter that section by multiple tags, I’d do something like this :

?tags[]=blue&tags[]=green&tags[]=red

This gives me following nodes :

<url-tags.1>blue</url-tags.1>
<url-tags.2>green</url-tags.2>
<url-tags.3>red</url-tags.3>

And following parameters :

$url-tags.1    'blue'
$url-tags.2    'green'
$url-tags.3    'red'

I can’t really filter DS with that, since I never know how many tags I will have, so I can’t do something like {$url-tags.1:}, {$url-tags.2:}, {$url-tags.3:} as filter criteria. This also doesn’t work {$url-tags} (it was my last hope) 😄

This also doesn’t work it gives similar results to the ones above :

?fields[tags][]=Blue&fields[tags][]=Brown

I suggest that generated xml for parameters look like this :

<url-tags>
    <value>tag01</value>
    <value>tag02</value>
</url-tags>

Or for more complex url parameter :

?field-group[field1][]=f1v1&field-group[field1][]=f1v2&field-group[field1][]=f2v1&field-group[field2][]=f2v2

XML :

<url-field-group>
    <url-field1>
        <val>f1v1</val>
        <val>f1v2</val>
    </url-field1>
    <url-field2>
        <val>f2v1</val>
        <val>f2v2</val>
    </url-field2>
</url-field-group>

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Comments: 19 (9 by maintainers)

Most upvoted comments

although I’m kind of in the middle of making a little promo / tutorial for symphony and this doesn’t look very good 😄

Agreed. It’s already on the list for the 3.0.0 release.

It does look like some changes were agreed in #1807 and #2484 but never happened.

Would be a breaking change, so it requires a major version bump.

I suggest that generated xml for parameters look like this :

<url-tags>
    <value>tag01</value>
    <value>tag02</value>
</url-tags>

If you still need it, I have an unreleased extension for this.

Works as mentioned in #2484.