Developer forum

Forum » CMS - Standard features » Is there a quick way of assigning a photo, and product text to all products in one group?

Is there a quick way of assigning a photo, and product text to all products in one group?

Hans Ravnsfjall
Reply

We have a costumer that has a webshop, containing 3 product groups. All products that are in a group, shall have the same image and the same product text - if not a product specific text and image has been specified on a product. Is there a way to solve this?

Something like a default image and text for all products in a group, or maybe something like inheritance?

I can not use variants, because the variable field is a DateType field.

Altough products can be in many groups in Dynamicweb, in this specific case - a product will always only be in one group.

I display the products in a productlist, using the productcatalogue and product smart search.

 

Anyone have some information that could help me solve this, so that the editor won´t have to add the same text and pictures to 60+ products?


Replies

 
Nicolai Høeg Pedersen
Reply

My best option would be to add custom fields to the group containing the information.

In the product list template, take that information and put in a variable and inside the product loop, use those variables if the product does not have information.

Has to be done in Razor.

BR Nicolai

 
Hans Ravnsfjall
Reply

Ok, would i be able to call it in the Product list renderer?

Not sure I understand

If i eg. makea custom group field, with the tag GroupDefaultImage

Would I be able to call this in the product list renderer, with a command like

string imagedefault = GetString("Ecom:Group:GroupDefaultImage");

And this would have to be inside a product loop?

(I´m sure my code above is not correct, but is just pseudo for ellaborating my quesion)

 

 

 
Nicolai Høeg Pedersen
Reply

Hi Hans

Yes, with Razor templates you are not limited to your current loop contex. You can just create that variable outside the products loop and use it inside the loop.

 

You must be logged in to post in the forum