Developer forum

Forum » Ecommerce - Standard features » Label values for List Type fields in Facets

Label values for List Type fields in Facets

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Guys,

I might have reported this before, I thought this is gonna be fixed in newer version but it looks like it's just partially fixed.

I am running 8.9.1.13.

I have an index and I have a few Product Category Fields set as facets.

On this specific example I have 3 fields. All 3 are of type ListBox.

First one is of type. First one is a RadioButton List, Second one is Multiselect List, Third one is Checkbox List.

All of them have labels and values. Values do not contain spaces while label do.

In the facet options, only the second one retrieves labels correctly. Both Radiobutton list and Checkbox list use values as labels.

I have tried excluding the fields from chema and store them without analysis but I got the same result.

I believe it's decent to assume the same behavior for all 3 fields, meaning Facets should use Labels instead of Values.

I need to knwo if this is scheduled for a fix in the near future. I don't see anything specific to this issue in 8.9.1.14.

Thanks,

 Adrian


Replies

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

One more addition to this.

I have noticed that Multiselect type does not ensure the labels will be rendered correctly.

The first field in my example has the following options:

30 lbs - 30lbs

60 lbs - 60lbs

...... you get the ideea. These options are always rendered as values (without spaces).

On the other hand, the multiselect field has these options:

POS Integrated - POSIntegrated

Stand Alone - StandAlone

......

These are alway rendered with the correct label, with spaces.

I was just wondering if maybe it has something to do with labels beginning with numbers?

Thanks,
Adrian

 
Nicolai Pedersen
Reply

Hi Adrian

We will just check it out and see if there is something odd in there... Will get back

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Thank you Nicolai.

If it helps, here is an example: http://mnmel.dw-demo.com/products/peripherals/scales

Integration is the MultiSelect one, the first one is RadioButton and the last one checkbox.

The first facet is excluded form Analysis. I have also tried changing the Field type from Radiobutton list to Multiselect but I got the same result.

Thanks,

Adrian

 
Nicolai Pedersen
Reply

Hi Adrian

Thanks - I think we have it reproduced. It is a tricky one because of the way we name and index these types of fields. So it is a little nasty to fix (if not impossible without a index rebuild). Anyways, we are on it and will get back.

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Thank you Nicolai.

Any solution for getting the labels from the API instead of Index?

Something like GetFacetLabel(string FacetSystemName, string FacetValue) ?

It's probably not efficient on large solutions but for small sets of facets and values, probably it can work without a major overhead.

Thanks,

Adrian

 
Nicolai Pedersen
Reply

Hi Adrian

If you avoid having [space] in System name for product category fields and groups, it will work... Problem is that those spaces are replaced with _ when indexed and  because of a some weird other handling of the values and label, this becomes an issue.

Capture.PNG
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

That's a very good insight.

I will make sure they won't define the system names with spaces.

I know I have warned them about this, and that's why I have not checked this first.

I will see if I can make the changes directly in the database.

Thanks,

Adrian 

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I have checked in my example and it looks like we don't have any spaces in system names:

ProductCategory SystemName: Scales

Field 1 SystemName: Weight_Capacity

Field 2 SystemName: Integration

Field 3 SystemName: Label_Printing

It looks like "_" is also not recommended in SystemNames

Thanks,
Adrian

 

 
Nicolai Pedersen
Reply

Yes, spaces in systemnames are replaced with _ and that _ is the problem. So you cannot use _ as well of course...

 

You must be logged in to post in the forum