// To create a reliable string of page tags to use for comparison in Liquid conditional statements, place this in layout.html between the
and : {% assign tags_list = "" %} {% for tag in page.tags %} {% assign tags_list = tag.name | append: ", " | append: tags_list %} {% endfor %} // We'll need a consistent tag naming convention that contains a 'trigger' phrase and an 'id' to use in the link to the embedded widget. // In this case, we need an ID for a Phone2Action widget, so we'll be using the tag format 'p2a-12345' // // In the page template, we'll loop through the tags, scope the loop to only tags with the 'trigger' phrase, and then split that tag on the delimiter: {% if tags_list contains "p2a-" %} {% for tag in page.tags %} {% if tag.name contains "p2a-" %} {% assign p2a_widget_code = tag.name | split:'-' %} p2a[0]:{{ p2a_widget_code[0] }}