Guest view issue with javascript

Permalink
Hi,

First of all thank you for taking the time to read my post. I am very new to concrete 5 but I am not new to researching my own solutions to problems. So I have at least made some effort to sort this out before asking for help here. Trouble is a lot of the solutions are pre 5.7 so have not helped me thus far.

Its fairly simple to explain. http://www.lsmo.club has a countdown to a club even happening next year. Its a JavaScript that is contained within a html block. Trouble is that when viewing as a guest or completely logged out the timer disappears. The simple html text still remains visable "2016 London to Brighton run (May 21st) begins:" so not sure its a block permission issue.

I found a post that seemed promising saying I needed:
$this->requireAsset('javascript', 'jquery');

in my page_theme file. But upon checking that file it was clearly there already. If it helps I am using the supermint theme.

Any suggestions would be greatly appreciated.

Thank you

Jay

GreymanUK
 
GreymanUK replied on at Permalink Reply
GreymanUK
In addition to guests not seeing the countdown I have now made a dummy user account and it would seem only administrators can see this clock.

Not sure if that is relevant or helps narrow down the issue.

Thanks again.

Jay
abigwonderful replied on at Permalink Best Answer Reply
abigwonderful
Howdy Jay,
I just had a look at the url you listed and noticed this error:
Uncaught ReferenceError: _ is not defined

It looks like the script you are using is dependent on underscore.js but I'm not seeing it anywhere in your source code...
GreymanUK replied on at Permalink Reply
GreymanUK
Thank you for the help. You were indeed right. I just needed to add a line to my block controller to load that underscore.js and it seemed to fix it.

Thank you again.

Jay
abigwonderful replied on at Permalink Reply
abigwonderful
No problem glad to help!
Sam