fm:IfAudio


This component can be used within a Mediadetail page, or the MediaList (Loop) component.

It will check if the mediafile is an audio file, and if so, will render the content within it's tags.

Because this component extends the behavior of the fm:If component, you can include an fm:Else component, should you need to.

This component does not generate template variables, but can pass on variables that exist in parent components (such as {$media_title} )

Example

<fm:IfAudio> <!-- music player widget goes here --> <fm:Else> <!-- no music :( --> </fm:Else> </fm:IfAudio>

However, a more useful template would look like this:

<fm:IfAudio> <!-- music player widget goes here --> </fm:IfAudio> <fm:Image> <img src="{$media_publicUrl}/15" alt="{$media_title}" /> </fm:Image> <fm:IfVideo> <!-- video player widget --> </fm:IfVideo>

Supported attributes

This component does not process attributes.

Template variables

This component does not generate template variables, it will render template variables defined in parent components.

See also