Installing gitter on my website

Hello,

I'm trying to install gitter on my website(plone version is Plone 5.2.1 (5208))
I created new page on my home. and I put below the script as source code. and I removed "script" tag from HTML filter and added it to valid tags. after I created the page. I can see chat window at the bottom right on my website. but it's locked, and it does not show anything.
so I talked to gitter, and they said "Your Sidecar is broken because of the escaped HTML entities in your script tag ( 
 )". so I was trying to add the tag to HTML filter, but it did not let me do so. so I'm wondering how I can add gitter on my website.

<script>
  ((window.gitter = {}).chat = {}).options = {
    room: 'KorMPG/MayaProgramming'
  };
</script>
<script src="https://sidecar.gitter.im/dist/sidecar.v1.js"></script>

Register your JS code with the resource registry or inject the code through viewlet, not through TinyMCE.

I'm pretty new on plone. so I might need to search for what you said.
thanks for your help.
-Jun

There is a simpler way. We built this plugin for this purpose.

We haven't released it yet but it works.

1 Like

thank you so much. I will try it.

after I tried to buildout with "collective.embedcontent" I'm getting error like below when I tried "./bin/plonectl fg"

ImportError: No module named ATContentTypes.lib.imagetransform

don't think thats coming from our plugin. It has no relation to ATContentTypes.

Another option would be to include the JS snippet with the JS configuration for the analytics JS (control panel -> site). It does not belong there officially but it would make the JS globally available across the complete site.

1 Like

this is my first egg since I installed plone5.2. I have not installed anything yet.

it works like magic. thank you so much.
but for the future reference, would you explain how to implement this on resource registry or viewlet, if it's possible? I was studying these through the documents, but it's little hard to understand for beginner.

Depends on what you are trying to accomplish...if you are developing your own backend functionality then you usually write your own add-on aka a "policy package". When you are more interested in frontend aspects and working on a theme then you may integrate such stuff directly into a theme....see

https://training.plone.org/5/javascript/index.html
https://training.plone.org/5/mastering-plone/index.html

1 Like

thank you so much. I will take a look at it.

Also have a look at this “through the web” (or TTW) customization training. TTW means anything you can do with just your browser, as opposed to having to create add-ons.

In this training, I can think of a couple of ways you could have Plone serve any JavaScript. Andreas’ suggestion is brilliant, but in this training you could have it served from a footer portlet or from a customization of the theme.

https://training.plone.org/5/ttw/index.html

This is how we added Gitter’s sidecar to the plone.org site, by customizing the theme:

Hm that should show line 247 of the rules.xml file, but here is the commit link

thank you so much. I will try it.

Plone Foundation Code of Conduct