Closed pbojinov closed 4 years ago
I'm honestly not sure how this would work off the top of my head since I don't know how MS Word represents images with links internally. If you want to use the HTML <img>
tag you'd need to define a custom HTML AST node class to handle the conversion. Inside that class you could allow an optional link attribute or depending on how Word generates things use what you have above.
If I were implementing this I'd create what I want in a plain word doc, unzip it and see what the XML for the image+link looks like. The next step would be adapting that into your HTML node conversion class. Images are defined as an inline element in many cases so they might be wrapped by the hyperlink XML node instead of the image having some kind of link attribute internally.
Is it possible to add a hyperlink to an image in a Sablon template?
Right now we're adding hyperlinks and images separately to a template, but when we try something like this, it throws an error:
My understanding is the
<img>
tag isn't support in the Sablon content html.I just wasn't sure how to combine the
Sablon.content
for:image
and:html
.One use case is making a profile avatar clickable with a link to a website. Or dynamic social media icons with links to the corresponding sites.
Just want to say thanks again for your help.