I have created a link rendering variant and put in css class of "btn login-button"
However in my markup where the link is using that rendering variant this does not appear
<div class="component link member-hub col-12">
<div class="component-content">
<a href="/Articles" data-variantfieldname="Link" data-variantitemid="{B7229055-B046-47D3-AAC4-6EA4815F2696}">Login</a>
</div>
</div>
The only way I have gotten it to appear on the anchor is when inserting the link, adding a class explicitly to the link. I don't want to rely on the content editors doing this though.
<div class="component link col-12">
<div class="component-content">
<div class="field-link">
<a class="btn login-button" href="/ract" data-variantfieldname="Link" data-variantitemid="{33E5529D-270D-4738-9DCB-96DDB34EC23B}">Another</a>
</div>
</div>
</div>
Why is my link field Css Class not appearing? I have explicitly published to ensure that the markup isn't showing EE related markup.
Update: we are trying to use the bootstrap button styling of the link which is why I was trying to put it on the anchor element.
Tag
field on your variant definition item is empty? If you set it todiv
link will be wrapped with additionaldiv
with expected classes:btn login-button
andfield-link
. This is how it works right now.