eZ Community » Forums » Extensions » ezstarrating - not loading CSS, JS, etc.
expandshrink

ezstarrating - not loading CSS, JS, etc.

ezstarrating - not loading CSS, JS, etc.

Thursday 25 February 2010 6:27:21 pm - 5 replies

I have a 4.2 installation where I'm using ezstarrating. However, by default I'm just seeing a bulleted list of numbers, no stars, no working javascript. If I force the include of ezsrrating.css in my pagelayout.tpl, I can see the white stars, but even if I force the include of http://real.us.yimg.com/lib/yui/2...d/yahoo-dom-event/yahoo-dom-event.js in pagelayout, the JS still doesn't work.

I have given the anonymous user full access to all functions of ezjscore.

It seems as though the ezcss_require and ezscript_require in extension/ezstarrating/design/standard/templates/content/datatype/view/ezsrrating.tpl are simply not running. Is there any way to fix that?

I would really appreciate any ideas! Thanks in advance.

Thursday 25 February 2010 6:35:35 pm

Related to this it seems:http://share.ez.no/forums/developer/star-rating-star-images-available
Do you get any JS error ?
Cheers,

Thursday 25 February 2010 6:56:02 pm

Thanks for the reply - no JS error, because it wasn't loading any JS files.

I found these instructions in the ezjscore FAQ:

-------------------
FAQ for ezjscore 1.0
====================
Q: I used the ezcss_require()/ezscript_require() template operator in my code but no css/js files are included in my html page
A: You need to put the ezcss_load()/ezscript_load() template operator in your pagelayout template.
For an example, see the templates provided in the extension in desugn/ezwebin/templates
-------------------
I copied the ezcss_load & ezscript_load calls out of the ezjscore sample templates, and now I can see the stars and I can vote! It seems odd to me that this call is required to make ezstarrating work.

Of course, now I have a new problem: It's showing me 6 stars instead of 5 (the last 2 both count as a "5" vote).

Thursday 25 February 2010 8:16:14 pm

In the end, it looks like my issue was some style rule collisions with the CSS I'm using for my site. I've got it mostly working now - the big piece was definitely including the ezcss_load & ezscript_load calls in pagelayout.tpl.

Thursday 25 February 2010 9:41:58 pm

Hi Jordan!

ezjscore will out of the box override the page_head_[style|script].tpl files or similar in admin and ezwebin (and flow), for custom sites you'll have to change your script and style loading to use ez[css|script]_load() as described in the ezjscore article* and briefly in the faq.

Hope this helps blunk.gif Emoticon

* http://share.ez.no/articles/ez-pu...ublish-javascript-and-ajax-framework

Thursday 25 February 2010 10:27:59 pm

Thanks, Andre. That was exactly the problem, the pagelayout we were using on this site did not include page_head_*, it had been pared down all the way to bare-bones. Adding empty calls to ezcss_load() and ezscript_load() to my header include fixed the issue.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from