Search

Thank you for getting back to me @michael-e. I had tried this before and it didn't work. Just to make sure I had another go today with a clear head - and found out why I'm having a problem.

My url looks like this /?enquiry%255B%255D=27&enquiry%255B%255D=28 if I manualy change it to /?enquiry[]=27&enquiry[]=28 or even /?enquiry%5B%5D=27&enquiry%5B%5D=28 @designermonkey's solution works brilliantly.

So I guess I need to remove the %225B %225D and replace it with either %5B and %5D or []. I've tried all ways of encoding I can think of and none of them seem to work - I don't suppose anyone has come across this before?

Thanks

I actually use @designermonkey's code.

If you are using a form, just use something like:

<input type="text" name="enquiry[]" value="27"/>
<input type="text" name="enquiry[]" value="28"/>

This will generate /?enquiry%5B%5D=27&enquiry%5B%5D=28, which results in the correct results.

Thanks Pat, the code seems to be working fine, and my checkboxes are setup like this

<input type="checkbox" name="enquiry[]" value="27" />

But for some reason the url has %255B instead of %5B - which is odd - it's adding the code for % before the code for [ and so breaking the code.

Maybe this is a bug in 2.3.2?

I'm also using 2.3.2.

I am using this commit for another URL param issue, but maybe it's related to this?

Thanks Pat I appreciate your help, unfortunately the commit didn't seem to help. I'm on the master branch of 2.3.2 I might try the integration branch on local host to see if that fixes the problem.

Most likely I'll be doing something wrong I just can't see it yet! Thanks again

But for some reason the url has %255B instead of %5B

It looks like the [ got encoded twice... can you check if you can replicate with another browser? seems like a browser issue to me rather then symphony. It could also be related to the file encoding of your xslt (however I highly doubt this)

Thanks for the help. It looks like it's happening on firefox, chrome and IE. I thought it might be a server issue but the same is happening on localhost and my live web server.

Can you please show us:

  • the URL in your XSLT template
  • the URL in the rendered source code of the page

Not sure what you needed specifically so here's the source code for the whole page and the utility containing the enquiry checkboxes.

[http://pastie.org/private/mu9pl4qm2zob5h2qe3s7ha][Pastie Code]

Looks like the link didn't work properly there, here it is again;

link text

I tested your HTML output with the current Symphony code (from integration branch) and couldn't find any problems. Using your form I get URLs like ?bull-enquiry%5B%5D=29&bull-enquiry%5B%5D=30.

Where exactly do you see the double-encoding? In the browser's location bar?

BTW: The browser will URL encode the URL you are clicking, so there is no interaction with Symphony at that point. The visible URL should always be the same unless the server (or CMS) performs a redirect.

With regards to the original problem of multiple value handling in the URL via a GET request, has this been looked into to correct the behaviour? I've raised an issue for the problem as it still seems to be present in Symphony 2.3.3.

I am trying to write a javascript array of url-params ($url-cool.1, $url-cool.2, etc.)

I wonder if there is anything I can besides this clumsy solution:

<xsl:text>[</xsl:text>
<xsl:if test="$url-cool.1">
    '<xsl:value-of select="$url-cool.1"/>'
</xsl:if>
<xsl:if test="$url-cool.2">
    , '<xsl:value-of select="$url-cool.2"/>'
</xsl:if>
<xsl:if test="$url-cool.3">
    , '<xsl:value-of select="$url-cool.3"/>'
</xsl:if>
<xsl:text>]</xsl:text>

Try this:

<xsl:text>[</xsl:text>
<xsl:for-each select="/data/params/*[ starts-with(name(), 'url-cool.') ]">
    <xsl:if test="position() > 1">,</xsl:if>
    '<xsl:value-of select="."/>'
</xsl:for-each>
<xsl:text>]</xsl:text>

@vladG smart :) Totally forgot that the param were also in the XML!

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