Frage

Hi i want to put two div in a zend view. After i want to have the two div in different position. My problem is that i want to have the normal content adn i want to add another div that rapresent the side menu For example my view is:

<div id="view-menuscritte"> 
List menu   
</div>
<div id="view-content">
<?php
    echo $this->errorMessage;
    echo $this->form;
?>
</div>

When I use in my layout

<div id="menu"> 
    <img id="menusopra" src=<?php echo $this->baseUrl().'/img/menusopra.jpg'; ?> >
    <div id="menuscrittegenerale">
        <?php echo $this->layout()->menuscritte; ?>
    </div>  
    <img id="menusotto" src=<?php echo $this->baseUrl().'/img/menusotto.jpg'; ?> 
</div>  

<div id="contentgenerale">
<?php echo $this->layout()->content; ?>
</div>

The problem is that the two div (->content and ->menuscritte) are in the same div. view-menuscritte is not in menuscrittegenerale where it could be.

War es hilfreich?

Lösung

Inside folder of layout.phtml , create menu.phtml cut and paste following content from your view into menu.phtml

<div id="view-menuscritte"> 
List menu   
</div>

Now in your layout.phtml replace

 <?php echo $this->layout()->menuscritte; ?>

with

<?php echo $this->partial('menu.phtml);?>
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top