Code Monkey home page Code Monkey logo

Comments (2)

anthonyjb avatar anthonyjb commented on August 18, 2024

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.

bfintal avatar bfintal commented on August 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.