<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Randomize image order in image grid in Blog, Website &amp; Page Publishing</title>
    <link>https://community.hubspot.com/t5/Blog-Website-Page-Publishing/Randomize-image-order-in-image-grid/m-p/1191632#M16129</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/981457"&gt;@rjmorris67&lt;/a&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This is easiest to do with a small JavaScript snippet added to the page.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;SPAN&gt;Identify the CSS selector for your grid’s wrapper (e.g., .image-grid).&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;SPAN&gt;Upload a JS file in Design Manager, then include it on the specific page via the page editor: click Settings ➝ Advanced ➝ Footer HTML and add a &amp;lt;script src="...your file URL..."&amp;gt;&amp;lt;/script&amp;gt;.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;SPAN&gt;Paste this code in your JS file and update &lt;EM&gt;.image-grid&lt;/EM&gt; to match your grid’s selector:&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;LI-CODE lang="javascript"&gt;document.addEventListener('DOMContentLoaded', function () {  
  const grid = document.querySelector('.image-grid'); // &amp;lt;-- change this to your grid selector  
  if (!grid) return;  

  const items = Array.from(grid.children);  

  // Fisher–Yates shuffle  
  for (let i = items.length - 1; i &amp;gt; 0; i--) {  
    const j = Math.floor(Math.random() * (i + 1));  
    [items[i], items[j]] = [items[j], items[i]];  
  }  

  // Re-render in new order  
  const frag = document.createDocumentFragment();  
  items.forEach(el =&amp;gt; frag.appendChild(el));  
  grid.innerHTML = '';  
  grid.appendChild(frag);  
});  
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Publish/Update the page.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Reference:&amp;nbsp;&lt;A href="https://knowledge.hubspot.com/design-manager/add-a-javascript-file-to-hubspot" target="_blank"&gt;https://knowledge.hubspot.com/design-manager/add-a-javascript-file-to-hubspot&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this helps, feel free to mark it as the solution&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt; and give it an upvote&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt; !&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;&lt;SPAN&gt;Part of this reply was generated by AI (HubSpot and KBs).&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Aug 2025 16:09:51 GMT</pubDate>
    <dc:creator>Jigar_Thakker</dc:creator>
    <dc:date>2025-08-21T16:09:51Z</dc:date>
    <item>
      <title>Randomize image order in image grid</title>
      <link>https://community.hubspot.com/t5/Blog-Website-Page-Publishing/Randomize-image-order-in-image-grid/m-p/1191618#M16128</link>
      <description>&lt;P&gt;Hi - I am using an image grid in my Hubspot webpage design but would like the order of the images to shuffle in some way as I will have large number of them.&amp;nbsp; How can I achieve that easily?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 15:41:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Blog-Website-Page-Publishing/Randomize-image-order-in-image-grid/m-p/1191618#M16128</guid>
      <dc:creator>rjmorris67</dc:creator>
      <dc:date>2025-08-21T15:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Randomize image order in image grid</title>
      <link>https://community.hubspot.com/t5/Blog-Website-Page-Publishing/Randomize-image-order-in-image-grid/m-p/1191632#M16129</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/981457"&gt;@rjmorris67&lt;/a&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This is easiest to do with a small JavaScript snippet added to the page.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;SPAN&gt;Identify the CSS selector for your grid’s wrapper (e.g., .image-grid).&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;SPAN&gt;Upload a JS file in Design Manager, then include it on the specific page via the page editor: click Settings ➝ Advanced ➝ Footer HTML and add a &amp;lt;script src="...your file URL..."&amp;gt;&amp;lt;/script&amp;gt;.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;SPAN&gt;Paste this code in your JS file and update &lt;EM&gt;.image-grid&lt;/EM&gt; to match your grid’s selector:&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;LI-CODE lang="javascript"&gt;document.addEventListener('DOMContentLoaded', function () {  
  const grid = document.querySelector('.image-grid'); // &amp;lt;-- change this to your grid selector  
  if (!grid) return;  

  const items = Array.from(grid.children);  

  // Fisher–Yates shuffle  
  for (let i = items.length - 1; i &amp;gt; 0; i--) {  
    const j = Math.floor(Math.random() * (i + 1));  
    [items[i], items[j]] = [items[j], items[i]];  
  }  

  // Re-render in new order  
  const frag = document.createDocumentFragment();  
  items.forEach(el =&amp;gt; frag.appendChild(el));  
  grid.innerHTML = '';  
  grid.appendChild(frag);  
});  
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Publish/Update the page.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Reference:&amp;nbsp;&lt;A href="https://knowledge.hubspot.com/design-manager/add-a-javascript-file-to-hubspot" target="_blank"&gt;https://knowledge.hubspot.com/design-manager/add-a-javascript-file-to-hubspot&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this helps, feel free to mark it as the solution&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt; and give it an upvote&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt; !&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;&lt;SPAN&gt;Part of this reply was generated by AI (HubSpot and KBs).&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 16:09:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Blog-Website-Page-Publishing/Randomize-image-order-in-image-grid/m-p/1191632#M16129</guid>
      <dc:creator>Jigar_Thakker</dc:creator>
      <dc:date>2025-08-21T16:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Randomize image order in image grid</title>
      <link>https://community.hubspot.com/t5/Blog-Website-Page-Publishing/Randomize-image-order-in-image-grid/m-p/1204182#M16344</link>
      <description>&lt;P&gt;HubSpot’s default image grid doesn’t have a built-in shuffle or randomize feature. To achieve random image order easily, you can: Use custom JavaScript on your page to shuffle the images dynamically when the page loads. Alternatively, manually reorder the images in HubSpot CMS each time (less practical for large numbers). Use a third-party plugin or widget that supports randomized image galleries and embed it in your page. If you want, I can help with a simple JavaScript snippet to shuffle your images automatically.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Sep 2025 08:28:31 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Blog-Website-Page-Publishing/Randomize-image-order-in-image-grid/m-p/1204182#M16344</guid>
      <dc:creator>DCarter60</dc:creator>
      <dc:date>2025-09-24T08:28:31Z</dc:date>
    </item>
  </channel>
</rss>

