Hiding a div in collection item on a standard page with custom code

Hello, I have a collection list on a standard page (not a CMS template) and I would like to change a visibility of a divblock (inside the col. list) with a link to CMS page.

The page is showing CMS items with comic books. If the comic book has more then one page, there is a link to a CMS template page with all the comic book pages. However, if it is only one page comic, I want to hide the link to the CMS template page and instead make the thumbnail clickable to enlarge the single comic image.

Can this be achieved with a custom code and can somebody please help me with it? I tried chatgpt but it did not work.

Here is my site Read-Only: (Webflow - Gouranga Ášram)
Here is the live site: Komix

The way you’ve set it up, you have every image as a separate field, times 35 fields. An image gallery might work better for you.

However in your current setup, you should be able to do conditional visibility based on the presence / absence of the second image ( Strana 1 ? ).

Build both of your UI’s in the collection list and conditionally switch based on whether there is only 1 image or 2+.

Another option is to add a switch field and explicitly set whether that comic book should use the 1-image or the multi-image UI.