Mini Block: Random image from gallery


Item has a rating of 5 (Liked by Chris GrahamLiked by SoccerDad)
#5589 (In Topic #1297)
Standard member
ironfeather is in the usergroup ‘Well-settled’

Wanted to share this and invite people to make it better…

I own a bookshop and want to display books on my website, a random book cover throughout the site that points back to the gallery that has more information for the potential customer.

see example usage:

Notice the upper left nandalow bookshop box is displaying a book cover. Now scroll down a bit and on the lower left & right it will display a random book or comic cover. In the center of the page after the links it will display 5 random comicbook covers.

If you hover over the image the tooltip gives the title and invites customer to click for more info. Under the image is the title.

In sources_custom/miniblocks create a file called random-image.php

UPDATE: having trouble posting the php code. I used a CODE box but its scrambled.
to display code we should use the CODE box? 

for now please see it at :


Last edit: by ironfeather

Publisher of IronFeather Journal since 1987.  Host of KGNU Colorado Radio for 20 years. 
Currently in Japan & decided to focus on Composr as my number one CMS.
Composr site for community of Hokkaido:
Composr site for my freelance work:
My Compsr edits :

Online now: No Back to the top


Site director
Chris Graham is in the usergroup ‘Administrators’
Apologies to anyone who recently got an incorrect whisper notifications on this topic. It's a bug in the release made last Thursday, and has now been patched as it is a critical issue. A new patch release for that will come soon.

Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: Yes Back to the top


Item has a rating of 5 (Liked by SoccerDad)
Standard member
Paul Flavel is in the usergroup ‘Honoured member’
Firstly thankyou ironfeather for the share, great stuff.
Re:Chris, was enjoying the whispers, lols.
Online now: No Back to the top
1 guest and 0 members have just viewed this.


Users online:

Philip, babu, deepu_ms, Paul D, Salman, mytracker, Chris Graham

Forum statistics:
  • 1,294 topics, 5,826 posts, 7,053 members
  • Our newest member is Chris Woris
Back to Top