• Login
  • Register

DNN Forums

A community discussion page. We're starting from scratch, so...let's get the party started!

HTML Module Content

You are not authorized to post a reply.
Sort:


Basic Member


Posts:29
Basic Member

    Hello

    I have edited the HTML module to prevent it from stripping code.  Although the module now allows the code, it ignors large sections of it and won't display as expected. For example, the 'Display:flex' element is ignored.   Yet the 'flex' element is used within the nvQuicktheme which I am using.

    Please advise what I need to edit to enable the HTML module to process and display as required. 

    Thank you.

     



    Veteran Member


    Posts:639
    Veteran Member

      It is not the HTML module that you want to be changing. You want to do this using the HTML Editor Configuration.

      You do this under Site Settings, Site Behavior, More and then click the button that says Open HTML Editor Manager.

      But first, which version of DNN are you using? And, when you open the HTML Editor Manager, which editor is being used? You will see the Current Provider at the top of the page.

      Then, go to the Editor Config tab and change the contents of the Allowed Content box from false to true. I think that will do it for you.

      For more information you need to visit the CK Editor's home page (ckeditor.com) and check out the many available configuration options.
      Joe Craig
      DNN MVP
      Patapsco Research Group


      Basic Member


      Posts:58
      Basic Member

        Joyce, is your code being ignored because it was altered by the editor? Or is the code intact but ignored? If the latter, then perhaps you need to make sure the code is well-formed, spelled correctly with all the right syntax. This could be a simple syntax issue.



        Basic Member


        Posts:29
        Basic Member

          Thank you both for your reply and advice, it is much appreciated. I am using DNN 9.6.2

          Joe I am using the HTML editor but I found that it was stripping out sections of the html code. I navigated to the HTML Editor Manager/Editor config tab and in the "extra allowed content" I added -*.*{*}> This then allowed me to enter html without portions of it being removed.

          Mark the code was intact but ignored.
          Perhaps there is some error in the syntax, but I had tried several codes copy/paste from Bootstrap Snippet and Codepen, some very simple codes but nothing worked as expected or demonstrated. Perhaps there is something in these codes that DNN doesn't like.

          I will try start from scratch and write my own html.

          Thank you for your help.


          Veteran Member


          Posts:639
          Veteran Member

            About Bootstrap snippets -- that should work just fine.

            Are you sure that the Bootstrap components are being loaded? Are they shown in the browser's Developer Tools? Check the Console window for errors. Can you inspect elements and verify that Bootstrap CSS is actually being applied?
            Joe Craig
            DNN MVP
            Patapsco Research Group


            Basic Member


            Posts:58
            Basic Member

              You can also put your code in the module settings, in the header or footer. Code in there is not altered by the editor. Use that spot for testing, and then move the code to the editor (in source mode of course) I wouldn't go back and forth like that all the time I use code, but it may help you determine if the editor is the problem.



              Veteran Member


              Posts:629
              Veteran Member

                Posted By Joyce on 29 Jul 2020 10:15 AM
                Thank you both for your reply and advice, it is much appreciated. I am using DNN 9.6.2

                Joe I am using the HTML editor but I found that it was stripping out sections of the html code. I navigated to the HTML Editor Manager/Editor config tab and in the "extra allowed content" I added -*.*{*}> This then allowed me to enter html without portions of it being removed.

                Mark the code was intact but ignored.
                Perhaps there is some error in the syntax, but I had tried several codes copy/paste from Bootstrap Snippet and Codepen, some very simple codes but nothing worked as expected or demonstrated. Perhaps there is something in these codes that DNN doesn't like.

                I will try start from scratch and write my own html.

                Thank you for your help.


                Often these code snippets depend on extra loaded libraries, which is why they fail standalone, in general it's not that DNN is blocking them but there's a dependency missing.

                I stopped using the HTML module for things like this as it's cumbersome, does not allow loading of extra JS or CSS etc. BTW.

                I use Open Content for this (and a lot more):

                1. Install OC
                2. Place the OC module on a page (the first time you do this it generates the templates folder)
                3. On the file system go to \Portals\[myportal]\OpenContent\Templates
                4. Create a folder with a logical name for you template
                5. Create a text file and rename it to 'template.hbs'
                6. now re-visit the page you place OC on and refresh it.
                7. You should be able to select the template you just created now.
                8. You HTML should be on you site.
                9. If you want to add CSS or JS you can add a tempalte.css of tempalte.js in tha folder file and OC will load it for you.
                10. As a host you can also edit the templates from DNN through Module actions > [pen icon] > [Edit Template Files]
                11. And you can now base new templates on the one you just created from the DNN admin interface ([Advanced] when selecting a template.)

                Open Content has a lot more options and possibilities, but this is a nice one I use for blocks of HTML.

                https://opencontent.readme.io/

                https://github.com/sachatrauwaen/OpenContent

                 



                Basic Member


                Posts:29
                Basic Member

                  Thank you everybody for your advice and support.
                  I tried adding code in the header and it worked, but as Timo mentioned it is cumbersome to do this.
                  I shall certainly try using the Open Content, thanks Timo, that seems like a very good solution.
                  You are not authorized to post a reply.

                  These Forums are dedicated to discussion of DNN Platform.

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

                  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
                  2. 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.
                  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
                  4. No Flaming or Trolling.
                  5. No Profanity, Racism, or Prejudice.
                  6. Site Moderators have the final word on approving / removing a thread or post or comment.
                  7. 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