XF 2.0 Get parameters after an hash

AlessioDP

Member
Hi, I've some problems to get a parameter if there is an hash into the link.

Quick example:
Code:
http://xxxxx.net/index.php?var=1
http://xxxxx.net/index.php#category.1?var=1

The first works without problems, the second one doesn't work.
Any tip? I've tried the buildLink too:
Code:
{{ link('categories', $node, {'var': 1}))
 
Have you tried building your link in a correct way?
http://xxxxx.net/index.php#category.1?var=1
This will take everything after the # as Hash.
http://xxxxx.net/index.php?var=1#category.1
This will give you var=1 as Query String and category.1 as Hash.
 
Have you tried building your link in a correct way?
http://xxxxx.net/index.php#category.1?var=1
This will take everything after the # as Hash.
http://xxxxx.net/index.php?var=1#category.1
This will give you var=1 as Query String and category.1 as Hash.
The category has is inserted automatically with:
Code:
link('categories', $node)
So I can only append it or pass it via params.

An alternative way it should be to use the regex on the link, but its something that I want avoid if there is a simpliest way.
 
Yea, the cat might be inserted automatically but you are manually appending the variable, right? So the right approach would be to apply the variable first to the link and then build the link. Because as I said above, everything after the # will be considered as the Hash part of the URL.
 
Yea, the cat might be inserted automatically but you are manually appending the variable, right? So the right approach would be to apply the variable first to the link and then build the link. Because as I said above, everything after the # will be considered as the Hash part of the URL.
I cannot append it between because I'm using:
Code:
link('categories', $node)
to generate the link. And it automatically appends #thing at the end.
For that I want to know if there is a way to bypass it, its strange that you can insert custom parameters inside link method but they doesn't work if you have an hash...
 
I would consider reporting this as a bug, I would expect the parameters to be appended to the route (before the hash). It looks like it might have something to do with the assertCanonicalUrl() call in the category controller.
 
Back
Top Bottom