Displaying a Sample Audio File in the Listing Screen Using Custom Fields

In my site currently under development, I have added custom fields to the listing screen.
The reference is here.

In my site currently under development, I have added custom fields to the listing screen.

During this process, I discovered that I could use the “audio” tag by writing it in the following format in the display settings

<audio controls src="%value%">Sample Audio</audio><br>
<a href="%value%" target="_self"></a>

This behavior was unexpected based on my general understanding of HTML.

Why does this work?

I would like to understand how this is processed internally for future reference.

Thank you for your help.

Haa Sure, :smiling_face:

Whenever you create a custom field in your site, it’s like creating a little storage box in the database. :package:

Whatever you (or someone else) add to that box - whether it’s a link, image, text, or something else - is called the value of that field. :inbox_tray:

Now, when you use %value% in your code (like in your audio tag), it acts as a placeholder. It gets replaced by whatever is inside that custom field. For example, since you used an audio controller and the field contained an audio file URL, the audio player worked perfectly and played the file. :notes:

But if the field contained something like an image URL instead, the audio player would show an error because it wasn’t the right type of content. :x:

So, the type of code you use and the value in the field need to match to work correctly. :heavy_check_mark:

The cool part is, you can get creative with this! For example, you can embed maps, display videos, or do lots of other things by combining the right code and the custom field values. :wink:

Thank you for your detailed explanation!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.