Web Analytics Made Easy -
StatCounter Can Joomla output different divs based on a modules position? - CodingForum

Announcement

Collapse
No announcement yet.

Can Joomla output different divs based on a modules position?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can Joomla output different divs based on a modules position?

    I am using Joomla 1.5 and have a want to know if/how I can use php to control the number of divs which are outputted by a module based on the position the module is using.

    For example, I am using module extension GK News Show 3, I am using it in the "right" module position, and above my component in a position called "middleupper".

    The "middleupper" position uses flexable widths and either squared (1 div) or rounded corners (4 divs).

    The "right" position uses a fixed width and either squared (1 div) or rounded corners (4 divs).

    I want to alter things so if the module is displayed in the "right" position it can displayed with either squared (1 div) or rounded corner (2 divs) - 2 divs for fixed width corners instead of 4 divs rounded corners.

    I still want the other options as well, but can it be done? Can a module alter its display depending on it
    module position??

    The code for displaying rounded corners using 4 divs is -
    PHP Code:
    if($this->na < $this->news_amount) $this->news_amount = $this->na;

    ?>


    <?php for($b=0;(($this->news_amount-($b*$this->news_column))>0);$b++) : ?>
       

       
       <?php for($c=0;$c<$this->news_column;$c++) : ?>
          <?php
             
    if($this->news_column == 1)
             {
                
    $tablecell_class 'gk_news_show_center';
             }
             elseif(
    $this->news_column == 2)
             {
                
    $tablecell_class = ($c == 0) ? 'gk_news_show_left' 'gk_news_show_right';
             }
             else
             {
                if(
    $c == 0)
                {
                   
    $tablecell_class 'gk_news_show_left';
                }
                else
                {
                   if(
    $c == ($this->news_column 1) )
                   {
                      
    $tablecell_class 'gk_news_show_right';
                   }
                   else
                   {
                      
    $tablecell_class 'gk_news_show_center';
                   }
                }
             }
          
    ?>
             

    <div class="<?php echo $tablecell_class?>">
    <?php if($this->rounded):?>
    <div class="gk_round">
    <div>
    <div>
    <div>
    <?php endif; ?>          
    <?php if(isset($news_code_html_tab[(($b*$this->news_column)+$c)]))echo $news_code_html_tab[(($b*$this->news_column)+$c)];?>
    <?php 
    if($this->rounded):?>   
    </div>
    </div>   
    </div>
    </div>

    <?php endif; ?> 
    </div>      

    <?php endfor; ?>
    <?php 
    endfor; ?>

  • #2
    Does anyone know how to alter output based on which position a module is using?

    Comment

    Working...
    X