2

basically guys i will like to layout a website with dojo where by i will have a header, content area ( this is divided in two with some accordions in the left pane and the right for the main content) then a footer.

since i need the site to always have this layout i decided to put it in the master layout. however when i view the site, i see the default index page alright but its not in the pane as i was hoping and none of the dijit widgets gets rendered.

not sure if pasting large code in a post is allowed if not i am sorry but below is the code for the master layout. i have not done much to the default zend tool structure. i have only created a couple of modules:

    <?php
    Zend_Dojo::enableView($this);

    $this->dojo()->setCdnBase(Zend_Dojo::CDN_BASE_GOOGLE)
            ->addStyleSheetModule('dijit.themes.tundra')
            ->setDjConfigOption('parseOnload', TRUE)
            ->setDjConfigOption('locale', 'en-GB')
            ->setDjConfigOption('isDebug', TRUE);
    echo $this->dojo();
    ?>

    <script type="text/javascript">
        dojo.require("dijit.layout.ContentPane");
        dojo.require("dijit.layout.BorderContainer");
        dojo.require("dijit.layout.TabContainer");
        dojo.require("dijit.layout.AccordionContainer");
    </script>
</head>
<body>
    <div dojoType="dijit.layout.BorderContainer" gutters="true" id="borderContainer">
        <div id="header" dojoType="dijit.layout.ContentPane" region="top" splitter="false">
            <div id="logo">
                <img src="/images/logo.gif" />
            </div>

            <div id="menu">
                <a href="<?php echo $this->url(array(), 'home'); ?>">HOME</a>
                <a href="<?php echo $this->url(array('page' => 'services'), 'static-content'); ?>">SERVICES</a>
                <a href="#">CONTACT</a>
            </div>
        </div><!-- end header -->

        <div dojoType="dijit.layout.BorderContainer" liveSplitters="false" design="sidebar"
             region="center" id="content">
            <div dojoType="dijit.layout.AccordionContainer" minSize="20" style="width: 300px;"
                 id="leftAccordion" region="leading" splitter="true">
                <div dojoType="dijit.layout.AccordionPane" title="One fancy Pane">
                </div>
                <div dojoType="dijit.layout.AccordionPane" title="Another one">
                </div>
                <div dojoType="dijit.layout.AccordionPane" title="Even more fancy" selected="true">
                </div>
                <div dojoType="dijit.layout.AccordionPane" title="Last, but not least">
                </div> <!-- end AccordionContainer -->
            </div>
            <div dojoType="dijit.layout.TabContainer" region="center" tabStrip="true">
                <div dojoType="dijit.layout.ContentPane" title="My first tab" selected="true">
                    <?php echo $this->layout()->content ?>
                </div>
                <div dojoType="dijit.layout.ContentPane" title="My second tab">
                    Lorem ipsum and all around - second...
                </div>
                <div dojoType="dijit.layout.ContentPane" title="My last tab" closable="true">
                    Lorem ipsum and all around - last...
                </div>
            </div>

        </div>
        <div id="footer">
            <p>Created with <a href="http://framework.zend.com/">Zend Framework</a>. Licensed under <a href="http://www.creativecommons.org/">Creative Commons</a>.</p>
        </div><!-- end footer -->
    </div>
Napoleon
  • 879
  • 2
  • 14
  • 36
  • Just a note, you probably don't need to nest two BorderContainers for your purposes; one with top/left/bottom/center regions ought to be enough. Have a look at the "more advanced example" here: http://dojotoolkit.org/reference-guide/dijit/layout/BorderContainer.html#more-advanced-example Also, you're missing `class="tundra"` on your body tag to actually apply the theme. – Ken Franqueiro Jan 25 '11 at 00:00

1 Answers1

0

You have a typo when setting your dojo config options. Instead of

->setDjConfigOption('parseOnload', TRUE)

it needs to be

->setDjConfigOption('parseOnLoad', TRUE)

Watch the uppercase 'L'. If you fix this then at least the dojo parser will do it's job.

Didn't check if your layout is OK, see the comment of Ken.

Marc
  • 1,900
  • 14
  • 22