99 Posts
SimonD
7 years ago
6
Topic

Hello everybody,

I'm working on a 'standard' product content type:

  • product name field
  • image field
  • description field

I would like to add in my content view a list of related products.

These products would be chosen 'manually' in the backend admin form (I would like to let the admin choose the most appropriate items). 

I think that could be done with a dynamic multi select field set to fetch all the articles from the product category (where catid=some_id). I've called it 'prod_prodrelated'. I've chosen a semi colon (';') as the separator.

For now, I'm not sure how to display the list of the chosen related products in the product content view.

I've tried with a list field (https://www.seblod.com/store/extensions/8538) but I can't make it working.

Here is my trial:

  • I've created a list & search type from my product content type.
  • In the search form view I've added the dynamic muti select field created above ('prod_prodrelated')
  • I've left match mode to permissive
  • In the product content type content view I don't forget to add the art_id field
  • In the product content type content view I've added a list field
    • in the field & search type section I've wrote the name of my products list & sarch type (created abobe)
    • in the fields section I've wrote: prod_prodrelated=art_id

As I said it is not working: first I have no result, after playing with match modes related products are displayed but in a non logical way (products not chosen are displayed or some products chosen don't display).

Any idea?

Thank you

Get a Book for SEBLOD
1283 Posts
Bucklash
7 years ago
1
Level 1

Hi

My ideas:

Have you created a menu item to see if the search works ie not nested in a content view. 

One other way is to use fieldx.....

Have you got debug turned on.... what does it say?

99 Posts
SimonD
7 years ago
0
Level 2

Hi Bucklash,

Thank you for taking some time to scratch your head about my question.
It seems that Klas found what I have made wrong.

4229 Posts
Kadministrator
7 years ago
1
Level 1

I think you placed prod_prodrelated and art_id in the reverse order.

prod_prodrelated Should be on the content view and art_id in the search type displayed in the lists field with matching set to Any words exact (don't forget to set separator in this matching, you need to click on +)

99 Posts
SimonD
7 years ago
0
Level 2

Hello Klas,

Thank you for your support.

I have followed you suggestion and it is working as excepcted now. Thank you.

But it seems that I have not understand how the construction of fields parameter of the list field is working.

Although I have read several times this tutorial (https://www.seblod.com/resources/tutorials/create-a-dynamic-list-within-a-list-item).

Could you explain how to well asjust the list field especially, for the Construction/Fields part?

Thank you.

4229 Posts
Kadministrator
6 years ago
1
Level 1

FIelds is  an option to pass parent values to child list. You put in filed names that need to be passed on and target field name, in you case parent value stored in article is prod_prodrelated, you then pas this value to list to use it to search on art_id value.

99 Posts
SimonD
6 years ago
0
Level 2

Thank you Klas

Get a VIP membership