Comments (2)
I think a ContentEdit.Div
might be too generic as you don't know what a <div>
will contain or what the behaviour of the contents should be, in the case you've presented above I think I'd resort to multiple regions, along the lines of:
<div class"main">
<div data-editable="main-upper">
<p>....</p>
</div>
<div data-editable="main-lower">
<p>...</p>
</div>
</div>
Elements can be dragged between multiple regions and you can move the cursor between them.
If you did want to create an editable element specifically for the case in point I think it would be better to require that a data-ce-tag="new-element-type"
was used to point to a new element type rather than capture the behaviour of all <div>
tags.
Having said all of that I'm not 100% confident I understand the problem you're trying to solve, so if I've misunderstood apologies in advance, if you can provide another use case I'll happily review.
from contenttools.
Here's a bit of background: in a nutshell I'm trying to integrate it with WordPress in such a way that ContentTools will be the content editor while in the frontend of a site. The two major hurdles are 1) you don't really know what content will be there.. any content should be editable and any content can be inserted into the editor. The next hurdle is 2) parts of the content are rendered HTML or shortcodes, and these should not be editable - you also don't know what will be contained in these. I've got second hurdle pinned down by filtering these out and using your new movable static attribute.
Right now I'm testing various scenarios for the first hurdle, like having divs inside the content which should be editable. I'm using a single editor to make things simpler, since if each div would be turned into an editor, letting users add divs in then initializing those too can make things complicated.
from contenttools.
Related Issues (20)
- Save issue - saves fine, but won't allow a second "save" HOT 5
- Making CT compatible with CSP style-src set to 'self'
- Can't edit files that were included or read by php HOT 17
- Edit multiple paragraphs at once. HOT 2
- Is there a way to change the default tag output for normal html tags HOT 2
- Missing translation in /src/scripts/ui/dialogs/table.coffee
- Problem update image classes HOT 5
- Build files to use dynamic import in pure javascript HOT 1
- How to use assign ? HOT 2
- Hot to keep style attributes on save.
- Support for Sass >= 1.33 HOT 11
- npm install failed HOT 2
- Feature: Support drag & drop of images
- The image uploader HOT 2
- Inspector bar doesn't show embedded HTML elements when wrapped with paragraph HOT 1
- Line breaks not saving
- Add class to a link
- Lazy loading of images
- Source code edit? Insert <script> tag HOT 3
- The part in italics is not the right one HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from contenttools.