LJ Dynamic Fields unable to output title I’m using the LJ Dynamic Fields plugin and have a dynamic multi select setup for the client to select predefined tags, which is working all fine in the cms using the following code.

{% for tags in craft.tags.group('default').limit(null).order('title') %}
{ "value":"{{ tags.id }}" , "label":"{{ tags | raw | capitalize }}"
}{% if not loop.last %},{% endif %}
{% endfor %}


However, in my template I can only seem to output the id, but I want the tag title. I’m using the following code in my template:

{% for tags in entry.tagsMultiSelect %}
&lt;a href=""&gt;{{ tags }}&lt;/a&gt;
{% if not loop.last %}, {% endif %}
{% endfor %}


Can anyone tell me where I’m going wrong?
The values in your tagsMultiSelect are the tag ids, not the tags.
So, what you need to do in your template is convert that id to a tag:

{% for tagId in entry.tagsMultiSelect %}
  {# get the tag with that id #}
  {% set tag = craft.tags.id(tagId).first %}

  &lt;a href=""&gt;{{ tag.title ?? 'no such tag' }}&lt;/a&gt;
  {% if not loop.last %}, {% endif %}
{% endfor %}




If what you want is a predefined set of tags, you might also consider changing that tag group into a category - that would let you use a regular category field for your tagsMultiSelect.