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. <p style="text-align:center"><!-- If you would like to customize the button, remove or change the "class" attribute inside the <span> tag --> <span class="glf-button" data-glf-cuid="241bd514-24be-4303-934c-b19d0dcf65c9" data-glf-ruid="3f277e2f-6eb5-42e7-908c-c7f84ea9b830" > See MENU & Order</span> <span class="glf-button reservation" data-glf-cuid="241bd514-24be-4303-934c-b19d0dcf65c9" data-glf-ruid="3f277e2f-6eb5-42e7-908c-c7f84ea9b830" data-glf-reservation="true" > Table Reservation</span> <script src="https://www.fbgcdn.com/embedder/js/ewm2.js" defer async ></script> </p>
This code will not <span id="glf6c03df95-f376-79bb-b04f-125e56d5b02b" style="" class="WGI" data-glf-cuid="08db7d8d-f090-4035-817a-3d34ed77fd8d"data-glf-ruid="2080"></span> <script src="https://appdev.momzey.com/js/siteJs/ModalScript.js"></script>
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.
Hi Franc,
I think https://dnncommunity.org/...-is-cleaning-my-HTML is what you are looking for.
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.
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 <script> tag in the first instance because it's wrapped within a <p> tag. This is technically invalid HTML. In the second instance, the <script> tag is outside of the other HTML and might be triggering the HTML validation differently. 🤷🏽♂️
<script>
<p>
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.
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.
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! :)
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.
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% :-)
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 dedicated to the discussion of DNN Platform.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.