Welcome to the Liquify Community

Updated 4 days ago

I need to show Product of all collection on list-collection page

Hey guys
I need help with showcasing product of all lists on list-collection page

Can anyone help me with docs or tutorials ??
S
j
m
14 comments
Any idea why this is happening ??
@liquify-team
Hi @SB Verma , for displaying different collections on a page, it does not necessarily need to be the list-collection page.

Do you want to choose which collection should be displayed? Or should all collections be displayed?

Do you already have a design for this?
@marv i think this page is missing in the liquify helper. Can you check this out?
Will add this πŸ™‚
Yes I do have design ready

Do you want me to share screenshot of design here ??
yes.. that would be helpfull
@jonas.halbstark
Hi @SB Verma, so i would build this page as a collection page. And the "tabs" (all, shirts etc.) are links to the collection itself. This is also nicer in terms of seo. And if you dont want to have a page reload by clicking on the link you could use the section rendering api
If you are interested in the section rendering api i could give you an example by the end of the week.
Alright sure @jonas.halbstark

thanks for the quick response


Since I'm quite new to shopify, will you please help me with some resources (docs, tutorials) to get a better understanding of attributes I can use

I've watched your tutorials but still few things are unclear
It'd be of great help if you can do this
Thnx
Hi @SB Verma, as promissed here is an example section for the collection page:
https://copyflow.io/c/1X2b5PTJnNMjOj0KgAlU

In order to make the section rendering api work you need to place this script in the body:
<script> // 1. This function sets event listeners for all .collection_tab-item.is-link function initCollectionLinks() { // First: get all existing .collection_tab-item.is-link elements const collectionLinks = document.querySelectorAll('.collection_tab-item.is-link'); // Add a click event listener to each link collectionLinks.forEach(link => { // Tip: Remove old listeners first if necessary // -> Not always required because you're usually replacing the entire DOM element link.addEventListener('click', handleCollectionLinkClick); }); } // 2. The function that is executed when a .collection_tab-item.is-link is clicked function handleCollectionLinkClick(event) { event.preventDefault(); // Determine the URL, e.g., /collections/sale const collectionUrl = this.getAttribute('href'); // Section ID, e.g., featured-collection const sectionId = this.dataset.sectionId; // Now build the Ajax fetch request const fetchUrl = ${collectionUrl}?sections=${sectionId}; fetch(fetchUrl) .then(response => response.json()) .then(data => { // JSON response -> the section's HTML string const newSectionHtml = data[sectionId]; // Find the container and replace the old HTML const sectionContainer = document.getElementById('shopify-section-' + sectionId); sectionContainer.innerHTML = newSectionHtml; // 3. Call initCollectionLinks again so that new links (or other elements) // can be clicked again initCollectionLinks(); }) .catch(error => { console.error('Error while loading the section:', error); }); } // 4. Initialize once on the first page load document.addEventListener('DOMContentLoaded', () => { initCollectionLinks(); }); </script>
With this you can create Block Elements and assign the collection to the block
Hi @SB Verma do you need any more guidance?
Add a reply
Sign up and join the conversation on Discord
","upvoteCount":0,"dateCreated":"2025-02-07T09:27:24.437Z","datePublished":"2025-02-07T09:27:24.437Z","dateModified":"2025-02-07T09:27:24.437Z","url":"https://liquify.hall.community/i-need-to-show-product-of-all-collection-on-listcollection-page-rMW5ZTNSS5T6#8d42eafc-7108-453e-a311-fc685f46d1bd","author":{"@type":"Person","url":"https://liquify.hall.community/members/9198b265-c813-4ed7-89ba-4025d177dc62","name":"jonas.halbstark","identifier":"9198b265-c813-4ed7-89ba-4025d177dc62","image":"https://cdn.discordapp.com/avatars/947621552478904320/9741d807d28f33e26a3a3b01c121c60f.webp?size=256"}},{"@type":"Answer","text":"With this you can create Block Elements and assign the collection to the block","upvoteCount":0,"dateCreated":"2025-02-07T09:28:34.315Z","datePublished":"2025-02-07T09:28:34.315Z","dateModified":"2025-02-07T09:28:34.315Z","url":"https://liquify.hall.community/i-need-to-show-product-of-all-collection-on-listcollection-page-rMW5ZTNSS5T6#101771c8-0540-4099-bcc5-8a579ec158bc","author":{"@type":"Person","url":"https://liquify.hall.community/members/9198b265-c813-4ed7-89ba-4025d177dc62","name":"jonas.halbstark","identifier":"9198b265-c813-4ed7-89ba-4025d177dc62","image":"https://cdn.discordapp.com/avatars/947621552478904320/9741d807d28f33e26a3a3b01c121c60f.webp?size=256"}},{"@type":"Answer","text":"Hi @SB Verma do you need any more guidance?","upvoteCount":0,"dateCreated":"2025-02-17T08:08:03.092Z","datePublished":"2025-02-17T08:08:03.092Z","dateModified":"2025-02-17T08:08:03.092Z","url":"https://liquify.hall.community/i-need-to-show-product-of-all-collection-on-listcollection-page-rMW5ZTNSS5T6#de2a9760-a4c7-46e7-8f4a-a509756a8800","author":{"@type":"Person","url":"https://liquify.hall.community/members/9198b265-c813-4ed7-89ba-4025d177dc62","name":"jonas.halbstark","identifier":"9198b265-c813-4ed7-89ba-4025d177dc62","image":"https://cdn.discordapp.com/avatars/947621552478904320/9741d807d28f33e26a3a3b01c121c60f.webp?size=256"}}]}}