Developer forum

Forum » Feature requests » Dynamic image loop pattern

Dynamic image loop pattern

Jakob Westhausen
Reply

Our customers wish to upload productimages to a specific folder without the hassle of afterwards attaching the image to each product. This works fine when using the productnumber and only one image per product. But the best SEO filename requires a fully description of the product by combining the product name, brand name and if available the variant name eg: "avenue-broadway-xm-citybike-sort-46cm.jpg".
In case of multiple productimages a loop should be available and the filename could look like this:
"avenue-broadway-xm-citybike-sort-46cm.jpg"
"avenue-broadway-xm-citybike-sort-46cm_1.jpg"
"avenue-broadway-xm-citybike-sort-46cm_2.jpg"
"avenue-broadway-xm-citybike-sort-46cm_3.jpg"

Maybe an extension of the "Use alt. images" could do the trick.
http://cl.ly/image/2e1K3I3k3k0F

Pattern:
/{ProductName}-{ProductManufacturer}-{VariantName}_{loopCounter}.jpg

Code:
@{
  var imageLoop = GetLoop("loopCounter")

  if( imageLoop.Any() ) {
    <ul class="some-slider">
      @foreach( var slide in imageLoop ) {
        <li><img src="@slide.Url" alt="@slide.Name"></li>
      }
    </ul>
  }
}

Best regards

Jakob Westhausen


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Jakob

Thank you for the input. We are actually looking at how we can improve the handling of images on products this week and what to do for 8.7, and will take this idea into consideration.

If others have ideas for improving images/medias for products, please let us know!

BR Nicolai

 
Nuno Aguiar
Reply

Hi Nicolai,

 

Looking back at this and apppending to another one which is "variant constants". Ex: Shoes shop, Size and Material variant groups

 - We can have multiple variant combinations for the same size

 - We should be able to set the following pattern /{ProductName}-{ProductManufacturer}-{Variant_Constant_Name}.jpg

  (Variant_constant_name would be , "Black" for example)

 

We normally also tend to set the following rules to images:

List templates: Small, Medium, Large, pattern

Product detail templates: Large, Medium, Small. pattern

 

This allows the default behaviour to be the patterns, but also have some logic/flexibility in the interface. I have no particular suggestion, just thought I might share how we do things. Might trigger someone a suggestion and/or better way to handle this.

 

Best Regards,

Nuno Aguiar

 
Nicolai Høeg Pedersen
Reply

Hi Nuno

This has already been made for 8.7 - you can do some really nice stuff with the image patterns.

 
Nuno Aguiar
Reply

Hi Nicolai,

 

Thanks. Lookng forward to see 8.7

 

Nuno