ezstarrating - not loading CSS, JS, etc.

Author Message

Jordan Hirsch

Thursday 25 February 2010 9:27:21 am

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.7.0/build/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.

Me: http://jordan.teamhirsch.com
My blog: http://wiredformusic.blogspot.com
My other company: http://thinkimprov.com
eZ Certification: http://auth.ez.no/certification/verify/402488
eZ Award: http://ez.no/company/news/ez_awards_2007_prize_winners

Nicolas Pastorino

Thursday 25 February 2010 9:35:35 am

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

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Jordan Hirsch

Thursday 25 February 2010 9:56:02 am

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

Me: http://jordan.teamhirsch.com
My blog: http://wiredformusic.blogspot.com
My other company: http://thinkimprov.com
eZ Certification: http://auth.ez.no/certification/verify/402488
eZ Award: http://ez.no/company/news/ez_awards_2007_prize_winners

Jordan Hirsch

Thursday 25 February 2010 11:16:14 am

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.

Me: http://jordan.teamhirsch.com
My blog: http://wiredformusic.blogspot.com
My other company: http://thinkimprov.com
eZ Certification: http://auth.ez.no/certification/verify/402488
eZ Award: http://ez.no/company/news/ez_awards_2007_prize_winners

André R.

Thursday 25 February 2010 12: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 ;)

* http://share.ez.no/articles/ez-publish/ezjscore-ez-publish-javascript-and-ajax-framework

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Jordan Hirsch

Thursday 25 February 2010 1: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.

Me: http://jordan.teamhirsch.com
My blog: http://wiredformusic.blogspot.com
My other company: http://thinkimprov.com
eZ Certification: http://auth.ez.no/certification/verify/402488
eZ Award: http://ez.no/company/news/ez_awards_2007_prize_winners

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.