If clause for empty modules in 2.5 - Joomla! Forum - community, help and support
hi guys,
i creating template , when tested it, modules newsflash without content showed outer div due piece of code can found in module template (tmpl/default.php)
in case caused green stripe. added simple if clause first check if there anything, before attempting output anything.
i love see added joomla core, because fixing on each installation pain, not mention modifying core can't right if think it.
love hear thoughts.
i creating template , when tested it, modules newsflash without content showed outer div due piece of code can found in module template (tmpl/default.php)
code: select all
<div class="newsflash<?php echo $moduleclass_sfx; ?>">
<?php foreach ($list $item) :?>
<?php
require jmodulehelper::getlayoutpath('mod_articles_news', '_item');?>
<?php endforeach; ?>
</div>in case caused green stripe. added simple if clause first check if there anything, before attempting output anything.
code: select all
<?php
/**
* @package joomla.site
* @subpackage mod_articles_news
* @copyright copyright (c) 2005 - 2012 open source matters, inc. rights reserved.
* @license gnu general public license version 2 or later; see license.txt
*/
/**
* @modified fizzkid 12-12-2012
*/
// no direct access
defined('_jexec') or die;
?>
<?php if(!empty($list)){ /* added */ ?>
<div class="newsflash<?php echo $moduleclass_sfx; ?>">
<?php foreach ($list $item) :?>
<?php
require jmodulehelper::getlayoutpath('mod_articles_news', '_item');?>
<?php endforeach; ?>
</div>
<?php } /* added */?>
i love see added joomla core, because fixing on each installation pain, not mention modifying core can't right if think it.
love hear thoughts.
i surprised see if condition not there in news flash module. ways dont have go in code hide green line can using css.
Comments
Post a Comment