Skip to main content

I’m having some trouble with a dynamic emial i’m building using an xml field.

the feek is setup as the below:

feeds.Shopping.Products.Product|slice:':3'
alias Reccomendz

and the code is 
{% if person|lookup:'most_like_product' in Reccomendz.ProductName %}
<div style="padding: 10px!important; font-weight: 600; font-size: 16PX;">
{{Reccomendz.ProductName}}
<br /></br.>
{ Reccomendz.ProductPrice }}
</div>
{% endif %}


My problems
Problem 1:
when i use |slice 3, it only seems to read the first 3 items in the xml list instead of displaying the first 3 items. am i using this correctly or is theire another tag i should be using?

Problem 2:
When i don’t use |slice 3 it seems to generate a blank section for all the data fields that don’t match the criteria (200 other products) increasing the file size from 70kb to 2000kb (and crashing my machine). is there a way to end the loop after it has found the 3 products, so it doesnt generate the extra sections?

 

 

 

Hi @MrSidney

I found a support ticket about this issue and that you had found a solution - if you are able, please share back your solution to the community. Thank you! 

~Chloe


Problem 1:
hypothesis correct and it only displays the first the objects in the xml rather thank the first 3 opjects that match the criteria.

 

Problem 2:
stopped using the content repeat module and manually coded if/else statements.


Reply