Developer forum

Forum » Swift » Media Item type - Swift_ProductDetailsImage.cshtml Not including Default Image

Media Item type - Swift_ProductDetailsImage.cshtml Not including Default Image

Pedro Meias
Reply

Hi

DW 9.17.5

Swift 1.26.6

The Media Item type - Templates/Designs/Swift/Paragraph/Swift_ProductDetailsImage.cshtml is not including the Product Default Image

Here is how we have the Product Assets Configured (It only has the Primary Image and Image Patterns)

And the Paragraph Configurations

Thank you.

 

 


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Yes it does:

 

Mayeb test things on latest version of Dynamicweb instead of older.

Please describe the issue you experience and steps to reproduce.

 

 
Pedro Meias
Reply

Hi Nicolai,

Sorry my initial explanation was not good enough. I will try to break it down.

We do have a product that has only Image Patterns (screenshot on original description).

So these 2 lines are returning an empty collection since the product has no Asset Categories and only Image Patterns

After that the Image Patterns are added to assetsList collection

But then on this last line because assetsList already has the ImagePatterns, the condition assetsList.Count() == 0 is False and the default Image is not appended to the collection.

We reached the end of these Lines with the DefaultImage not in assetsList collection.

Let me know if this helps.

Thank you.

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

And how are your settings on that paragraph/component?

E.g. is ImagePatternImages true or false? Is DefaultImageFallback = true? Is ShowOnlyPrimaryImage = false?

You can try to fiddle with those 3 settings as they might affect which images comes out.

 

You must be logged in to post in the forum