Developer forum

Forum » Rapido » Wrong value in templatetag Ecom:Product:Field.Segment.Label. Dw 9.12.9 - Rapido 3.4.2

Wrong value in templatetag Ecom:Product:Field.Segment.Label. Dw 9.12.9 - Rapido 3.4.2

Tobias Nordvig
Reply

Hello 

I am running a DW version 9.12.9 and Rapido version 3.4.2. 
When trying to access the template tag Ecom:Product:Field.Segment.Label I receive the Value of the field and not the name.


However when I add TemplateTags() to the code I receive the correct name from the otherwise same code. 


I have tried accessing the field through other means but receive the same outcome. It seems like a bug but maybe there is a workaround of some sort?
I hope someone has a fix for this :)

Kind regards 
Tobias Nordvig 
 


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Tobias

I think I can find my way through code where this can happen. Try adding one of these lines to your code:

  • var loop = product.GetLoop("Segment.Options")
  • var loop = product.GetLoop("Product.CustomField.Options")

The loop name you need might be different - you should be able to locate the correct string when using TemplateTags("Options") to the template (will list all tags and loop with the name options in them)

Both of these creates a varialbe with a loop item - you do not need it, but it should trigger your label tag to be filled correctly.

This is a workaround.

Instead of doing a split on "Field.Segment.Label", you could loop the options instead.

BR Nicolai

 
Tobias Nordvig
Reply

Hi Nicolai

Thanks a lot. Storing the loop in a variable does the trick and fills the field with the correct value. 

Kind regards
Tobias 

 

You must be logged in to post in the forum