Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DISCUSSION] Change way, how inline actions and dropzones are attached #537

Closed
vaxul opened this issue May 17, 2021 · 2 comments
Closed

Comments

@vaxul
Copy link
Contributor

vaxul commented May 17, 2021

Hi, I'd like to discuss if it's possible to achieve an not invasive way of how the inline actions are attached to the content elements.

The problem

Currently the HTML of the content elements is gone be wrapped by several containers. This can break layouts in many ways.

A (possible) solution

  1. Don't wrap content elements, instead put alle inline action for each available content element before the closing </body>
  2. Don't add dropzones if nothing is dragged
  3. Assume, that each content element is at least selectable with a CSS selector like [id^="c"], which match for example <div id="c123">
  4. Add JS with this selector, filter out non content elements, add hover which calculate and set the position for the inline actions on the fly
  5. Add JS which adds the dropzones, when something is dragged, and removes the dropzones, when something was dropped/abort
  6. Add maybe an optional config for each CType within TypoScript tt_content, which would allow to override position relative from the calculation (CSS transform) of something like orientation (right on the x-axis)

The good

  • since it works more like browser extensions, it should not break any layout
  • ...

The bad

  • This would probably be more a v3 than a v2.5
  • ...

Since I'm currently not heavily into the code of Frontend Editing, I'm not sure, if it's even possible to change it this way. So before I would try it myself, I'd like to hear your opinion to this topic.

@vaxul vaxul changed the title [DISCUSSION] Change way, how inline actions are attached [DISCUSSION] Change way, how inline actions and dropzones are attached May 17, 2021
@MattiasNilsson
Copy link
Contributor

@vaxul This is a very good idea and I am all for it! The idea with making it more versatile and more modular is awesome, the questions how to achieve this in the best way?

One of my concerns will be that it will be a lot of work and a new major version for example v3, because all of the breaking changes.

@mabolek
Copy link
Collaborator

mabolek commented May 18, 2021

@vaxul I'm also in favor of this.

It is possible that we could implement this in a non-breaking way by adding the "tag" argument to the dropZone ViewHelper, just like for contentEditable. That way the dropZone could "piggyback" on another tag when configured to do so. https://docs.typo3.org/p/friendsoftypo3/frontend-editing/master/en-us/ConfigureAndExtend/ViewHelpers/Index.html#tag

@vaxul vaxul closed this as completed Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants