151 Posts
jimenaes
7 years ago
4
Topic

Hello

I'm using several URL custom variables to send values to search&list types inside joomla modules, for example my menu item display a list (SearchType A) that is filtered for a value (articles with my_field="2") and I send this value to the URL (www.mysite/articles.html?search=search_articles&task=search&my_field=2). Then my SearchType B witch is in a module catches the URL variable my_field=2 and displays a result based on it. This works fine but if my SearchType A is configured to redirect to content (in the case the result is just one) the URL variable is not displayed in the URL so my Search Type B doesn't works. Is there any way to make this works?

Thanks a lot

Get a VIP membership
4229 Posts
Kadministrator
7 years ago
2
Level 1

You should also add your custom variable to the link to content on the list A

151 Posts
jimenaes
7 years ago
1
Level 2

Hi Klas

I added my custom variable to the link but can't make it works. In this Seblod version the list menu type has the option

"Auto Redirection (Vars)" I think that what I need but I don't understand how to fill it right. The tooltip says [variable=value] but I need to use variable=variable, something like custom_variable_name=uri_id

4229 Posts
Kadministrator
7 years ago
0
Level 3

I'm afraid there is no built-in way to do this, redirect vars only work for form and with fixed values.

One way around it would be to write your custom variable to the user session storage (https://docs.joomla.org/How_to_use_user_state_variables )

in the first search using one of the events (before render should work), then get this variable in the second search using the same event and getUserStateFromRequest and set JInput variable with the same name using that value, this way seblod would think this variable is set in the url.

Please not this is just an idea, it migh be it won't work due to the execution order e.g. if seblod grabs its input variables before event is executed.

4229 Posts
Kadministrator
7 years ago
0
Level 1

You should also add your custom variable to the link to content on the list A

Get a Book for SEBLOD