Hyperlink images in content blocks

Posted by Community Admin on 05-Aug-2018 19:04

Hyperlink images in content blocks

All Replies

Posted by Community Admin on 26-Jun-2012 00:00
I have a site that is almost ready to roll out to a client. I have tried to keep the HTML & CSS so a layman could update content on the site. Yet I am running into issues where the content editor deletes HTML I have entered in HTML view.

For example, I have some shared content blocks that have two anchor tags. Inside the first anchor, I have an image. In the second anchor I have some text. The first anchor is set to class="imglink", while the second anchor is set to class="link".

Then there is some short text after the anchors.

Here is some sample HTML:

---------------------------------------------------
<a href="123" class="imglink">
<img />
</a>

<a href="123" class="link">
Some text...
</a>

<p>Some more text...</p>
--------------------------------------------------- 

I just tried to change out the image outside the first anchor while in Design view. It completely removed the outer anchor tag.

Since non-technical people are slated to use the site, how do I work around issues like this? I could design a user control, but there is not much time available.
Posted by Community Admin on 26-Jun-2012 00:00
Steve,

Relying on specific markup to survive an edit is asking for frustrated calls from users. I really only use explicit markup in shared content blocks.

Seems like a custom widget is probably your best bet. Then you can be certain that what you need as output...will be the output.
Posted by Community Admin on 27-Jun-2012 00:00
Thanks Tim!

The one thing that has stopped me from doing a custom widget, besides time, is picking an existing image from the library. Do you have any examples of how to pick an image in a custom widget?

I do have an example from a reply on another thread. But I am hoping for a simple solution.
This thread is closed