I am seeking guidance on a project I am currently working on and would greatly appreciate any help.
Main Goal:
The objective is to create a drag and drop CMS that allows users to draw elements on a grid and rearrange them as needed. The system will record these changes in JSON format and convert them into HTML/CSS upon hitting the publish button. The resulting HTML should be clean and flexible enough to accommodate varying content lengths. The CMS should be capable of handling e-Commerce sites as well as simple informational websites.
Issue:
The conventional method of implementing a drag and drop system in HTML involves using absolute positioning with fixed widths and heights, which proves problematic when dealing with content of differing lengths. As absolutely positioned elements are detached from the document flow, they do not interact effectively with surrounding elements.
Solution Proposed:
To address this challenge, we aim to develop a system that converts absolutely positioned elements into floated elements.
Visual Representation:
In the CMS interface, users can create a layout by drawing boxes on a grid:
- Header (fixed height)
- Navigation (variable height)
- Image (fixed height)
- Main content area (variable height)
- List of visited items (variable height)
- Footer (fixed height)
Absolute Positioning:
The corresponding HTML/CSS code would resemble the following example:
... (CSS code here)
... (HTML code here)
Floated Elements Layout:
The updated HTML/CSS code would look something like this:
... (CSS code here)
... (HTML code here)
It is crucial for the user to have an intuitive experience without requiring comprehensive knowledge of floating elements, hence this conversion process needs to occur seamlessly upon publishing the changes.
While this example showcases a simplistic scenario, more complex layouts will also need to be accommodated in the system.
Comparison with Existing CMS Platforms:
Based on my research, most CMS systems either restrict users to predefined templates or utilize JavaScript to manage the positioning/heights of absolutely positioned elements (an approach I aim to avoid).
Queries:
- Is it feasible to establish a set of guidelines for converting an absolute layout to a floated one?
- Are there any existing CMS platforms that implement this feature?
- Any recommendations for alternative methods to tackle this particular issue?
Your insights are much appreciated.