DNN Forums

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

adding chat to dnn header or default file

Sort:
You are not authorized to post a reply.





Growing Member





    we're trying to add an external chat snippet to our DNN site, but it isn't working at the moment. The snippet works outside DNN so I'm wondering if there is something about DNN that would stop this code from working?

    I have tried placing the snippet in the the default.aspx file and admin/skins/myheader.ascx file. I've tried in both the head and body of the default page, but it doesn't work.

    We have used a different chat provider in the past and their snippet of code worked ok in the same place as above.

        
       <link type="text/css" rel="stylesheet" media="screen" href="https://xmpp-  contact.unlimitedhorizon.co.uk/resource/webchat/client/converse.css" /> <script src="https://xmpp-contact.unlimitedhorizon.co.uk/resource/webchat/client/converse.js"> <script src="https://xmpp-contact.unlimitedhorizon.co.uk/resource/webchat/client/emojis.js"> <script> window.webchatConfig = { accessName: "SYPAWebChat", postfix: "sypaorguk-67127", chatComponent: "tcc", xmppDomain: "xmpp-contact.unlimitedhorizon.co.uk", language: "en", autoOpenTime: "0", BOSHServiceURL: "https://xmpp-contact.unli...hat/bosh/bosh", primaryColor: "#3AA569", titleText: "SYPAWebChat.sypaorguk-67127", assetsPath: "https://xmpp-contact.unli...ebchat/client/"} </script>
        </head>

     

     






    Veteran Member





      Most of the time there are 2 suspects:
      1. a url is not granted to use the chat. If you pay for domain.com, you can not always use it for staging/domain.com
      2. the csp (content security policy) is blocking the external script. If that is the case, you need to create/adjust the csp so the external url is allowed on your domain.
      Tjep's digital agencyRegards,
      Tycho de Waard

      Tjep's digital agency
      We just love DNN
      https://www.tjeps.com





      Veteran Member





        If you need something on every page and don't want anyone to manage it in any way, you should do one of the following:  

        1. Put it in the theme file. This can be as easy as copy and paste.   
        2. Create a theme object and put that in your theme file.  (This is a great option if you wish to maintain and track the source code.)

        NEVER, ever, ever, ever change the core code files of DNN.  You're opening yourself up to potential hacks in the future.  

        If you wish for people to be able to log in to manage this snippet, then use another option instead to inject the content.  For example, my Content Injection module does this very well.  :)  

        Download the Content Injection module 

        The screenshots are quite old at this point, but this old blog post of mine shows you how to use the content injection module.  The editing paradigm in DNN is going to be way different, but the module itself still functions mostly the same.  :)  

        One day, I'll remember to add updated instructions here.  :)  

        You are not authorized to post a reply.

        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:

        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