DNN Forums

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

adding chat to dnn header or default file

 2 Replies
 2 Subscribed to this topic
 30 Subscribed to this forum
Sort:
Author
Messages
Growing Member
Posts: 67
Growing Member
New Poster
New Poster
Congrats on posting!

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.

    
   
   

 

 

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!
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.
Senior Member
Posts: 1607
Senior Member
MVP
MVP
You're an MVP!
New Poster
New Poster
Congrats on posting!

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.  :)  

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