Override com_content category Error at listing article - Joomla! Forum - community, help and support


hello,

i tried override com_content\category display :
    category
  • sub-category
    • an article
    • an article

i modified default_children.php :

code: select all

<?php
/**
 * @package      joomla.site
 * @subpackage   com_content
 * @copyright   copyright (c) 2005 - 2012 open source matters, inc. rights reserved.
 * @license      gnu general public license version 2 or later; see license.txt
 */

// no direct access
defined('_jexec') or die;
?>
<?php if (count($this->children[$this->category->id]) > 0) : ?>
   <ul id="vertical">
      <?php foreach($this->children[$this->category->id] $id => $child) : ?>
         <li>
            <h4>
               <span class="categorie_title"><?php echo $this->escape($child->title); ?></span>
               <?php if ($child->description) : ?>
                     <?php echo jhtml::_('content.prepare', $child->description, '', 'com_content.category'); ?>
               <?php endif; ?>
               <span class="button"></span>
            </h4>   
            <div class="collapse">
               <div class="collapse-container">
                  <ul>
                     <?php echo 'nb : '.count($this->items) ?>   //debug only            
                     <?php foreach ($this->items $i => $article) : ?>
                        <?php if (in_array($article->access, $this->user->getauthorisedviewlevels())) : ?>   
                              <?php if ($article->catid == $child->id) : ?>
                              <li>
                                 <span class="categorie_title"><?php echo $this->escape($child->title); ?></span><?php echo $this->escape($article->title); ?>
                                 <a  href="<?php echo jroute::_(contenthelperroute::getarticleroute($article->slug, $article->catid)); ?>"></a>                                                                        
                              </li>
                              <?php endif; ?>
                        <?php else : // show unauth links. ?>
                              <?php
                                 echo $this->escape($article->title).' : ';
                                 $menu      = jfactory::getapplication()->getmenu();
                                 $active      = $menu->getactive();
                                 $itemid      = $active->id;
                                 $link = jroute::_('index.php?option=com_users&view=login&itemid='.$itemid);
                                 $returnurl = jroute::_(contenthelperroute::getarticleroute($article->slug));
                                 $fullurl = new juri($link);
                                 $fullurl->setvar('return', base64_encode($returnurl));
                              ?>
                              <li>
                                 <a href="<?php echo $fullurl; ?>" class="register">
                                 <?php echo jtext::_( 'com_content_register_to_read_more' ); ?></a>
                              </li>
                        <?php endif; ?>
                     <?php endforeach; ?>
                  </ul>
               </div>
            </div>
         </li>

      <?php endforeach; ?>
   </ul>
<?php else: ?>
   <ul id="vertical_article">
      <?php foreach ($this->items $i => $article) : ?>                           
            <?php if (in_array($article->access, $this->user->getauthorisedviewlevels())) : ?>   
                  <li>
                     <span class="categorie_title"><?php echo $this->escape($child->title); ?></span><?php echo $this->escape($article->title); ?>
                     <a class="button_o"  href="<?php echo jroute::_(contenthelperroute::getarticleroute($article->slug, $article->catid)); ?>"></a>                                                                        
                  </li>
            <?php else : // show unauth links. ?>
                  <?php
                     echo $this->escape($article->title).' : ';
                     $menu      = jfactory::getapplication()->getmenu();
                     $active      = $menu->getactive();
                     $itemid      = $active->id;
                     $link = jroute::_('index.php?option=com_users&view=login&itemid='.$itemid);
                     $returnurl = jroute::_(contenthelperroute::getarticleroute($article->slug));
                     $fullurl = new juri($link);
                     $fullurl->setvar('return', base64_encode($returnurl));
                  ?>
                  <li>
                     <a href="<?php echo $fullurl; ?>" class="register">
                     <?php echo jtext::_( 'com_content_register_to_read_more' ); ?></a>
                  </li>
            <?php endif; ?>   
      <?php endforeach; ?>
   </ul>
<?php endif; ?>

my problem under windows run not under linux/unix.
i think comes lines :
<?php foreach ($this->items $i => $article) : >
$this->items must return array here nothing..

if enlighten me.
thanks,
hervem

linux server info : php 5.3.10-1~dotdeb.1 /mysql 5.1.61-2~dotdeb.0 / apache / joomla! 2.5.7 stable [ ember ]
fpa don't run.






Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support