• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Liquid Product List tag - {tag_productlist,,,,,, collection="prodList" template=""}

Participant ,
Oct 23, 2015 Oct 23, 2015

Copy link to clipboard

Copied

Hi,

I stumbled across this tag on the 'Enable other Liquid objects' doc as I was trying to find a solution to customise the HTML output of products so I can use a Masonry layout.

I added the code to the overall layout:

{tag_productlist,,,,,, collection="product-list" template=""}

<ul id="masonry-container" class="row small-block-grid-2 medium-block-grid-4 large-block-grid-4">

{% for item in product-list.items %}

<li class="product-list-masonry">

•• content **

</li>

{%endfor%}

</ul>

It works fine as list view, but nothing renders when clicking to the detail view. Can this tag be used yet? How do I render the product detail layout?

I also tried {module_data} but got into similar issues.

{module_data resource="products" version="v3" fields="id,name,tags,smallImage,largeImage,description,attributes,custom1,custom2,custom3,custom4,isOnSale,canonicalUrl" skip="0" limit="100" order="id" collection="products"}

Any pointers appreciated.

Thanks

Paul

TOPICS
Developer

Views

810

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Oct 26, 2015 Oct 26, 2015

Hi Paul,

You should use something like this instead:

{% if globals.get.ProductID %}
<p>This is the product detail layout</p>
{% else %}
<ul id="masonry-container" class="row small-block-grid-2 medium-block-grid-4 large-block-grid-4">
{% for item in custom-tag.items %}
<li class="product-list-masonry">
    {{item.name}}
</li>
{%endfor%}
</ul>
{% endif %}

You first need to tell whether you are in the product "large" view or on a catalog listing its products. After you know that you can either build

...

Votes

Translate

Translate
Adobe Employee ,
Oct 26, 2015 Oct 26, 2015

Copy link to clipboard

Copied

Hi Paul,

You should use something like this instead:

{% if globals.get.ProductID %}
<p>This is the product detail layout</p>
{% else %}
<ul id="masonry-container" class="row small-block-grid-2 medium-block-grid-4 large-block-grid-4">
{% for item in custom-tag.items %}
<li class="product-list-masonry">
    {{item.name}}
</li>
{%endfor%}
</ul>
{% endif %}

You first need to tell whether you are in the product "large" view or on a catalog listing its products. After you know that you can either build the product view or loop the products and build the listing.

Hope this helps,

Mihai

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 23, 2017 Aug 23, 2017

Copy link to clipboard

Copied

LATEST

Hey Mihai,

I am trying this as well, and I can get the <p>This is the product detail layout</p>  after adding the globals.get.productID, but am stuck trying to figure out how to actually output the content. I've tried a forLoop within and nothing is outputting on the product detail page.

I am using the {tag_productlist,,,,,, collection="product-list" template=""} as above and it is working fine for the small/list view, but not on the large view.


Suggestions?

Thanks,

Aaron

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines