41 Posts
mlep
7 years ago
Topic

Hi everybody, I need some help please !

I have a search form (on a cck_store_form_A table) with a select joomla article related field. This field is the id of a cck_store_form_B table which contain the title and a radio field (1/0).

How could I hide some item title when radio field value is 1 ?

Thanks in advance !

Get a VIP membership
1283 Posts
Bucklash
7 years ago
1
Level 1

Hi mlep

Have you tried the search join field?

Table a stores the id of content in table b.....

... so use a join on these tables...

... it would look something like this in the field (unless it's changed)

id | table b | table a | article-related

Then create a field that pulls in table b.radio-select-field

and set live value to 1 as that is what you want to filter

Then have this field hidden

You might have to muck around with match settings 

Jon

4229 Posts
Kadministrator
7 years ago
0
Level 2

Second table will automatically get joined if you add radio field from second table to the search, so you jsut need to set right matching and live value 1 on this field.

41 Posts
mlep
7 years ago
0
Level 1

Thanks Jon, thanks Klas for your replies.

My explanations were not clear enought. I would hide selection titles in joomla article related field (those that are marked as 1 in table B).
Maybe with a WHERE condition in a dynamic selection field ? Something like

SELECT DISTINCT #__content.title AS text, #__cck_store_form_A.a_id AS value
FROM #__cck_store_form_A
JOIN #__content
ON #__cck_store_form_A.a_id=#__content.id
JOIN #__cck_store_form_B
ON #__cck_store_form_A.a_id=#__cck_store_form_B.id
WHERE #__cck_store_form_B.marker!=1
ORDER BY #__content.title ASC

But I get no result...
Thanks again for helping

4229 Posts
Kadministrator
7 years ago
1
Level 1

If you copy-pasted this query then you have a typo, space is missing after form_B.marker

41 Posts
mlep
7 years ago
0
Level 2

Thanks again Jon and Klas. It was simple but I have searched a few hours...

Here is the way I got to the result I wanted :

In a dynamic select field, I put this free SQL :

SELECT t0.title AS text,t0.id AS value
FROM #__content AS t0
LEFT JOIN `#__cck_store_form_B` AS t1 ON t1.id = t0.id
WHERE t0.catid = 12
AND t1.marker NOT LIKE '%1%'
ORDER BY t0.title ASC

Regards

Marion

Get a VIP membership