Page 1 of 1

Audio museum type

Posted: 08 Jun 2026, 09:31
by daniel
Hello, I need expert help, I am unable to program this. 

Here's my problem: 
I have a page with 60 images. 
For each image, I have an audio.mp3 comment that is its own, of the museum type. That is 60 mp3.
I would like to have a button at the title level of the image to access his audio comment.mp3. 

The button to have an optional listening to the comment of the image. 

Could you help me, thank you.
In reality I have six pages of 60 images or 360 mp3. But I think the reasoning for one page can be applied to the other five remaining.

Re: Audio museum type

Posted: 08 Jun 2026, 21:06
by mjau-mjau
Ok, so there are a couple of minor challenges here.

Automation
First of all, if you have images and audio files in the same dir, with matching file names, you could easily create a caption template. For example if you have image name ABC123.jpg, there should be audio file audio_ABC123.jpg (or a similar pattern that allows us to match image file name with audio file names).

With the above, we can go to page settings > gallery > captions > caption defaults > default image description and create a template-based description, linking to each image's audio `{path}/audio_{file_name}.mp3`.

How to play the audio
Did you put any idea into how you want the audio to play? Just a "play" button or some text link "Play commentary"? The easy solution here, would be to simply open the audio in a new window or popup. However, I am guessing you want a more streamlined solution, where the audio is simply played in the background on X3 website? This would require some javascript: 1. create a global "hidden" audioplayer on the page, 2. Have links for each image that trigger and play specific audio files, in the global hidden audioplayer on the page.

Then of course it could get more complicated, if you want each button/link at each image to be able to start/stop the audio, and/or if you want the button to display the current play state of the current commentary (eg it changes changes text or color while playing, and reverts when complete).

Re: Audio museum type

Posted: 11 Jun 2026, 17:07
by daniel
"Then of course it could get more complicated, if you want each button/link at each image to be able to start/stop the audio, and/or if you want the button to display the current play state of the current commentary (eg it changes changes text or color while playing, and reverts when complete)."

Thank you for your reply. You have fully understood. YES that is exactly what I would like.
And OK for this: " image name ABC123.jpg, there should be audio file audio_ABC123.jpg"
And name button = "Commentaire Audio"

Re: Audio museum type

Posted: 12 Jun 2026, 00:48
by mjau-mjau
Ok, here's the basic recipe.

Page settings > gallery > captions > caption defaults > default image description
Code
<a class="button" href="{path}/{file_name}.mp3" target="_blank">Commentaire Audio</a>
Image

Basically, you are assigning a link to the corresponding mp3 file, that opens in a new window. To make sure the description displays, you will need to choose a layout that conveniently shows the description with the audio button.

If you want a more advanced player, that plays the audio directly on the page without opening the mp3 in a new window, it would be a task that takes a few hours to complete. If I was going to build that, I would need to charge a token fee $50.

Re: Audio museum type

Posted: 17 Jun 2026, 08:12
by daniel
OK thank you very much, I will test to see if it suits me like this. Otherwise I will come back to you to improve as you propose to me.