How to create a 3rd module position over left menu

  • enemy1
    Inactive member
  • Topic Author
  • New Member
  • New Member
More
12 years 3 weeks ago - 12 years 2 days ago #23715 by enemy1
Hello,
I want to create a 3rd module above the left menu ('left' position). My idea is to make the same module position 'left2' over the left menu.



I added this line to templateDetails.xml

<position> left3 </position>


I know that I need to add this code in index.php:

<div id="left3">
<div class="left3">
<jdoc:include type="modules" name="left3" style="none" />
</div>
</div>


but I don't know in which line to add this code.

This is my code:

<div class="main_area">
        <?php
            if($columnLayout=="mlr") {
                require(dirname(__FILE__).DS.'inc'.DS.'col_main.php');
                require(dirname(__FILE__).DS.'inc'.DS.'col_left.php');
                require(dirname(__FILE__).DS.'inc'.DS.'col_right.php');
            } else if($columnLayout=="lrm") {
                require(dirname(__FILE__).DS.'inc'.DS.'col_left.php');
                require(dirname(__FILE__).DS.'inc'.DS.'col_right.php');
                require(dirname(__FILE__).DS.'inc'.DS.'col_main.php');
            } else {
                require(dirname(__FILE__).DS.'inc'.DS.'col_left.php');
                require(dirname(__FILE__).DS.'inc'.DS.'col_main.php');
                require(dirname(__FILE__).DS.'inc'.DS.'col_right.php');
            }
            ?>
        <div class="clr"></div>
    </div>
    <?php if ($bottommodules) { ?>
    <div class="bottom">
        <?php if($showuser[5]) { ?>
        <div class="modulerow<?php echo $bottommodules; ?>"><div id="c1"<?php if (!$showuser[6] && !$showuser[7] && !$showuser[8]) { ?> class="last"<?php } ?>><jdoc:include type="modules" name="user5" style="hot" /><div class="clr"></div></div></div>
        <?php } if($showuser[6]) { ?>
        <div class="modulerow<?php echo $bottommodules; ?>"><div id="c2"<?php if (!$showuser[7] && !$showuser[8]) { ?> class="last"<?php } ?>><jdoc:include type="modules" name="user6" style="hot" /><div class="clr"></div></div></div>
        <?php } if($showuser[7]) { ?>
        <div class="modulerow<?php echo $bottommodules; ?>"><div id="c3"<?php if (!$showuser[8]) { ?> class="last"<?php } ?>><jdoc:include type="modules" name="user7" style="hot" /><div class="clr"></div></div></div>
        <?php } if($showuser[8]) { ?>
        <div class="modulerow<?php echo $bottommodules; ?>"><div id="c4" class="last"><jdoc:include type="modules" name="user8" style="hot" /></div></div>
        <?php } ?>
        <div class="clr"></div>
    </div>
    <?php } ?>
    <div class="footer_wrap">
        <div class="footer">
            <div class="footer_pad">
                <jdoc:include type="modules" name="footer" />
            </div>
        </div>
        <div class="footer2">
            <div class="footer_pad">
                <jdoc:include type="modules" name="bottom" style="none" />
            </div>
        </div>
    </div>
  <div style="clear:both"></div>
</div></div>
<jdoc:include type="modules" name="debug" style="none" />
<?php if($scrollToLoad) { ?>
<div id="message">
  <a href="#top" id="top-link"><img src="<?php echo $template_path ?>/images/top.png" width="53" height="53" alt="top" /></a>
</div>
<?php } ?>   
</body>


Could you help me?

Thank you.
Antonio
Attachments:
Last edit: 12 years 2 days ago by enemy1.

Please Log in to join the conversation.

More
12 years 3 weeks ago #23723 by ivan.milic
there is folder /inc with file col_left.php maybe you should place your code it it
The following user(s) said Thank You: enemy1

Please Log in to join the conversation.

  • enemy1
    Inactive member
  • Topic Author
  • New Member
  • New Member
More
12 years 2 weeks ago - 12 years 2 weeks ago #23866 by enemy1
Thank you so much! :laugh: I succeeded!

I have another question. B)

I want that when the position left3 is disabled the left1 and left2 appear in the region of left 3.

I tried to modify the index.php in this way:

Code:
<?php // module states $showadvert[1] = $this->countModules('advert1'); $showadvert[2] = $this->countModules('advert2'); $showadvert[3] = $this->countModules('advert3'); $showadvert[4] = $this->countModules('advert4'); $showuser[5] = $this->countModules('user5'); $showuser[6] = $this->countModules('user6'); $showuser[7] = $this->countModules('user7'); $showuser[8] = $this->countModules('user8'); $showleft3 = $this->countModules('left3'); $showleft = $this->countModules('left'); $showleft2 = $this->countModules('left2'); $showright = $this->countModules('right'); $showright2 = $this->countModules('right2'); $showuser1 = $this->countModules('user1'); $showuser2 = $this->countModules('user2'); $showuser3 = $this->countModules('user3'); $showbreadcrumbs = $this->countModules('breadcrumbs'); $showtoolbar = $this->countModules('toolbar'); $showinset = $this->countModules('inset'); $uppermodules = 0; for ($loop = 1; $loop <= 4; $loop += 1) { if($showadvert[$loop]) { $uppermodules++; } } $bottommodules = 0; for ($loop = 5; $loop <= 8; $loop += 1) { if($showuser[$loop]) { $bottommodules++; } } ?> <?php // template parameters // template layout $templateWidth = $this->params->get("templateWidth", "980"); $textDirection = $this->params->get("textDirection", "ltr"); $columnLeftWidth = 0; $columnRightWidth = 0; $columnLeftPad = 0; $columnRightPad = 0; $templateWidthOutside = $templateWidth + 60; if ($showleft || $showleft2 || $showleft3) { $columnLeftWidth = $this->params->get("columnLeftWidth", "285"); $columnLeftPad = 8; }else{ $columnLeftWidth = 0; $columnLeftPad = 0; }


but when left3 is disabled I show this:




and this is with left3:



How can I do?

Thanks a lot! :)
Attachments:
Last edit: 12 years 2 weeks ago by enemy1.

Please Log in to join the conversation.

  • milos
    Support Staff
  • Moderator
  • Moderator
More
12 years 2 weeks ago #23868 by milos
You must give us live link to your site where this error appears. We'll have to inspect code and look for a possible solution.
The following user(s) said Thank You: enemy1

Please Log in to join the conversation.

  • enemy1
    Inactive member
  • Topic Author
  • New Member
  • New Member
More
12 years 2 weeks ago #23875 by enemy1
This is the example page in which you can see the problem of the module position when the left3 is disabled.

page without left3

Please Log in to join the conversation.

More
12 years 2 weeks ago #23877 by ivan.milic
This would be code:

$showleft = $this->countModules('left');
$showleft2 = $this->countModules('left2') && !$showleft;
$showleft3 = $this->countModules('left3') && !$showleft;
The following user(s) said Thank You: enemy1

Please Log in to join the conversation.

Time to create page: 0.174 seconds
Powered by Kunena Forum