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

display the selected extra css classes of a plugin in structure view #147

Open
dhrv opened this issue Mar 9, 2016 · 5 comments
Open

display the selected extra css classes of a plugin in structure view #147

dhrv opened this issue Mar 9, 2016 · 5 comments

Comments

@dhrv
Copy link

dhrv commented Mar 9, 2016

It would be very helpful to display the selected extra css classes of a plugin in the structure view. An example is given in this screenshot:

2016-03-09_17-05-05

@jrief
Copy link
Owner

jrief commented Mar 9, 2016

Yes, makes sense.
I'm a little bit scared about narrow placeholders and large identifiers. Do you think we could implement it via a tooltip?

@dhrv
Copy link
Author

dhrv commented Mar 10, 2016

I do understand your concern because overflowing text is not wrapping and shortened with ellipsis, but tooltips would not help getting a quick overview of the selected classes/resulting DOM structure.

I see two possible solutions:

  • Break the selected classes to a new line with a simple
    tag before the classes, given there are selected classes (I have done this locally for the SimpleWrapperPlugin and the PicturePlugin and it's working fine).
  • Override the follow rule in cms.base.css with a custom css to allow whitespace wrapping: div.cms .cms-structure .cms-draggable .cms-dragitem-text { white-space: normal; }

While we're on the topic of extra classes, is it possible for extra classes to be shareable between Plugins? The benefit of this would be that common class names only have to be entered once and not manually for every Plugin. Furthermore, if a class name needs to be changed, it automatically updates every Plugin where the class is used. With the current behaviour, if I change the class "myClass" to "myNewClass" in the admin config, the Plugin still uses the old "myClass". I know this is very tricky because of the underlying JSON storage of the cascade plugins, but maybe you see a way to achieve this, if you deem it useful. (Actually, many of the above requests would not be needed if I was able to implement my own plugins the way I want, in this case a flexible Bootstrap4 card plugin, but unfortunately I'm not nearly skilled enough :P)

@jrief
Copy link
Owner

jrief commented Sep 18, 2016

@rfleschenberg what do you think about this proposal?

@rfleschenberg
Copy link
Collaborator

I am fine with showing the extra CSS classes.

About shareable classes: I think we need to be careful not to introduce feature creep. On first thought, it seems to me that implementing your own plugin is the cleaner solution.

Maybe we should make it easier to implement your own plugin?

Maybe all this needs is better documentation?

@jrief
Copy link
Owner

jrief commented Sep 19, 2016

By inheriting from an existing plugin and overriding classmethod get_identifier, you can render whatever you want. Since that would be a lot of work, how about if I add a hook to that method, so that you can modify all identifiers with one single function.

I still have to rethink about it, and how to make that hook function configurable. Any proposals?

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