ZF-7306: Zend Dojo Lightbox - wrong path to style sheet set by helper

Description

// layout header code if( $this->dojo()->isEnabled() ) { $this->dojo()->setLocalPath( "/js/dojo/dojo.js" ) ->addStyleSheetModule( 'dijit.themes.tundra' ); echo $this->dojo(); }

// view script code $this->dojo()->enable() ->setLocalPath( '/js/dojo/dojo.js' ) ->setDjConfigOption( 'parseOnLoad', true ) ->requireModule( "dojo.parser" ) ->requireModule( "dojox.image.Lightbox" ) ->addStylesheetModule( "dojox.image.Lightbox" );

With the above layout/view script code - the css path generated in he header is: "/js/dojox/image/Lightbox/Lightbox.css"

But in ZF 1.8.4 the Lightbox.css file is located at: "/js/dojox/image/resources/Lightbox.css"

Also, if the style sheet is moved to the location expected - /js/dojox/image/Lightbox/Lightbox.css - there is an extra problem with the style sheet being declared before the dojo enabling code. The lightbox popups in the right part of the page - but is not correctly styled.

Adding - after the dojo creation code in the layout header (and not using the method ->addStylesheetModule( "dojox.image.Lightbox" ) in the view script - gets it working.

Comments

addStylesheetModule() is designed specifically for dijit themes, which all follow the convention of .themes...css. It is not designed for including other stylesheets. In such cases, you will need to manually add the stylesheet declaration either using the headLink() view helper, the baseUrl() view helper, or manual paths in your layout script.

An alternate route is to create your own dijit theme; this is a technique I use regularly. In your CSS theme file, you reference the actual theme you want to use via @import url() syntax, plus any other extra CSS files needed (such as your Lightbox.css), utilizing paths relative to the theme CSS file you've created.

Closing; working as designed, and alternate solutions proposed to the reporter.