For issues related to the current stable release please use it's own Help forum.
IMPORTANT:Please read this before using an git or nightly build version: wiki.webtrees.net/en/GIT

Before asking for help please read "How to request help" by clicking on that tab above here.

TOPIC: How to customize the number of random media?

How to customize the number of random media? 1 week 2 days ago #1

  • xmlf
  • xmlf's Avatar
  • Offline
  • New
  • Posts: 24
I am currently developing a new theme.
I will randomly display the latest photos on the new homepage.
I want the random media module to display more than one photo.
How to customize the number of random media displays?
The administrator has disabled public write access.

How to customize the number of random media? 1 week 2 days ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Posts: 10844
> I want the random media module to display more than one photo.

Look at the existing module.

We loop over all the images until we find one we can display:

github.com/fisharebest/webtrees/blob/mas...eShowModule.php#L126

Just repace $random_media with an array, and stop when you have enough images.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.
Powered by Kunena Forum