<?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: Image not Loading on the landing page in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Image-not-Loading-on-the-landing-page/m-p/1088299#M41656</link>
    <description>&lt;P&gt;It works. Thanks for your help!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Dec 2024 07:00:45 GMT</pubDate>
    <dc:creator>MDien</dc:creator>
    <dc:date>2024-12-31T07:00:45Z</dc:date>
    <item>
      <title>Image not Loading on the landing page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Image-not-Loading-on-the-landing-page/m-p/1088271#M41653</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Aloha!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm having an issue with loading images on the landing page.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;We want to use about 20 images to show on the page. But only 10 images are displayed, the rest of the images are broken. (Attached)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the custom code we used to get the image. (attached)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone help me check this?&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/134882i05EE58637CBCCDA5/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image (1).png" style="width: 908px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/134881iFBCBCBA5971C9A4C/image-size/large?v=v2&amp;amp;px=999" role="button" title="image (1).png" alt="image (1).png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm looking forward to hearing from you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dien&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2024 02:50:21 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Image-not-Loading-on-the-landing-page/m-p/1088271#M41653</guid>
      <dc:creator>MDien</dc:creator>
      <dc:date>2024-12-31T02:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Image not Loading on the landing page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Image-not-Loading-on-the-landing-page/m-p/1088295#M41655</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/852871"&gt;@MDien&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;The issue seems to be related to the code or the data source used for rendering the images on the landing page. Based on the provided code snippet, I'll highlight potential causes and solutions: &lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Potential Issues&lt;/STRONG&gt;:&lt;BR /&gt;&lt;STRONG&gt;1) Resource Limitations&lt;/STRONG&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&amp;nbsp;If the system or CMS has a limit on how many images it can handle in a single request, it might break when exceeding that limit.&lt;/LI&gt;
&lt;LI&gt;The&amp;nbsp;file_by_id&amp;nbsp;function is limited to 10 calls per page, and since your code is iterating through&amp;nbsp;list_image&amp;nbsp;with 20 items, the function stops working after the first 10 calls. This limitation causes the remaining images to fail to load, resulting in broken images on the page.&lt;/LI&gt;
&lt;LI&gt;You should use the&amp;nbsp;files_by_ids&amp;nbsp;function, which allows you to retrieve metadata for multiple files in a single call. Here's how you can fix the code:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Update the Code to Use files_by_ids&lt;/STRONG&gt;: &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Modify your logic to retrieve all the image metadata in one call using files_by_ids.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;{% set all_images = files_by_ids(list_image) %} &amp;nbsp;&lt;/P&gt;
&lt;P&gt;{{ all_images }} &amp;nbsp;&lt;/P&gt;
&lt;P&gt;{% for day1image in all_images %} &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;img class='av-horizontal-gallery-img' src="{{ resize_image_url(day1image.friendlyUrl, 400, 300) }}" /&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;lt;a href="{{ day1image.friendlyUrl }}" class="lightbox-image"&amp;gt;&amp;lt;/a&amp;gt; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;{% endfor %} &lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;2) Missing or Invalid image_item IDs&lt;/STRONG&gt;: &amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If the image_item in list_image references an invalid or missing file, the&amp;nbsp;file_by_id&amp;nbsp;function will fail to fetch it. &amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Ensure all the IDs in&amp;nbsp;list_image&amp;nbsp;are valid and correspond to actual images.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;3) Broken Links (URLs): &amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The friendlyUrl property may not resolve properly for some images. Verify that the URLs generated by day1image.friendlyUrl are accessible&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 31 Dec 2024 06:28:01 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Image-not-Loading-on-the-landing-page/m-p/1088295#M41655</guid>
      <dc:creator>SanjayKumar</dc:creator>
      <dc:date>2024-12-31T06:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Image not Loading on the landing page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Image-not-Loading-on-the-landing-page/m-p/1088299#M41656</link>
      <description>&lt;P&gt;It works. Thanks for your help!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2024 07:00:45 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Image-not-Loading-on-the-landing-page/m-p/1088299#M41656</guid>
      <dc:creator>MDien</dc:creator>
      <dc:date>2024-12-31T07:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Image not Loading on the landing page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Image-not-Loading-on-the-landing-page/m-p/1098920#M41842</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN class=""&gt;Markestac,&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;I appreciate your help! We made the changes to my template based on the code you recommended above. The broken image looks okay now.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;However, We are having another trouble with the image. When we updated more images (Above 30 images) on the landing page. On the front end, the last images of the page are not showing (Not broken). Can you help me check this?&lt;/P&gt;&lt;P&gt;Again, thank you for your help!&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/136795i1730F49B7E2D57DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot.png" alt="Screenshot.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 00:52:06 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Image-not-Loading-on-the-landing-page/m-p/1098920#M41842</guid>
      <dc:creator>MDien</dc:creator>
      <dc:date>2025-01-24T00:52:06Z</dc:date>
    </item>
  </channel>
</rss>

