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.

eZ debug

Timing: Jan 18 2025 02:21:46
Script start
Timing: Jan 18 2025 02:21:46
Module start 'layout'
Timing: Jan 18 2025 02:21:46
Module start 'content'
Timing: Jan 18 2025 02:21:46
Module end 'content'
Timing: Jan 18 2025 02:21:46
Script end

Main resources:

Total runtime0.0133 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 589.0547152.6250
Module start 'layout' 0.00510.0024 741.679739.4453
Module start 'content' 0.00760.0038 781.1250101.3672
Module end 'content' 0.01140.0019 882.492242.3047
Script end 0.0132  924.7969 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002821.1417140.0002
Check MTime0.00128.9238140.0001
Mysql Total
Database connection0.00075.195210.0007
Mysqli_queries0.002317.572930.0008
Looping result0.00000.089810.0000
Template Total0.001611.710.0016
Template load0.00096.437510.0009
Template processing0.00075.263410.0007
Override
Cache load0.00064.879310.0006
General
dbfile0.00021.579880.0000
String conversion0.00000.044940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs