Forum


Component LisQuery in Module

Nappée
3%
Posts: 3
General
July 08, 2022

Hello, what I'm trying to do is to retrieve the result of my component's search via the getListQuery model in a module that I created in order to be able to activate JavaScript filters on this same result. Can anyone help me for this?

Joomla Fry
100%
Posts: 947
July 08, 2022

Hello

You can save the result of component's search in session variables.

In the module, you can get the result from the session.

Nappée
3%
Posts: 3
July 12, 2022
hello thank you for your interest in my question. How and where to create this session variable?
Joomla Fry
100%
Posts: 947
July 14, 2022

You can create session or state variables in view file after getting items.

Here is guide on how to create:

https://docs.joomla.org/How_to_use_user_state_variables

 

Nappée
3%
Posts: 3
July 15, 2022
Great, Thank you for your help. I have used the getSession //Array Genres $genres= $db->setQuery($query)->loadcolumn(11); $count_genres = array_count_values($genres); Factory::getSession()->set('genres',$count_genres); and get in view with $genres= $session->get('genres'); now I have to create in javascript the function to update the content of the component
Login to Reply