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

Issue Type: Bug Created: 2009-07-18T12:15:58.000+0000 Last Updated: 2009-10-31T17:44:26.000+0000 Status: Resolved Fix version(s): Reporter: Joe (joew618) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Dojo

Related issues: - ZF-7710



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


Posted by Matthew Weier O'Phinney (matthew) on 2009-07-18T14:30:26.000+0000

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.

Posted by Matthew Weier O'Phinney (matthew) on 2009-07-18T14:31:27.000+0000

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

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.