GetmeUK / ContentTools

A JS library for building WYSIWYG editors for HTML content.
http://getcontenttools.com
MIT License
3.95k stars 395 forks source link

Links with images and texts #429

Closed nico3333fr closed 6 years ago

nico3333fr commented 7 years ago

Hi there,

first of all, thanks for this tool, it is really great! šŸ‘

I have a particular case that I don't manage to find a correct solution: basically, a link (a square block) with an image inside, and some texts positionned in absolute inside (to be at the bottom of the block). I would need to edit the link, the image and the texts inside.

Looking into closed issues, I've tried setting up CT like this:

<div data-editable data-name="box1">
  <a href="url" class="square-block" data-ce-tag="img">
   <img src="./layout/images/_pages/home/images.jpg" alt=""  />
   <span class="square-block__content ">
     <span class="boxh2">Blahblah</span>
     <span class="nosmallmobile boxh3 bl lh100"><br />another blahblah</span>
     <span class="bl boxh3 mt0-5">a third blahblah<br>blahblah</span>
   </span>
   </a>
</div>

(I've removed almost all non-necessary code) With this parameter, I manage to reach the link and the image, but the text inside gets removed, and I can't edit it. :-\

How could I set up to allow CT to understand that I want to edit the link, the image, boxh2, boxh3 , etc. (I've tried nesting data-editable attributes, etc. not a good idea ^^).

If you have any idea of how to do it, it would be great :) Thanks for reading this issue, Nicolas

anthonyjb commented 7 years ago

Hi @nico3333fr this is wha ContentFlow (which unfortunately is really not quite ready for production use yet - it will be before the end of the year) was designed for.

ContentFlow allows you to create a snippet which has an image fixture (for the background image) and then a text or buttons or whatever you like to float over the image.

You can watch a video showing functionality like using ContentFlow/Tools here: https://www.youtube.com/watch?v=HQaNrI3yJwo&t=17s

If you're brave you can download and start using ContentFlow now - but the lack of docs and the basic sandbox demo makes it a challenge. More demos and docs are being worked on currently.