215 Posts
iliil
7 years ago
Topic

Hello.

I'm using the search join table plugin a lot for  various search criteria filtering and it's really great. But is there a way to display the values of joined DB table in the list view?

So far, I use the SEBLOD SQL query plugin for displaying the values of another tables in the list view but that makes a special DB request for every row. I guess, once the additional table is joined by search join table plugin it should be possible to display the values in the list view but I can not make it working.

Thanks for any help.

Michal

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

I think it should work if you add a field with Standard-Free-databsecolumn storage for each column you wish to display.

215 Posts
iliil
7 years ago
3
Level 1

Thanks for your advice, Klas.

The situation is even more complicated because I need to dispaly Article titles of joined #__content table. That meens I need 2 article titles on one row. I am almost there, just the last step.

After some experimentation I've been able to successfully join another #__content table (using the Query AKA in Join table plugin - eventhough I have no idea what is the AKA for) in Join Table Plugin

I was also able to select the column itself  appending the SELECT using Search Query Plugin

So the final request is perfectly OK!

I just have no idea how to make the field display in the list!

When I create a field with the sotrage Standard FREE title (#__content), it displays the first article title, not the joined one.

Thanks again for a possible help.

Michal

4229 Posts
Kadministrator
7 years ago
2
Level 2

You need to add new text field to the list with storage Standard-Free-test_def_firma

215 Posts
iliil
7 years ago
1
Level 3

Oh. Thaks so much Klas, as always ;).

That's great that this is possible! I can't apply it now as the web is already live but good to know for future. I'm sure other developers appreciate this trick, too.

Thanks again!

Michal

4229 Posts
Kadministrator
7 years ago
0
Level 4

Just figured it out today as I need it for one of my projects :)

121 Posts
deralex
7 years ago
2
Level 1

I need something similar: I'd like to join 2 tables. SQL looks fine, searching in the second table for a field's value works. How can I show this value in the list item?

215 Posts
iliil
7 years ago
1
Level 2

Hello deralex.

Maybe Klas (or somebody else)  will correct me but what I Iearned at this forum was, that this is not possible. Searching and rendering are two different thinks. As far as I know the only way to get value from joined table is using SQL field. 

Michal

41 Posts
jukov_b1
6 years ago
0
Level 3

to iliil i think no. SQL fiel must generate +1 sql query for every record. Then nothing using join table.field 

41 Posts
jukov_b1
6 years ago
1
Level 1

Hi. 

I ask to help to understand not normal delivery of a field from table LEFT JOIN

What I did 

1. compiled LIST SEARCH on the basis of FREE 

2. displayed the fields of interest, they are all from GROUP_CHILDREN 

3. Attached through the plug-in SEARCH JOIN table CCK_CORE 

Now I want to output the field CCK_CORE in LIST VIEW I receive here such here result: 

where the CCK field took the values article, workbook, article (ID in title colum this my mistake, trash of my more experiments)(right title CCK :)

4. looked up joomla requests and found this 

5. Now the result is compared 

The last query returns the correct values of the attached fields I have no idea why this is so? 

and how to display the attached fields correctly. studied the response of KLAS from the post above: "I think it should work if you add a field with the standard-free-databsecolumn storage for each column you wish to display." but the result is such, incomprehensible 

1. Help to understand the result. 

2. And how to get it right.

Thank you.

41 Posts
jukov_b1
6 years ago
0
Level 2

after one more experiment I am surprised even more :) I have removed any my fields plugin join but in inquiries seblod I still see

leaves obvious communication of table1.id=cck_core.pk seblod carries out now always? but here with a conclusion of fields there was still not a clear situation. I will be grateful for the comment under my assumption

4229 Posts
Kadministrator
6 years ago
2
Level 1

To show values retrieved using search JOIN you will also need search query field so you can add a column to the WHERE part with some unique alias, e.g. to display t1.id (t1 is an alias of your #__cck_group-children table) you would add "t1.id as tid" to the where part. Then you can show tid value in the list by adding a text field with storage Standard-Free-tid (don't select any table in the last dropdown!).

41 Posts
jukov_b1
6 years ago
1
Level 2

Klas thank you for answer!)

Is it possible to use the field for AND in the SEARCH JOIN plugin to save on the lines of code? 

Does the addition of the SEARCH QUERY plugin cause an excess of sql requests in the size of [main resolve] * [searchquery for field]? 

could you briefly describe the place of SEARCH QUERY in the life cycle?

Thank you for attention!

4229 Posts
Kadministrator
6 years ago
0
Level 3

Get a Book for SEBLOD