Joomla! Template Override:

Linecard-Bloglayout


Heute haben wir ein neues Bloglayout für Euch. Entstanden ist die Idee, da damals eine Linecard in dieser Optik gebraucht wurde. Es handelt sich hierbei um ein Override von "com_content", "Category" und hier die Blog-Dateien.

Ihr benötigt den Einleitungstext und dasEinleitungsbild. Die Menüeinstellungen haben wir auf 2 Spalten gesetzt und Führend auf 0. Seitliche Sortierung von A-Z.

Die Boxen haben ein min-height, Ihr solltet also auf die Länge des Textes achten, oder ggf. die min-height-Angabe später korrigieren.

Benötigte Override-Dateien


  • <?php
    /**
     * @package Joomla.Site
     * @subpackage com_content
     *
     * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
     * @license GNU General Public License version 2 or later; see LICENSE.txt
     */
    defined('_JEXEC') or die;
    JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
    JHtml::_('behavior.caption');
    ?>
    <div class="blog<?php echo $this->pageclass_sfx; ?> linecard" itemscope itemtype="http://schema.org/Blog">
     <?php if ($this->params->get('show_page_heading', 1)) : ?>
     <div class="page-header">
     <h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1>
     </div>
     <?php endif; ?>
    
    <?php if ($this->params->get('show_category_title', 1) or $this->params->get('page_subheading')) : ?>
     <h2 class="linecard-item"> <?php echo $this->escape($this->params->get('page_subheading')); ?>
     <?php if ($this->params->get('show_category_title')) : ?>
     <span class="subheading-category"><?php echo $this->category->title; ?></span>
     <?php endif; ?>
     </h2>
     <?php endif; ?>
    
    <?php if ($this->params->get('show_description', 1) || $this->params->def('show_description_image', 1)) : ?>
     <div class="category-desc clearfix">
     <?php if ($this->params->get('show_description_image') && $this->category->getParams()->get('image')) : ?>
     
     <?php endif; ?>
     <?php if ($this->params->get('show_description') && $this->category->description) : ?>
     <?php echo JHtml::_('content.prepare', $this->category->description, '', 'com_content.category'); ?>
     <?php endif; ?>
     </div>
     <?php endif; ?>
    
    <?php if (empty($this->lead_items) && empty($this->link_items) && empty($this->intro_items)) : ?>
     <?php if ($this->params->get('show_no_articles', 1)) : ?>
     <p><?php echo JText::_('COM_CONTENT_NO_ARTICLES'); ?></p>
     <?php endif; ?>
     <?php endif; ?>
    
    <?php $leadingcount = 0; ?>
     <?php if (!empty($this->lead_items)) : ?>
     <div class="items-leading clearfix">
     <?php foreach ($this->lead_items as &$item) : ?>
     <div class="leading-<?php echo $leadingcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>"
     itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting">
     <?php
     $this->item = & $item;
     echo $this->loadTemplate('item');
     ?>
     </div>
     <?php $leadingcount++; ?>
     <?php endforeach; ?>
     </div><!-- end items-leading -->
     <?php endif; ?>
    
    <?php
     $introcount = (count($this->intro_items));
     $counter = 0;
     ?>
    
    <?php if (!empty($this->intro_items)) : ?>
     <?php foreach ($this->intro_items as $key => &$item) : ?>
     <?php $rowcount = ((int) $key % (int) $this->columns) + 1; ?>
     <?php if ($rowcount == 1) : ?>
     <?php $row = $counter / $this->columns; ?>
     <div class="items-row cols-<?php echo (int) $this->columns; ?> <?php echo 'row-' . $row; ?> row-fluid clearfix">
     <?php endif; ?>
     <div class="col-md-<?php echo round((12 / $this->columns)); ?>">
     <div class="item column-<?php echo $rowcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>"
     itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting">
     <?php
     $this->item = & $item;
     echo $this->loadTemplate('item');
     ?>
     </div>
     <!-- end item -->
     <?php $counter++; ?>
     </div><!-- end span -->
     <?php if (($rowcount == $this->columns) or ($counter == $introcount)) : ?>
     </div><!-- end row -->
     <?php endif; ?>
     <?php endforeach; ?>
     <?php endif; ?>
    
    <?php if (!empty($this->link_items)) : ?>
     <div class="items-more">
     <?php echo $this->loadTemplate('links'); ?>
     </div>
     <?php endif; ?>
    
    <?php if (!empty($this->children[$this->category->id]) && $this->maxLevel != 0) : ?>
     <div class="cat-children">
     <?php if ($this->params->get('show_category_heading_title_text', 1) == 1) : ?>
     <h3> <?php echo JTEXT::_('JGLOBAL_SUBCATEGORIES'); ?> </h3>
     <?php endif; ?>
     <?php echo $this->loadTemplate('children'); ?> </div>
     <?php endif; ?>
     <?php if (($this->params->def('show_pagination', 1) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->get('pages.total') > 1)) : ?>
     <div class="pagination">
     <?php if ($this->params->def('show_pagination_results', 1)) : ?>
     <p class="counter pull-right"> <?php echo $this->pagination->getPagesCounter(); ?> </p>
     <?php endif; ?>
     <?php echo $this->pagination->getPagesLinks(); ?> </div>
     <?php endif; ?>
    </div>
  • <?php
    /**
     * @package Joomla.Site
     * @subpackage Layout
     *
     * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
     * @license GNU General Public License version 2 or later; see LICENSE.txt
     */
    defined('_JEXEC') or die;
    // Create a shortcut for params.
    $params = $this->item->params;
    JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
    $canEdit = $this->item->params->get('access-edit');
    ?>
    
    <?php echo JLayoutHelper::render('joomla.content.blog_style_default_item_title', $this->item); ?>
    
    <div class="row hersteller">
     <?php $images = json_decode($this->item->images); ?><img src="/<?php echo htmlspecialchars($images->image_intro); ?>" class="img-responsive" />
    </div>
    
    
    <?php if (!$params->get('show_intro')) : ?>
     <?php echo $this->item->event->afterDisplayTitle; ?>
    <?php endif; ?>
    <?php echo $this->item->event->beforeDisplayContent; ?> <?php echo $this->item->introtext; ?>
    
    <?php
    if ($params->get('show_readmore') && $this->item->readmore) :
     if ($params->get('access-view')) :
     $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid));
     else :
     $menu = JFactory::getApplication()->getMenu();
     $active = $menu->getActive();
     $itemId = $active->id;
     $link1 = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId);
     $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid));
     $link = new JUri($link1);
     $link->setVar('return', base64_encode($returnURL));
     endif;
     ?>
    
    <?php echo JLayoutHelper::render('joomla.content.readmore', array('item' => $this->item, 'params' => $params, 'link' => $link)); ?>
    
    <?php endif; ?>
    
    <?php if ($this->item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate()) || ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != '0000-00-00 00:00:00' )) :
     ?>
    <?php endif; ?>
    
    <?php echo $this->item->event->afterDisplayContent; ?>
  • /* LINECARD */
    .blog.linecard h2 
    {font-size: 1.2em; text-transform: uppercase;}
    
    .blog.linecard h2 a 
    {color: #EE7F00;}
    
    .blog.linecard h2 a:hover, .blog.linecard h2 a:focus 
    {color: #444; text-decoration: none;}
    
    .blog.linecard .item 
    {border-bottom: 1px solid #444; border-right: 1px solid #444; padding: 0 5px 5px 0; min-height: 270px; margin-top: 40px;}
    
    .blog.linecard .item:hover 
    {border-color: #EE7F00;}
    
    .blog.linecard .items-leading.clearfix 
    {border-bottom: 4px solid #EE7F00;}
    
    .blog.linecard .items-leading.clearfix p.readmore 
    {margin-bottom: 25px;}
    
    .row.hersteller 
    {padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto; margin-top: 15px; margin-bottom: 15px;}
    





Fehler melden

Bitte beachte unsere Datenschutzerklärung

Alle mit (*) markierten Felder werden benötigt um eine E-Mail zu senden.

E-Mail für Kontakt
Nachricht hier eingeben.
Dieses Feld wird benötigt.