Shopware 6 TWIG / HTML Syntax question csv feed komma separated - csv

i am building a twig template for shopware 6 productfeed for ebay.
If i separate the template with semicolon, all the rows and columns are clean and sorted. If i change the delimiter to comma it gets screwed :-/ Can someone check my code and help me with the right html syntax? I think something with the divs and ul's and li's have to be enclosed ?#
After rendering the template with products (some have commas in the description) the feed gets extra columns and so on i guess something with the desription part has to be faulty.
`
"{{ product.productNumber }}",{#- -#}
"de_DE",{#- -#}
{%- if context.extensions.digahoodextension.varianttitles[product.id] is defined -%}
"{{ product.translated.name|length > 60 ? product.translated.name|slice(0, 85) : product.translated.name }} {{ context.extensions.digahoodextension.varianttitles[product.id]|length > 60 ? context.extensions.digahoodextension.varianttitles[product.id]|slice(0, 85) ~ '...' : context.extensions.digahoodextension.varianttitles[product.id] }} {% if product.customFields.custom_hoodtitle_title is defined %}{{ product.customFields.custom_hoodtitle_title }}{% endif %}",{#- -#}
{% else %}
"{{ product.translated.name|length > 120 ? product.translated.name|slice(0, 85) ~ '...' : product.translated.name }} {% if product.customFields.custom_hoodtitle_title is defined %}{{ product.customFields.custom_hoodtitle_title }}{% endif %}",{#- -#}
{%- endif -%}
,{#- -#}
"{{ product.translated.description|replace({"\n":' ', "\r":' ','"':'""'})|raw }}",{#- -#}
,{#- -#}
,{#- -#}
"{{product.cover.media.url}}",{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(2,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(3,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(4,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(5,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(6,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(7,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(8,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(9,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(10,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(11,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(12,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(13,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(14,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(15,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(16,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(17,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(18,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(19,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(20,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(21,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(22,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(23,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(24,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%},{#- -#}
,{#- -#}
,{#- -#}
{%- if product.ean is defined and product.ean is not null -%}"{{ product.ean|u.truncate(16) }}"{%- endif -%},{#- -#}
"{{ product.productNumber }}",{#- -#}
{%- if product.manufacturer is not null -%}
"{{ product.manufacturer.name }}"
{%- endif -%},{#- -#}
,{#- -#}
{% for properties in product.properties|slice(1,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(1,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(2,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(2,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(3,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(3,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(4,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(4,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(5,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(5,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(6,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(6,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(7,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(7,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(8,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(8,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(9,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(9,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(10,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(10,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(11,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(11,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(12,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(12,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(13,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(13,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(14,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(14,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(15,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(15,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(16,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(16,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(17,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(17,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(18,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(18,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(19,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(19,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(20,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(20,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(21,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(21,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(22,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(22,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(23,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(23,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(24,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(24,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(25,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(25,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(26,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(26,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(27,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(27,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(28,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(28,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(29,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(29,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(30,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(30,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(31,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(31,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(32,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(32,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(33,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(33,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(34,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(34,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(35,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(35,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(36,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(36,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(37,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(37,1) %}{{ properties.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(38,1) %}{{ properties.group.name }}{% endfor %},{#- -#}
{% for properties in product.properties|slice(38,1) %}{{ properties.name }}{% endfor %},{#- -#}
"NEW",{#- -#}
,{#- -#}
"METRIC",{#- -#}
{%- if product.length is defined and product.length is not null -%}{{ product.length/10 }} cm{%- endif -%},{#- -#}
{%- if product.width is defined and product.width is not null -%}{{ product.width/10 }} cm{%- endif -%},{#- -#}
{%- if product.height is defined and product.height is not null -%}{{ product.height/10 }} cm{%- endif -%},{#- -#}
{%- if product.weight is defined and product.weight is not null -%}{{ product.weight|round }}{%- endif -%},{#- -#}
"0",{#- -#}
,{#- -#}
"{{ product.stock }}",{#- -#}
"EBAY_DE",{#- -#}
"{%- set break = false -%}{%- for pc in product.categories -%}{%- if break == false -%}{%- if pc.customFields -%}{%- if pc.customFields.diga_ebay_category_field is defined and pc.customFields.diga_ebay_category_field is not null -%}{{ pc.customFields.diga_ebay_category_field }}{% set break = true %}{%- endif -%}{%- endif -%}{%- endif -%}{%- endfor -%}",{#- -#}
,{#- -#}
"shipping",{#- -#}
"payment",{#- -#}
"return",{#- -#}
,{#- -#}
,{#- -#}
,{#- -#}
{%- if context.extensions.digahoodextension.prices is defined and context.extensions.digahoodextension.prices is not null -%}{{ context.extensions.digahoodextension.prices[product.id]}}{%- endif -%},{#- -#}
`
Thanks in advance and best regards
mark
I just search and replaced the semicolons to commas this is the original code.
`
"{{ product.productNumber }}";{#- -#}
"de_DE";{#- -#}
{%- if context.extensions.digahoodextension.varianttitles[product.id] is defined -%}
"{{ product.translated.name|length > 60 ? product.translated.name|slice(0, 85) : product.translated.name }} {{ context.extensions.digahoodextension.varianttitles[product.id]|length > 60 ? context.extensions.digahoodextension.varianttitles[product.id]|slice(0, 85) ~ '...' : context.extensions.digahoodextension.varianttitles[product.id] }} {% if product.customFields.custom_hoodtitle_title is defined %}{{ product.customFields.custom_hoodtitle_title }}{% endif %}";{#- -#}
{% else %}
"{{ product.translated.name|length > 120 ? product.translated.name|slice(0, 85) ~ '...' : product.translated.name }} {% if product.customFields.custom_hoodtitle_title is defined %}{{ product.customFields.custom_hoodtitle_title }}{% endif %}";{#- -#}
{%- endif -%}
;{#- -#}
"{{ product.translated.description|replace({"\n":' ', "\r":' ','"':'""'})|raw }}",{#- -#}
;{#- -#}
;{#- -#}
"{{product.cover.media.url}}";{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(2,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(3,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(4,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(5,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(6,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(7,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(8,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(9,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(10,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(11,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(12,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(13,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(14,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(15,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(16,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(17,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(18,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(19,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(20,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(21,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(22,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(23,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
{%- if product.media|length > 1 -%}
{%- for mediaAssociation in product.media|slice(24,1) -%}
{{ mediaAssociation.media.url }}
{%- endfor -%}
{%- endif -%};{#- -#}
;{#- -#}
;{#- -#}
{%- if product.ean is defined and product.ean is not null -%}"{{ product.ean|u.truncate(16) }}"{%- endif -%};{#- -#}
"{{ product.productNumber }}";{#- -#}
{%- if product.manufacturer is not null -%}
"{{ product.manufacturer.name }}"
{%- endif -%};{#- -#}
;{#- -#}
{% for properties in product.properties|slice(1,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(1,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(2,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(2,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(3,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(3,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(4,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(4,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(5,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(5,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(6,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(6,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(7,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(7,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(8,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(8,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(9,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(9,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(10,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(10,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(11,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(11,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(12,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(12,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(13,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(13,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(14,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(14,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(15,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(15,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(16,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(16,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(17,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(17,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(18,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(18,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(19,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(19,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(20,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(20,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(21,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(21,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(22,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(22,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(23,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(23,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(24,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(24,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(25,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(25,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(26,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(26,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(27,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(27,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(28,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(28,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(29,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(29,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(30,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(30,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(31,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(31,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(32,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(32,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(33,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(33,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(34,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(34,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(35,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(35,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(36,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(36,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(37,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(37,1) %}{{ properties.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(38,1) %}{{ properties.group.name }}{% endfor %};{#- -#}
{% for properties in product.properties|slice(38,1) %}{{ properties.name }}{% endfor %};{#- -#}
"NEW";{#- -#}
;{#- -#}
"METRIC";{#- -#}
{%- if product.length is defined and product.length is not null -%}{{ product.length/10 }} cm{%- endif -%};{#- -#}
{%- if product.width is defined and product.width is not null -%}{{ product.width/10 }} cm{%- endif -%};{#- -#}
{%- if product.height is defined and product.height is not null -%}{{ product.height/10 }} cm{%- endif -%};{#- -#}
{%- if product.weight is defined and product.weight is not null -%}{{ product.weight|round }}{%- endif -%};{#- -#}
"0";{#- -#}
;{#- -#}
"{{ product.stock }}";{#- -#}
"EBAY_DE";{#- -#}
"{%- set break = false -%}{%- for pc in product.categories -%}{%- if break == false -%}{%- if pc.customFields -%}{%- if pc.customFields.diga_ebay_category_field is defined and pc.customFields.diga_ebay_category_field is not null -%}{{ pc.customFields.diga_ebay_category_field }}{% set break = true %}{%- endif -%}{%- endif -%}{%- endif -%}{%- endfor -%}";{#- -#}
;{#- -#}
;{#- -#}
;{#- -#}
;{#- -#}
;{#- -#}
;{#- -#}
;{#- -#}
{%- if context.extensions.digahoodextension.prices is defined and context.extensions.digahoodextension.prices is not null -%}{{ context.extensions.digahoodextension.prices[product.id]}}{%- endif -%};{#- -#}
`

Related

Jekyll: link next/previous sorted posts within a category

I need to generate two buttons linking to the next and the previous posts from the same category. Posts are sorted with the front-matter order and an integer value.
My solution is still not perfect. I need to exclude the previous button for the first post and the next button for the last post. However, it's not working and I can't understand why. This is my code:
{% capture the_cat %}{{page.categories | first}}{% endcapture %}
{%- assign sorted_posts = site.categories[the_cat] | sort: 'order' -%}
{%- for post in sorted_posts -%}
{% if post.url == page.url %}
{% assign post_index0 = forloop.index0 %}
{% assign post_index1 = forloop.index | plus: 1 %}
{% endif %}
{%- endfor -%}
{%- for post in sorted_posts -%}
{% if post_index0 == post.order %}
{% assign prev_post = post %}
{% endif %}
{% if post_index1 == post.order %}
{% assign next_post = post %}
{% endif %}
{%- endfor -%}
And finally...
{%- if prev_post != null -%} ... {%- endif -%}
{%- if next_post != null -%} ... {%- endif -%}
The main loop seems correct. In a category with 3 posts sorted, it returns 1, 2, 3. How can I fix it? Could be fixed with only one loop, making the code more efficient? Thanks!
PD: I used this plugin successfully, however this plugin sorts posts by date, not by order.
Finally, I got the solution:
{%- capture the_cat -%}{{page.categories | first}}{%- endcapture -%}
{%- assign sorted_posts = site.categories[the_cat] | sort: 'order' -%}
{%- for post in sorted_posts -%}
{%- if post.url == page.url -%}
{%- assign currIndex = forloop.index0 -%}
{%- assign prevIndex = currIndex | minus: 1 -%}
{%- assign nextIndex = currIndex | plus: 1 -%}
{%- assign articleIndexLength = forloop.length | minus: 1 -%}
{%- if currIndex == articleIndexLength -%}
{%- assign prev_post = sorted_posts[prevIndex] -%}
{%- endif -%}
{%- if currIndex < articleIndexLength and currIndex != 0 -%}
{%- assign prev_post = sorted_posts[prevIndex] -%}
{%- assign next_post = sorted_posts[nextIndex] -%}
{%- endif -%}
{%- if currIndex == 0 -%}
{%- assign next_post = sorted_posts[nextIndex] -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
I only needed one loop with three conditionals.

Assign products to collection based on size

I created a new collection template and I want to assign to it all products that have 'XL' size in their size variant.
I started from create and array of sizes for every product but now I'm stuck.
{% assign sizes = '' %}
{% for variant in product.variants %}
{% if variant.available %}
{% assign sizes = sizes | append: variant.options[0] | append: '_' %}
{% endif %}
{% endfor %}
{% assign sizesArr = sizes | split: '_' | uniq %}
What should I do next for showing only products that contains 'XL'?
It depends what do you mean by all products.
By default collection can show up to 50 products but you can overwrite this with a paginate object.
So if you have under 50 products you can just do this.
{%- for product in collection.products -%}
{%- assign show_product = false -%}
{%- for option in product.options_with_values -%}
{%- for value in option.values -%}
{%- assign value_handle = value | handle -%}
{%- if value_handle == 'xl' -%}
{%- assign show_product = true -%}
{%- endif -%}
{%- endfor -%}
{%- endfor -%}
{%- if show_product -%}
Add your product here
{%- endif -%}
{%- endfor -%}
If you have more than 50 products you will need to wrap the above code in paginate object:
{% paginate collection.products by 9999 %}
{%- for product in collection.products -%}
{%- assign show_product = false -%}
{%- for option in product.options_with_values -%}
{%- for value in option.values -%}
{%- assign value_handle = value | handle -%}
{%- if value_handle == 'xl' -%}
{%- assign show_product = true -%}
{%- endif -%}
{%- endfor -%}
{%- endfor -%}
{%- if show_product -%}
Add your product here
{%- endif -%}
{%- endfor -%}
{% endpaginate %}
But this request will take a toll on the server and slow down your site. So please consider this issue as well.

Accessing an array with a variable in Jekyll/Liquid templating

I have the following code in my template:
{% for post in site.posts %}
{% capture num_colors %}{{ site.colors | size }}{% endcapture %}
{% capture color_index %}{{ forloop.index0 | mod: num_colors }}{% endcapture %}
<a href="{{ post.url }}" class="post-box" rel="bookmark" title="{{ post.title }}">
<div class="post-block {{ site.colors[color_index] }}">
<div class="contents">
<div class="cat-tag">
{{ post.categories[0] | upcase }}
</div>
<h2>{{ post.title }}</h2>
</div>
</div>
</a>
{% endfor %}
This keeps returning nothing: {{ site.colors[color_index] }} even though num_colors, color_index, and site.colors will all return the correct things when I try and print them.
colors is defined in my _config.yml as:
colors: [light_blue, coral, yellow, teal, blue, deep_blue]
I'm using a plugin to get modulus. Basically I just want to attach a class for each post that will start over when its gone beyond the total number of colors. This seems straightforward so I'm confused.
Replace
{% capture num_colors %}{{ site.colors | size }}{% endcapture %}
{% capture color_index %}{{ forloop.index0 | mod: num_colors }}{% endcapture %}
by :
{% assign num_colors = site.colors | size %}
{% assign color_index = forloop.index0 | modulo: num_colors %}

How can I add a drop down menu to my big cartel site?

I would like to add a dropdown menu to my big cartel site.
On Big Cartel you create categories using Big Cartel's dashboard. These categories can be used to create a drop down menu. This much I know. While trying to adjust the code, I noticed Big Cartel's category options are going into the sub-navigation as a drop down.
I want the sub-navigation to appear as a drop down navigation menu under the navigation link "Jewelry". It would be listed like this:
Jewelry
-- Earrings
-- Necklaces and sets
-- Rings
-- Arm candy
A similar dropdown menu design I am going for is like one on www.fashionative.com "Accessories".
Here is the code for my layout
{{ ---------------------------BEGIN HEADER NAVIGATION--------------------------- }}
{% capture Main_Header_Links %}
{% assign: current_page = page.name %}
{% for page in pages.all %}
{% unless page.name contains '-hide-' or page.name contains '-footer-' or page.name contains '-sidebar-' or page.name contains '-subnav-' or page.name contains '-content_block-' %}
{% if page.name == current_page %}
<li class="block current-page">
{% else %}
<li class="block">{% endif %}<span>{{ page.name }}</span></li>
{% endunless %}
{% endfor %}
{% if page.full_url contains '/contact' %}
<li class="current-page">
{% else %}
<li>
{% endif %}
{{ pages.contact | link_to }}
</li>
{% endcapture %}
{% capture Category_Links %}
{% for category in categories.all %}
{% assign parent_cat_name = category.name %}
{% assign parent_cat_url = category.url %}
{% capture sub_cat_list %}
{% for cat2 in categories.active %}
{% unless cat2.name == parent_cat_name %}
{% capture parent_cat_string %}{{ parent_cat_name }} - {% endcapture %}
{% capture parent_cat_url_string %}{{ parent_cat_url }}-{% endcapture %}
{% if cat2.name contains parent_cat_name %}
{% assign has_sub_cats = 'true' %}
{% capture new_sub_cat_name %}{{ cat2.name | replace_first: parent_cat_string, "" }}{% endcapture %}
{% if cat2.url contains parent_cat_url_string %}<li>{{ cat2 | link_to: new_sub_cat_name }}</li>{% endif %}
{% endif %}
{% endunless %}
{% endfor %}
{% endcapture %}
{% unless category.name contains ' - ' %}
<li><span>{{ category.name }}</span>{% if has_sub_cats == 'true' %}<ul id='sub-categories'><div id='subcat-container'>{{ sub_cat_list }}</div></ul>{% endif %}</li>
{% endunless %}
{% assign has_sub_cats = 'true' %}
{% endfor %}
{% endcapture %}
{% capture Alternate_Category_Links %}
{% for category in categories.all %}
{% assign parent_cat_name = category.name %}
{% capture sub_cat_list %}
{% for cat2 in categories.active %}
{% unless cat2.name == parent_cat_name %}
{% capture parent_cat_string %}{{parent_cat_name}} - {% endcapture %}
{% if cat2.name contains parent_cat_name %}
{% assign has_sub_cats = 'true' %}
{% capture new_sub_cat_name %}{{ cat2.name | replace_first: parent_cat_string, "" }}{% endcapture %}
<li>{{ cat2 | link_to: new_sub_cat_name }}</li>
{% endif %}
{% endunless %}
{% endfor %}
{% endcapture %}
{% unless category.name contains ' - ' %}
{% if page.full_url contains 'product' or page.full_url contains 'category' or page.full_url contains 'artist' %}
<li class="current-page">
{% else %}
<li>{% endif %}<span>{{ category.name }}</span>{% if has_sub_cats == 'true' %}<ul class='category-dropdown'>{{ sub_cat_list }}</ul>{% endif %}</li>
{% endunless %}
{% assign has_sub_cats = 'false' %}
{% endfor %}
{% endcapture %}
<div id="header-navigation">
<ul>
{% if page.permalink contains 'home' %}
<li class="current-page">
{% else %}
<li>{% endif %}<span>Home</span></li>
{% if page.full_url contains '/product' or page.full_url contains 'category' or page.full_url contains 'artist' or page.full_url contains '/cart' or page.full_url contains '/cart' or page.full_url contains '/new' or page.full_url contains '/sale' or page.full_url contains '/latest' %}
<li class="current-page">
{% else %}
<li>{% endif %}<span>Jewelry</span>
{% if Categories_in_Nav_Display contains 'down' %}<ul class="category-dropdown">{% for page in pages.all %}{% if page.name contains '-subnav-' or page.name contains '-sidebar-' %}<li><span>{{ page.name | remove: '-sidebar-' | remove: '-subnav-' }}</span></li>{% endif %}{% endfor %}{{ Category_Links }}</ul>{% endif %}
</li>
{% if Categories_in_Nav_Display contains 'ain' %}{% for page in pages.all %}
{% if page.name contains '-subnav-' or page.name contains '-sidebar-' %}
{% if page.full_url contains 'product' or page.full_url contains 'category' or page.full_url contains 'artist' or page.full_url contains '/cart' %}
<li class="current-page">
{% else %}
<li>{% endif %}<span>{{ page.name | remove: '-sidebar-' | remove: '-subnav-' }}</span></li>
{% endif %}{% endfor %}
{{ Alternate_Category_Links }}
{% endif %}
{{ Main_Header_Links }}
</ul>
</div>
{{ ---------------------------END HEADER NAVIGATION--------------------------- }}
</div>
</div>
</div>
{{ ---------------------------END HEADER AREA--------------------------- }}
{{ --BEGIN ERROR DISPLAY-- }}
<noscript>
<div class="error" id="error">
<ul>
<li>JavaScript must be enabled to use this store!</li>
</ul>
</div>
</noscript>{% if errors != blank %}
<div id="error" class="error">
<ul>{% for error in errors %}
<li><u>Error:</u> {{ error }}</li>{% endfor %}</ul>
</div>{% endif %}
{{ --END ERROR DISPLAY-- }}
<div id="contents">
{{ ------------BEGIN SUB-NAVIGATION------------------- }}
{% capture Sub_Navigation %}
<div id="sub-navigation" >
<div id="categories">
{% capture Category_Links %}
{% for page in pages.all %}
{% if page.name contains '-sidebar-' or page.name contains '-subnav-' %}
<li><span>{{ page.name | remove: '-sidebar-' | remove: '-subnav-' }}</span></li>
{% endif %}
{% endfor %}
{% for category in categories.all %}
{% assign parent_cat_name = category.name %}
{% capture sub_cat_list %}
{% for cat2 in categories.active %}
{% unless cat2.name == parent_cat_name %}
{% capture parent_cat_string %}{{parent_cat_name}} - {% endcapture %}
{% if cat2.name contains parent_cat_name %}
{% assign has_sub_cats = 'true' %}
{% capture new_sub_cat_name %}{{ cat2.name | replace_first: parent_cat_string, "" }}{% endcapture %}
<li><span>{{ cat2 | link_to: new_sub_cat_name }}</span></li>
{% endif %}
{% endunless %}
{% endfor %}
{% endcapture %}
{% unless category.name contains ' - ' %}
<li><span>{{ category.name }}</span>{% if has_sub_cats == 'true' %}<ul class="sub-categories"><div id="subcat-container">{{ sub_cat_list }}</div></ul>{% endif %}</li>
{% endunless %}
{% assign has_sub_cats = 'false' %}
{% endfor %}
{% endcapture %}
<ul class="categories-list">
<li>{{ Category_Nav_Title_Text }}</li>
<li><span>ALL</span></li>
{{ Category_Links }}
</ul>
</div>
{{ --BEGIN SEARCH-- }}
{% capture search_form %}
<div id="search" >
<form class="form-search" name="search" action="/products" method="get">
<input id="search-input" name="search" type="text" placeholder="Search" />
<button id="search-submit" name="search-submit" type="submit" title="Search"></button>
</form>
</div>
{% endcapture %}
{{ search_form }}
{{ --END SEARCH-- }}
</div>
{% endcapture %}
{% if page.full_url contains '/product' or page.full_url contains '/category' or page.full_url contains '/artist' or page.full_url contains '/cart' or page.full_url contains '/new' or page.full_url contains '/sale' or page.full_url contains '/latest' %}
{{ Sub_Navigation }}
{% endif %}
{{ ------------END SUB-NAVIGATION------------------- }}
<div id="main">
<div id="main-content">
{% unless page.full_url contains '/product/' or page.full_url contains 'blog' %}
<h1 class="page-title">{{ page.name | remove: '-footer-' | remove: '-hide-' | remove: '-sidebar-' | remove: '-subnav-' | remove: '-f1-' | remove: '-f2-' | remove: '-f3-' }}</h1>
{% endunless %}
{% if page.category == 'custom' %}
{{ page_content | paragraphs }}
{% else %}
{{ page_content }}
{% endif %}
</div>
</div>
</div>

How to use Jekyll code in (inline) code highlighting?

How can I use for example {{ post.date | date: "%H:%M %p - %-d %b %y" }} in code highlighting?
The only way I have found so far is using {% raw %}{{ post.date | date: "%H:%M %p - %-d %b %y" }}{% endraw %}. However, then it shows the code snippet as unformatted text rather than with proper inline code highlighting.
If I use
`{{ post.date | date: "%H:%M %p - %-d %b %y" }}`
then the code is rendered instead of shown as code.
{% highlight html %}
{% raw %}
{% include google_analytics.html %}
{% endraw %}
{% endhighlight %}
That is how I do it.
Check it out live:
http://www.madhur.co.in/blog/2013/11/05/makingmostdatadirectory.html
{% highlight html %}
{% raw %}
{% for project in site.data.projects %}
{% if project.publish == true %}
<strong>{{ project.project }}</strong>
<span class="tag-project">{{ project.category }}</span>
{{ project.description }}
<hr/>
{% endif %}
{% endfor %}
</div>
{% endraw %}
{% endhighlight %}
you can do that easily by combining {% highlight %} and {% raw %}
for example
{% highlight ruby %}
{% raw %}
---
limit: 100
---
{% for post in site.posts limit: page.limit %}
{
"title": "{{ post.title }}",
"date" : "{{ post.date | date: "%B %d, %Y" }}",
"excerpt" : "{{ post.excerpt }}",
{% if post.categories %} "categories" : [
{% for category in post.categories %} "{{ category }}"
{% if forloop.last %}{% else %},{% endif %}
{% endfor %}
],
{% endif %}
{% if post.categories == nil %} "categories" : [], {% endif %}
"url": "{{ post.url }}",
{% if post.tags %} "tags" : [
{% for tag in post.tags %} "{{ tag }}"
{% if forloop.last %}{% else %},{% endif %}
{% endfor %}
]
{% endif %}
{% if post.tags == nil %} "tags" : [] {% endif %}
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
{% endraw %}
{% endhighlight %}