Question on wrapping items with an a tag

Permalink Browser Info Environment
Hi-

I am trying to create a block with the following markup (so the href, image and card title are editable.

<div class="card">
    <a href="/linkpath">
        <span class="Image"><img alt="" src="//via.placeholder.com/550x400" /></span>
        <span class="Text">Card Title</span>
    </a>
</div>


Is it possible to open the a tag, set the href, then have the two spans using the "Image" and "Text Area" inside before closing the a tag?

I've tried using both the "Link" item and "URL" item and the closing a tag is always placed before the two spans.

Thanks,
Nathan

Type: Discussion
Status: Resolved
ndeklotz
View Replies:
ramonleenders replied on at Permalink Reply
ramonleenders
Hi Nathan,

This is very edge case. Best thing would be to make a new field type for this I guess, since the current setup will not be able to do this. If you split this up into multiple (3) fields, it will not work either since if you don't enter a link (href), the others shouldn't show up too.

Not sure if you are familiar with creating Field Types for Block Designer? There is detailed instructions about it here:https://www.concrete5.org/marketplace/addons/block-designer/create-y...

Kind regards,
Ramon

concrete5 Environment Information

# concrete5 Version
Core Version - 8.5.5
Version Installed - 8.5.5
Database Version - 20201116182100

Browser User-Agent String

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.