January 15, 2021

How to add a counter/timer?

We got this question within Continental: How to add a counter in a Connections page?
I share here the solution/ answer to it.

Free Counter hosting site

There are some sites that provide free counter hosting.

Iframe

The next step is simply to Iframe the URL in Connections or your Web Page.

Simply switch in the editor to the HTML source and paste the HTML code where you want to have the counter inserted.

Example of iframe:

Example how it is rendered:
Be careful to use a https URL not a http one as src.
In case you use http, Connections does not render the iframe at all. (no error text)

Failed Attempts

Own HTML for counter

You can create a timer in HTML as explained here:

Hosting HTML in Connections

I have tried to host a HTML file in Connections Files but the iframe around it does not work: when the page loads it tries to download the HTML file.

Example of Iframe tried:

I've been careful to use the Download link as src.

Alternative Hosting

SharePoint Online / O365

Alternatively, you could host the HTML somewhere else but note hosting files in SharePoint Online currently does not work. (some authorization/ handshake issues) This issue is blocked each side saying it is the other's fault (my understanding)

GitHub Pages

For us a working workaround is to host HTML code in GitHub.
It works nicely now also the iframing in Connections since our GitHub supports now https access.

No comments:

Post a Comment