Closed darylknight closed 2 years ago
I'm guessing this is intended. I write my conditionals like a boolean check {% if block.button.target %} target="_blank"{% endif %}
.
@darylknight @simonkuran In Craft 3 Linkit now has a .targetString
property, which gives you the actual value for the target attribute, so it's a bit cleaner.
@jamesmacwhite is right on this, the target string property covers off this.
I just noticed on a site I'm working on, that if a LinkIt field has "Open link in new tab" checked, it's outputting "1" instead of "_blank" in the code. Still seems to work, but it's not valid:
{% if block.button|length %}<a href="{{ block.button.url }}" class="btn btn-red mt-2" target="{{ block.button.target }}">{{ block.button.text }}</a>{% endif %}