Okay
  Public Ticket #3208193
ACF shortcode within Sonaar shortcode
Closed

Comments

  •  1
    Julian started the conversation

    Hi there

    I want to have a single page template to use on lots of pages, and yet still display the relevant playlist for each album page.

    I have setup each album page to have an ACF relationship field that allows selection of a playlist. Then I want to display the shortcode for a Sonaar playlist, and pull the related playlist post ID into the shortcode. 

    I have tried doing this as per the below, using the ACF shortcode within the Sonaar shortcode, but it doesn't work. The ACF shortcode works on its own to display the related playlist post ID as a 5 digit number, but when included like this it just displays nothing. 

    Is this possible? If not, is there another way the same result can be acheived?

    Here is the shortcode that displays the playlist post ID:

    [acf field='tas_related_playlists_acf_tas_related_playlist_standard_acf']

    However, if I include it within the Sonaar shortcode like this, it doesn't work:

    [sonaar_audioplayer playlist_type="predefined" albums="[acf field='tas_related_playlists_acf_tas_related_playlist_standard_acf']" artwork_id="" player_layout="skin_float_tracklist" show_skip_bt="default" show_shuffle_bt="default" show_speed_bt="default" show_volume_bt="default" show_publish_date="default" show_tracks_count="default" show_meta_duration="default" hide_progressbar="default" display_control_artwork="false" hide_artwork="false" show_playlist="true" show_track_market="false" show_album_market="false" hide_timeline="true" track_artwork="false" scrollbar="false" shuffle="false" sticky_player="true" hide_album_title="true"]

  •  1,103
    Max replied

    Hi,

    you cannot put a shortcode into another shortcode.

    The part that breaks our shortcode is "[acf field='tas_related_playlists_acf_tas_related_playlist_standard_acf']"

    Instead, you should be using audio_meta_field and repeater_meta_field to connect with your custom fields. See this article https://sonaar.io/docs/using-player-with-dynamic-custom-fields-for-acf-jetengine-and-metabox/to find out how to setup the audio_meta_field and repeater_meta_field shortcode attribute.


    Thanks,


    Max from the Sonaar.io Crew