Developer forum

Forum » Swift » Rich Text Editor in DW10 Swift

Rich Text Editor in DW10 Swift

Martin Ottesen
Martin Ottesen
Reply

Hi DW, 

I was wondering if there is a way to like in DW9 get a rich text editor on our elements that allows for HTML editing.
Or if this has been swapped to a new editor for good?

DW 10:

DW 9:

 

Br

Martin


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Maybe - there is an addin for it in the new editor in DW10 - but currently not in use.

You will also get a configuration option for the editor at some point.

But why do you need editing HTML in the RTE? Why not add a specific field for markup as a textarea where this will be needed? You can combine it with a radio so the editor can choose between text and code - or you can divide it into 2 different item types.

BR Nicolai

 
Martin Ottesen
Martin Ottesen
Reply

Hi Nicolai, 

Thats of course also a possibility, I think we would maybe just create a custom item meant for HTML markup instead so we can keep the text item standard.

Thanks for the response.

Martin.

 
Daniel Gamborg
Reply

Hi! Are there any updates regarding expanding the text field to allow direct HTML editing? We have a client who wants this functionality, but it doesn't seem possible to edit the TinyMCE file to add this feature in the back office. Are there any other alternatives?

 
Rene Poulsen
Rene Poulsen
Reply

I would also like an update on this.

 
Rene Poulsen
Rene Poulsen
Reply

Another issue, somehow related, is that a press on enter creates a new paragraph. A press on shift + enter also creates a new paragraph (in DW10 Swift). Is there no way to just create a regular linebreak?

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Rene

Quill as we use now in DW10 does not support HTML mode out of the box. So we need to make that as a custom thing. 

Can you explain the use case - why do you need this? Maybe there are other options for this. 

The same goes for the line breaks - I think <br> is kind of an old thing - and it is not handled by Quill right now. Also something we would need to customize.

The <br> can be an issue an cause unwanted renderings in responsive markup.

If you have issues with empty p-tags, youi can do stuff like this:

p:empty {
  margin:0;
​ padding:0;
}

 

 

 
Rene Poulsen
Rene Poulsen
Reply

Nicolai,

Sometimes it's nice for us to have the ability to edit in a codeview. If the customer has a technical employee it could make sense for them. But it's not that often we experience that. So that's ok with me.

But regarding the <br> tag I'm well aware of the advanteges and disadvateges of that - especieally considering responsive design. But let's take my screenshot as an example. It's a "Terms & conditions" page. It would be really nice (if not a must) to be able to just make a <br> when showing e.g. company info and adress. Take a look here:


If I showed that to one of our designers they wouldn't even talk to me ;-)

 
Martin Ottesen
Martin Ottesen
Reply

Hi Nicolai, 

This seems to have changed in recent DW10 versions? Because we have a site that just went live, and have footers created looking like this.

But now when our client edits any of the information in the text fields and then saves, it ends up with spaces between all the rows.

Looking like this (Take a look at the information in the left side of the footer):

I've experienced the same on other solutions aswell.

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Martin

Yes, it has changed. We used to use Tiny MCE, but they changed their licensing in a way so we could not use it anymore. We are now using Quill instead.

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Just ran a small test - Quill inserts <p></p> when you hit enter the second time. You can control it using CSS like this:

p:empty {
    margin-bottom: 1rem;
}
p {
    margin-bottom: 0rem;
    margin-top: 0;
}

This removes the normal margin of the p unless the tag is empty.

 
Rene Poulsen
Rene Poulsen
Reply

@Nicolai

The issue is not empty paragraphs. The issue is just the paragraphs and not being able to create just a line break. In my example I have not empty paragraphs - i just have paragaphs. When using paragraphs there's a margin-bottom attribute set - and that's all good 'cause we need to be able to create new paragraphs. But we really need the ability just create a linebreak as well. I really can't see why we shouldn't be able to that.

 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

I understand, and my CSS fix will fix that issue and your code will render the same in Quill as in your frontend.

I understand you want it and the need. But Quill currently do not support it..........

 
Daniel Gamborg
Reply

Are there any updates regarding this comment? :) 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Daniel

Not much. We have found this pen https://codepen.io/mackermedia/pen/gmNwZP that we have added to a feature request to look into this. So we will try to get this working.

devops#20770

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

One note is that Quill is doing <p></p> on line breaks - and renders them without margin and padding on the top.

My CSS will do the same in the frontend, and I do believe that is a better solution - espescially because the user will not be able to tell the difference between [ENTER] and [SHIFT + ENTER]

 
Kasper Legarth
Reply

I think the "shit+enter" should be a requirement. It is a very common feature, our customers know i from word etc. Or if we upgrade them from a DW9 to a 10, they get a solution that no longer supports basic features for the editor?

I found and old blog post that solve the problem, maybe that could be a solution? https://billauer.co.il/blog/2021/12/quill-br-shift-enter/ 

If not, there should be an option to change back to another editor like tinyMCE.or tiptap

 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Kasper

We are looking into it as I wrote above. The reason we have Quill is that TinyMCE now requires payments for each installation we do of Dynamicweb that would increase your license of around 20%. I do not know TIPTAP - it looks interesting, but it also looks like we could run into a license issue with that as well.

Either way - I understand the need, we have a feature registered for it, we are trying to make it work, and I have provided a temporary workaround - which is also backwards compatible.

I am on it!

BR Nicolai

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

I can inform that this feature has now been implemented and will be released with next DW 10 minor.

 
Rene Poulsen
Rene Poulsen
Reply

@Nicolai I just upgraded one of our solutions to 10.8.4 - doesn't seem like theres anything fixed regarding the breaks in the RTE here? When I take a look at this page: https://doc.dynamicweb.dev/documentation/fundamentals/dw10release/releasenotes/ringdetails/detailsring1.html I can't find the 20770 anywhere. We have to launch the solution november 19th and the customer really needs this feature - they have several places where they need to be able to use the br tag in instead of p. And we would really like NOT to have empy p tags all over the page :-)

When can we expect a fix?

 
Rene Poulsen
Rene Poulsen
Reply

@Nicolai any news on this? We desperately need this! I've upgraded a couple of solutions with no luck. And I'm sorry, but we really don't want to populate our DOM with a lof of empty p tags (which your fix would require). That's simply a no-go! So could you give us an ETA of the ability to create <br /> (normal lineshift) in the RTE?

Thanks in advance.

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

This has been released in latest 10.9 yesterday

Usually we release new minors (10.7, 10.8, 10.9) the last Tuesday of each month which includes any new features that has completed. See more here: https://doc.dynamicweb.dev/documentation/fundamentals/dw10release/releasepolicy.html

With that change, you can hit SHIFT+ENTER to insert a break. I just saw yesterday that you cannot see the difference in the editor - but you can in the frontend. We will fix that asap for 10.9.1

 
Rene Poulsen
Rene Poulsen
Reply

Perfect. Just upraded and its working. Thank you :-)

 

You must be logged in to post in the forum