Hi is there any way to get the image patterns and standard image to work with a product no. that includes a forward slash ? We have a client with a sudstantial amount of products that are formatted like this example [123-abc/21] These images do not show in the PIM module or the front end. We made a custom function for the front end in a previous project but now the customer is using the PIM moduel it would be nice to get all the images there as well and not use a custom string formating function in the front end. Any thoughts, work arounds? It would be surprising if our client was the only one including / or - in the product no.
Developer forum
E-mail notifications
Image patterns with /
                                                            
                        Jonathan Pascoe
                    
                    
                                                    
                            
                                                    
                        							
                                                    
                                                    
                            
                            
                    Replies
                                                            
                            
                        
							Nicolai Pedersen 
							
						
						
															
								
								
															
															
															
								
								
								
						
								Posted on 21/12/2022 08:47:20
							
							
						This post has been marked as an answer
						Forward slash is an issue since it is a path character and not valid for filenames. So we do not have support for it.
You can create an imagepattern extender by inheriting ImagePatternExtenderBase - it has to methods - ReplaceImagePath and ReplaceFilePath that can be used to manipulate the image pattern lookup before and after the pattern is matched to files. This will work in backend and frontend.
An alternative is to create a custom field and normalize the SKU to something file friendly and use that field instead of SKU to do the pattern match.
BR Nicolai
									Votes for this answer: 2
								
																	
								
							
					
                                                        
                        
							Jonathan Pascoe 
							
						
						
															
								
								
															
															
															
								
								
						
								Posted on 27/12/2022 14:55:52
							
							
						Ok thanks.
                                                        
                        
							Tomas Gomez 
							
						
						
								Posted on 16/02/2023 12:25:12
							
							
						Same issue here, thanks for the alternatives :-)
                                                        
                        
							Kim Søjborg Pedersen 
							
						
						
								Posted on 22/02/2023 11:14:12
							
							
						Yes of course :)
You must be logged in to post in the forum