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

How to create a grid? #375

Closed
andreyciocan opened this issue May 19, 2020 · 12 comments
Closed

How to create a grid? #375

andreyciocan opened this issue May 19, 2020 · 12 comments

Comments

@andreyciocan
Copy link

Hello!

I've been struggling with this for days. I want to create a grid so the user can write on two or more columns but I cannot figure out how.

What I've tried:

  1. Go to source mode and write some bootstrap style div (as I have bootstrap in my project). The problem is that if I write `
content
content 2
` when I close the source mode, the editor deletes `
` as it has no text childs 2. Try to create my own classes for a grid, but this leads to some overflow issues if grid is not complete (say the user makes only one col-6 then writes something else, this goes inline).

Is there a way to achieve this? Maybe a plugin or something?

Thanks

@supreme-ro
Copy link

supreme-ro commented May 19, 2020

He's right!

If you add this code in source view:
<div class="row"><div class="col">111</div></div>

And switch to normal view, then only
<div class="col">111</div> remains. The rest is erased.

I would need that too!

@JiHong88
Copy link
Owner

Hi,
Is it possible to upload the HTML of the table used in the source view mode?

@supreme-ro
Copy link

Try <div class="row"><div class="col">111</div></div>
After switching to normal view <div class="row"></div> will dissapear. This happends in the demo on your website too.

@andreyciocan
Copy link
Author

andreyciocan commented May 19, 2020

As @digifyro said, there is no table. Looks like the editor does not let to have nested divs. No mather of what classes are used. Even if I type:
<div id="div1"><div id="div2">content</div></div>
it removes the first div that contains the second

@JiHong88
Copy link
Owner

@digifyro @andreyciocan
When returning from the code view mode to the WiziWig mode or pasting, a check the HTML to convert tags that do not fit the editor's format.
So, nested div tags are removed because divs are format tags..

It seems that there is a way to exclude the nested format with a class or put an option not to check HTML in code view mode.

@andreyciocan
Copy link
Author

@JiHong88 how to put that option? In config? Can you post an example please?
Also, I would like to contribute to your project. First I can help you with locales for romanian if you like.

Thanks in advance

@JiHong88
Copy link
Owner

@andreyciocan There are no options at this time.😭
I'll update it at next versions.
Maybe it will be available until next week.
And I would be very grateful if you could provide a Romanian translation.
Thank you.

@JiHong88 JiHong88 added this to the 2.30.0 milestone May 19, 2020
@andreyciocan
Copy link
Author

I was wondering, if I would create a custom plugin that will insert the necessary divs, will the editor remove them on save?

@JiHong88
Copy link
Owner

@andreyciocan @digifyro
If you give 'se-component' class name to the top div,
HTML is preserved.

@andreyciocan
Copy link
Author

Not yet. Maybe you must make a new release?

Reproducing code:

`

content
`

when I switch back to editor mode (from code), only <div class="col">content</div> is persisted

@JiHong88
Copy link
Owner

JiHong88 commented May 22, 2020

It will be applied when a new version is released.
Tags with the class name se-component or __se__tag of the top-level tag will not be deleted.

se-component is the component type of the editor.
Class name for wrapper tags such as images and videos.

@JiHong88
Copy link
Owner

JiHong88 commented Jun 9, 2020

The 2.30.0 version has been updated.
If this issue has not been resolved, please reopen this issue.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants