Permalink
Browse files

section blog layout with divs added

  • Loading branch information...
1 parent d89ccab commit 98f47ce772ba90fd8c19f77f904e4b8a8210d877 Vito Tafuni committed Nov 23, 2011
Showing with 137 additions and 22 deletions.
  1. +110 −0 html/com_content/section/blog.php
  2. +27 −22 html/com_content/section/blog_item.php
@@ -0,0 +1,110 @@
+<?php // no direct access
+defined('_JEXEC') or die('Restricted access');
+$cparams =& JComponentHelper::getParams('com_media');
+?>
+<div class="inner-text">
+<?php if ($this->params->get('show_page_title', 1)) : ?>
+<div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
+ <?php echo $this->escape($this->params->get('page_title')); ?>
+</div>
+<?php endif; ?>
+<div class="blog<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" cellpadding="0" cellspacing="0">
+<?php if ($this->params->def('show_description', 1) || $this->params->def('show_description_image', 1)) :?>
+<div>
+
+ <?php if ($this->params->get('show_description_image') && $this->category->image) : ?>
+ <img src="<?php echo $this->baseurl . '/' . $cparams->get('image_path') . '/'. $this->category->image;?>" align="<?php echo $this->category->image_position;?>" hspace="6" alt="" />
+ <?php endif; ?>
+ <?php if ($this->params->get('show_description') && $this->category->description) : ?>
+ <?php echo $this->category->description; ?>
+ <?php endif; ?>
+
+</div>
+<?php endif; ?>
+<?php if ($this->params->get('num_leading_articles')) : ?>
+<div class="leading">
+
+ <?php for ($i = $this->pagination->limitstart; $i < ($this->pagination->limitstart + $this->params->get('num_leading_articles')); $i++) : ?>
+ <?php if ($i >= $this->total) : break; endif; ?>
+ <div>
+ <?php
+ $this->item =& $this->getItem($i, $this->params);
+ echo $this->loadTemplate('item');
+ ?>
+ </div>
+ <?php endfor; ?>
+
+</div>
+<?php else : $i = $this->pagination->limitstart; endif; ?>
+<?php
+$startIntroArticles = $this->pagination->limitstart + $this->params->get('num_leading_articles');
+$numIntroArticles = $startIntroArticles + $this->params->get('num_intro_articles');
+if (($numIntroArticles != $startIntroArticles) && ($i < $this->total)) : ?>
+<div class="intro" >
+
+ <?php
+ $divider = '';
+ if ($this->params->def('multi_column_order', 0)) : // order across, like front page
+ for ($z = 0; $z < $this->params->def('num_columns', 2); $z ++) :
+ if ($z > 0) : $divider = " column_separator"; endif; ?>
+ <?php
+ $rows = (int) ($this->params->get('num_intro_articles', 4) / $this->params->get('num_columns'));
+ $cols = ($this->params->get('num_intro_articles', 4) % $this->params->get('num_columns'));
+ ?>
+ <div style="width:<?php echo intval(100 / $this->params->get('num_columns')) ?>%"
+ class="article_column<?php echo $divider ?>">
+ <?php
+ $loop = (($z < $cols)?1:0) + $rows;
+
+ for ($y = 0; $y < $loop; $y ++) :
+ $target = $i + ($y * $this->params->get('num_columns')) + $z;
+ if ($target < $this->total && $target < ($numIntroArticles)) :
+ $this->item =& $this->getItem($target, $this->params);
+ echo $this->loadTemplate('item');
+ endif;
+ endfor;
+ ?></div>
+ <?php endfor;
+ $i = $i + $this->params->get('num_intro_articles') ;
+ else : // otherwise, order down, same as before (default behaviour)
+ for ($z = 0; $z < $this->params->get('num_columns'); $z ++) :
+ if ($z > 0) : $divider = " column_separator"; endif; ?>
+ <div valign="top" width="<?php echo intval(100 / $this->params->get('num_columns')) ?>%" class="article_column<?php echo $divider ?>">
+ <?php for ($y = ($z<($this->total % $this->params->get('num_columns')))? -1:0; $y < intval($this->total / $this->params->get('num_columns')); $y ++) :
+ if ($i < $this->total && $i < ($numIntroArticles)) :
+ $this->item =& $this->getItem($i, $this->params);
+ echo $this->loadTemplate('item');
+ $i ++;
+ endif;
+ endfor;?>
+
+ </div>
+ <?php endfor;
+
+ endif; ?>
+
+</div>
+<?php endif; ?>
+<?php if ($this->params->get('num_links') && ($i < $this->total)) : ?>
+<div >
+ <div class="blog_more<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
+ <?php
+ $this->links = array_splice($this->items, $i - $this->pagination->limitstart);
+ echo $this->loadTemplate('links');
+ ?>
+ </div>
+</div>
+<?php endif; ?>
+<?php if ($this->params->get('show_pagination')) : ?>
+<div class="pagination">
+ <?php echo $this->pagination->getPagesLinks(); ?>
+</div>
+<?php endif; ?>
+<?php if ($this->params->get('show_pagination_results')) : ?>
+<div>
+ <?php echo $this->pagination->getPagesCounter(); ?>
+
+</div>
+<?php endif; ?>
+</div>
+</div>
@@ -6,24 +6,40 @@
<?php echo JHTML::_('icon.edit', $this->item, $this->item->params, $this->access); ?>
</div>
<?php endif; ?>
-<div class="contentpaneopen<?php echo $this->item->params->get( 'pageclass_sfx' ); ?>">
+<div class="article">
<?php if ($this->item->params->get('show_title')) : ?>
-<h2 class="contentheading<?php echo $this->item->params->get( 'pageclass_sfx' ); ?>">
+<h1 class="contentheading<?php echo $this->item->params->get( 'pageclass_sfx' ); ?>">
<?php if ($this->item->params->get('link_titles') && $this->item->readmore_link != '') : ?>
<a href="<?php echo $this->item->readmore_link; ?>" class="contentpagetitle<?php echo $this->item->params->get( 'pageclass_sfx' ); ?>">
<?php echo $this->escape($this->item->title); ?>
</a>
<?php else : ?>
<?php echo $this->escape($this->item->title); ?>
<?php endif; ?>
-</h2>
+</h1>
<?php endif; ?>
<?php if (!$this->item->params->get('show_intro')) :
echo $this->item->event->afterDisplayTitle;
endif; ?>
+<div class="article-content">
+<?php if (isset ($this->item->toc)) : ?>
+ <?php echo $this->item->toc; ?>
+<?php endif; ?>
+<?php echo $this->item->text; ?>
+<?php if ($this->item->params->get('show_readmore') && $this->item->readmore) : ?>
+ <a href="<?php echo $this->item->readmore_link; ?>" title="<?php echo $this->item->title; ?>" class="readon">
+ <?php if ($this->item->readmore_register) : ?>
+ <?php echo JText::_('Register to read more...'); ?>
+ <?php else : ?>
+ <?php echo JText::_($this->item->params->get('readmore','Read more...')); ?>
+ <?php endif; ?>
+ </a>
+<?php endif; ?>
+</div>
+
<?php
if (
($this->item->params->get('show_create_date'))
@@ -38,7 +54,7 @@
<?php if ($this->item->params->get('show_create_date')) : ?>
<span class="createdate">
- <?php echo JHTML::_('date', $this->item->created, JText::_('DATE_FORMAT_LC2')); ?>
+ <?php echo JHTML::_('date', $this->item->created, JText::_('DATE_FORMAT_LC1')); ?>
</span>
<?php endif; ?>
@@ -58,7 +74,7 @@
<?php if ($this->item->params->get('link_section')) : ?>
<?php echo '</a>'; ?>
<?php endif; ?>
- <?php if ($this->item->params->get('show_category')) : ?>
+ <?php if ($this->item->params->get('show_category')) : ?>
<?php echo ' - '; ?>
<?php endif; ?>
</span>
@@ -69,7 +85,7 @@
<?php echo '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug, $this->item->sectionid)).'">'; ?>
<?php endif; ?>
<?php echo $this->item->category; ?>
- <?php if ($this->item->params->get('link_section')) : ?>
+ <?php if ($this->item->params->get('link_category')) : ?>
<?php echo '</a>'; ?>
<?php endif; ?>
</span>
@@ -102,38 +118,27 @@
<?php if ($this->item->params->get('show_url') && $this->item->urls) : ?>
<span class="article-url">
<a href="http://<?php echo $this->item->urls ; ?>" target="_blank">
- <?php echo $this->item->urls; ?></a>
+ <?php echo $this->item->urls; ?>
+ </a>
</span>
<?php endif; ?>
</div>
<?php endif; ?>
<?php echo $this->item->event->beforeDisplayContent; ?>
-<div class="article-content">
-<?php if (isset ($this->item->toc)) : ?>
- <?php echo $this->item->toc; ?>
-<?php endif; ?>
-<?php echo $this->item->text; ?>
-</div>
+
<?php if ( intval($this->item->modified) != 0 && $this->item->params->get('show_modify_date')) : ?>
<span class="modifydate">
<?php echo JText::_( 'Last Updated' ); ?> ( <?php echo JHTML::_('date', $this->item->modified, JText::_('DATE_FORMAT_LC2')); ?> )
</span>
<?php endif; ?>
-<?php if ($this->item->params->get('show_readmore') && $this->item->readmore) : ?>
- <a href="<?php echo $this->item->readmore_link; ?>" title="<?php echo $this->item->title; ?>" class="readon<?php echo $this->item->params->get('pageclass_sfx'); ?>">
- <?php if ($this->item->readmore_register) : ?>
- <?php echo JText::_('Register to read more...'); ?>
- <?php else : ?>
- <?php echo JText::_('Read more...'); ?>
- <?php endif; ?>
- </a>
-<?php endif; ?>
+
</div>
<span class="article_separator">&nbsp;</span>
<?php echo $this->item->event->afterDisplayContent; ?>
+

0 comments on commit 98f47ce

Please sign in to comment.