DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

disappearing content

 9 Replies
 3 Subscribed to this topic
 30 Subscribed to this forum
Sort:
Author
Messages
Growing Member
Posts: 48
Growing Member

I am trying to insert a line of source code to call a widget, there other content on the same HTML module. When I switch from basic text to rich text the html line disappears. not sure what's causing it because we have been using widgets like these forever. 

For example, the code below works we add text and image using Rich Text and we can include the code using Basic HTML text box. and we switch back and forth between Basic and Rich text. 

<!-- If you would like to customize the button, remove or change the "class" attribute inside the tag --> See MENU & Order Table Reservation

 

This code will not 

Any ideas, what should I be looking at. The developer thinks is the editor. I am not a developer but I could tell him where to look.

I can get more info if necessary. 

Veteran Member
Posts: 838
Veteran Member
3 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!

Hi Franc,

I think https://dnncommunity.org/...-is-cleaning-my-HTML is what you are looking for.

Growing Member
Posts: 48
Growing Member

What I am trying to figure out is, why can I use the first code set and it works fine without changing the editor options and not the second code set.
I keep assuming there must be something inside the second code set that CKEditor doesn't like. I have tried your recommendation  here are the results. https://lluly.momzey.com/Vidi

Below the images your can see the text box I have been working with starting with 1st line

right below you can see "See Menu & Order" which is another html code set and works with no issues. 

Senior Member
Posts: 1607
Senior Member
MVP
MVP
You're an MVP!
New Poster
New Poster
Congrats on posting!

Well, the HTML editor itself strips out a lot of HTML due to security reasons.  The blog Tycho posted in this thread explains this pretty well.  Also, we as a community only kind of maintain this editor.  Basically, the maintenance is to ensure we're at a decent version of the CKeditor, and to be sure it's integrated.  We don't do much to actually control it's features, outside of normal website deployment stuff (e.g., custom toolbar buttons).  

So, you might get a better response about the "why" of it at the CKEditor website.  (I'm not trying to push you away at all. They just might be able to better respond to that question.)  That link in the previous sentence describes some of the HTML stripping logic too.  

However, my best guess is the formatting of the HTML.  The editor might be ignoring the <code><script></code> tag in the first instance because it's wrapped within a <code><p></code> tag.  This is technically invalid HTML.  In the second instance, the <code><script></code> tag is outside of the other HTML and might be triggering the HTML validation differently.  🤷🏽‍♂️ 

Growing Member
Posts: 48
Growing Member

Will, I completely agree with you, I definitely know there is something wrong with the HTML or what's in it. I am not expecting you guys to fix it. Just to point me to some direction and I think you guys did. On the other hand my real problem is the developer working on it.   

Thank you for all.

Veteran Member
Posts: 838
Veteran Member
3 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!

I just tested and indeed the fix in the blog article works. The fact that the script tag is not in the correct place is of no influence.  

Senior Member
Posts: 1607
Senior Member
MVP
MVP
You're an MVP!
New Poster
New Poster
Congrats on posting!
Posted By Tycho de Waard (SU) on 2/9/2023 1:12 PM

I just tested and indeed the fix in the blog article works. The fact that the script tag is not in the correct place is of no influence.  

Thanks for looking further into this, Tycho!  :) 

 

Growing Member
Posts: 48
Growing Member

Can you share exactly what have you have changed, I thought that by setting AllowedContent  = true for the entire site would allow everything and that's what I did. I did this for the Site and for the module 

I earlier set AllowExtraContent *(*){*} but didn't make any difference.  

As I mentioned I am not a developer "just a lose nut in front of the monitor." I will get another developer to look into it.

Veteran Member
Posts: 838
Veteran Member
3 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!

For a rough check I did exactly that: AllowedContent=true. And of course refresh the page in order to take effect.
There is als RemoveFormatTags where you can remove the span tag and ProtectedSource you can take a look at. Not sure about the impact of that last one as my Regex skills are not 100% :-) 

 

Growing Member
Posts: 48
Growing Member

Thank you for the update. We tried that but our test showed some of the code string was still being cut out.

In the original post I included 2 sets of code one that worked and the one that din't work I just wanted to see if anyone noticed anything obvious causing the one code string to work and one not. They look the same/similar to me, this tells you how much I know. Unfortunately our issue runs deeper.

We may have to rebuild the widget/app internally. 

Thank you for all you help.  

These Forums are for the discussion of the open source CMS DNN platform and ecosystem.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
  2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
  3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  5. No Flaming or Trolling.
  6. No Profanity, Racism, or Prejudice.
  7. Site Moderators have the final word on approving / removing a thread or post or comment.
  8. English language posting only, please.

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved