99 Posts
SimonD
7 years ago
5
Topic

Hello everybody,

My question is related to a previous post solved with the help of Klas and Bucklash (thank you to both of them).
I've preferred to open a new thread to keep things simple.
Please read first https://www.seblod.com/community/forums/lists-search-types/how-to-display-a-list-of-items-chosen-manually#post52523

In my product content type, I can now display a list of related products chosen in a dynamic select field from my backoffice admin form.

The problem now is that if I don't choose any related product, all products of my Joomla! category dedicated to product articles are listed in the list field of the product content type. Which seems logic because there is no article id to filter the list.

Is there a way to display nothing (hide the liste or display an empty list) if no related product(s) are selected ?

Thank you for your help.

Get a Book for SEBLOD
4229 Posts
Kadministrator
7 years ago
4
Level 1

Try setting art_id default value (or live value not sure which one is overridden by value transferred from parent) to something that is never true eg. 0.

99 Posts
SimonD
7 years ago
3
Level 2

Hello Klas,

Thank you for your support.

It is working when setting default value for the Article ID field to 0.

I can't make it work with live value.

Article ID is used in many other fields, I hope this setting will not broke anything else.

I would like to notice that this default value can be overriden in a Seblod list menu: typing a space in Article ID field and I get back all my products (don't know if it is logical).

I find it very interresting because I can manage many display fo list products with only one list (no duplication of lists, more concistancy in list template…).

Regards

1283 Posts
Bucklash
7 years ago
2
Level 3

Hi

Article ID is used in many other fields, I hope this setting will not broke anything else.

You can always create a new field with same storage....

99 Posts
SimonD
7 years ago
0
Level 4

HI Bucklash,

Thank you for the tip. I will try it.

Regards

99 Posts
SimonD
7 years ago
0
Level 4

Hello community,

I have followed Bucklash suggestion and created a text field with Standard/Article/id storage.

It is working but be carefull to remove Joomla! Article ID from you form.
If not you will get 'Same alias already exists' error message and you can't modify your content.

Regards

Get a VIP membership