On a Joomla 3.4 site, articles display a "details" section like this by default :
Details
Written by John Doe
Published: 26 October 2015
What file to change, (and if possible how) to get the following result ?
By John Doe, on November 4, 2015
Edit after #itoctopus answer :
you will need to change the override file. You can do that by changing the
file /templates/your-template/html/com_content/article/default.php
Below is the content of the default.php.
What should be changed to achieve the result above ? I see nothing in this file related to the "details" section.
<?php
/**
* #package Joomla.Site
* #subpackage com_content
*
* #copyright Copyright (C) 2005 - 2015 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');
// Create shortcuts to some parameters.
$params = $this->item->params;
$images = json_decode($this->item->images);
$urls = json_decode($this->item->urls);
$canEdit = $params->get('access-edit');
$user = JFactory::getUser();
$info = $params->get('info_block_position', 0);
JHtml::_('behavior.caption');
?>
<div class="item-page<?php echo $this->pageclass_sfx; ?>" itemscope itemtype="http://schema.org/Article">
<meta itemprop="inLanguage" content="<?php echo ($this->item->language === '*') ? JFactory::getConfig()->get('language') : $this->item->language; ?>" />
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1>
</div>
<?php endif;
if (!empty($this->item->pagination) && $this->item->pagination && !$this->item->paginationposition && $this->item->paginationrelative)
{
echo $this->item->pagination;
}
?>
<?php // Todo Not that elegant would be nice to group the params ?>
<?php $useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_create_date')
|| $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category') || $params->get('show_author') ); ?>
<?php if (!$useDefList && $this->print) : ?>
<div id="pop-print" class="btn hidden-print">
<?php echo JHtml::_('icon.print_screen', $this->item, $params); ?>
</div>
<div class="clearfix"> </div>
<?php endif; ?>
<?php if ($params->get('show_title') || $params->get('show_author')) : ?>
<div class="page-header">
<h2 itemprop="name">
<?php if ($params->get('show_title')) : ?>
<?php echo $this->escape($this->item->title); ?>
<?php endif; ?>
</h2>
<?php if ($this->item->state == 0) : ?>
<span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
<?php endif; ?>
<?php if (strtotime($this->item->publish_up) > strtotime(JFactory::getDate())) : ?>
<span class="label label-warning"><?php echo JText::_('JNOTPUBLISHEDYET'); ?></span>
<?php endif; ?>
<?php if ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate()) : ?>
<span class="label label-warning"><?php echo JText::_('JEXPIRED'); ?></span>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if (!$this->print) : ?>
<?php if ($canEdit || $params->get('show_print_icon') || $params->get('show_email_icon')) : ?>
<?php echo JLayoutHelper::render('joomla.content.icons', array('params' => $params, 'item' => $this->item, 'print' => false)); ?>
<?php endif; ?>
<?php else : ?>
<?php if ($useDefList) : ?>
<div id="pop-print" class="btn hidden-print">
<?php echo JHtml::_('icon.print_screen', $this->item, $params); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($useDefList && ($info == 0 || $info == 2)) : ?>
<?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'above')); ?>
<?php endif; ?>
<?php if ($info == 0 && $params->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
<?php endif; ?>
<?php if (!$params->get('show_intro')) : echo $this->item->event->afterDisplayTitle; endif; ?>
<?php echo $this->item->event->beforeDisplayContent; ?>
<?php if (isset($urls) && ((!empty($urls->urls_position) && ($urls->urls_position == '0')) || ($params->get('urls_position') == '0' && empty($urls->urls_position)))
|| (empty($urls->urls_position) && (!$params->get('urls_position')))) : ?>
<?php echo $this->loadTemplate('links'); ?>
<?php endif; ?>
<?php if ($params->get('access-view')):?>
<?php if (isset($images->image_fulltext) && !empty($images->image_fulltext)) : ?>
<?php $imgfloat = (empty($images->float_fulltext)) ? $params->get('float_fulltext') : $images->float_fulltext; ?>
<div class="pull-<?php echo htmlspecialchars($imgfloat); ?> item-image"> <img
<?php if ($images->image_fulltext_caption):
echo 'class="caption"' . ' title="' . htmlspecialchars($images->image_fulltext_caption) . '"';
endif; ?>
src="<?php echo htmlspecialchars($images->image_fulltext); ?>" alt="<?php echo htmlspecialchars($images->image_fulltext_alt); ?>" itemprop="image"/> </div>
<?php endif; ?>
<?php
if (!empty($this->item->pagination) && $this->item->pagination && !$this->item->paginationposition && !$this->item->paginationrelative):
echo $this->item->pagination;
endif;
?>
<?php if (isset ($this->item->toc)) :
echo $this->item->toc;
endif; ?>
<div itemprop="articleBody">
<?php echo $this->item->text; ?>
</div>
<?php if ($useDefList && ($info == 1 || $info == 2)) : ?>
<?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'below')); ?>
<?php if ($params->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
<?php endif; ?>
<?php endif; ?>
<?php
if (!empty($this->item->pagination) && $this->item->pagination && $this->item->paginationposition && !$this->item->paginationrelative):
echo $this->item->pagination;
?>
<?php endif; ?>
<?php if (isset($urls) && ((!empty($urls->urls_position) && ($urls->urls_position == '1')) || ($params->get('urls_position') == '1'))) : ?>
<?php echo $this->loadTemplate('links'); ?>
<?php endif; ?>
<?php // Optional teaser intro text for guests ?>
<?php elseif ($params->get('show_noauth') == true && $user->get('guest')) : ?>
<?php echo $this->item->introtext; ?>
<?php // Optional link to let them register to see the whole article. ?>
<?php if ($params->get('show_readmore') && $this->item->fulltext != null) : ?>
<?php $menu = JFactory::getApplication()->getMenu(); ?>
<?php $active = $menu->getActive(); ?>
<?php $itemId = $active->id; ?>
<?php $link = new JUri(JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false)); ?>
<?php $link->setVar('return', base64_encode(JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language), false))); ?>
<p class="readmore">
<a href="<?php echo $link; ?>" class="register">
<?php $attribs = json_decode($this->item->attribs); ?>
<?php
if ($attribs->alternative_readmore == null) :
echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
elseif ($readmore = $this->item->alternative_readmore) :
echo $readmore;
if ($params->get('show_readmore_title', 0) != 0) :
echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
endif;
elseif ($params->get('show_readmore_title', 0) == 0) :
echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
else :
echo JText::_('COM_CONTENT_READ_MORE');
echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
endif; ?>
</a>
</p>
<?php endif; ?>
<?php endif; ?>
<?php
if (!empty($this->item->pagination) && $this->item->pagination && $this->item->paginationposition && $this->item->paginationrelative) :
echo $this->item->pagination;
?>
<?php endif; ?>
<?php echo $this->item->event->afterDisplayContent; ?>
</div>
You can do the above by CSS - but sometimes it's a bit tricky, so you will need to change the override file. You can do that by changing the file /templates/your-template/html/com_content/article/default.php
If you can't find that file (or that directory structure), then you will need to copy the this file components/com_content/views/article/tmpl/default.php to /templates/your-template/html/com_content/article/default.php (if there is a directory that doesn't exist then you will need to create it. for example, if you can only find the /templates/your-template/html under your templates folder the you will need to create the com_content folder under the html folder and then the article folder under the com_content folder).
You can then modify the default.php file to change the layout. Make sure you clear your Joomla cache to see your changes.
Using CSS and Language overrides worked out.
CSS : display:none to get rid of unwanted stuff and display:inline-block to put everything in a single line.
Changing Words in Joomla 3.4 backend :
from the control panel, click on Languages in the sidebar menu
Click 'overrides'
Choose the language in 'filter'
Click 'new'
in the form field next to 'search' button, type in the text you want to change
select the right string variable
Type in the wanted text
Save
done.
Related
Hi my site wordpress if there is No attribute entered " call_user_func() expects parameter 1 to be a valid callback " issue show in product page But if i chose attributes it is working fine , my code is :
<?php
if (!empty($tabs)) :
$k_tab = $comboContent ? 1 : 0;
foreach ($tabs as $key => $tab) :
?>
<div class="nasa-panel entry-content<?php echo ($k_tab == 0) ? ' active' : ''; ?>" id="nasa-tab-<?php echo esc_attr($key); ?>">
<?php if ($key == 'description' && $specifi_desc): ?>
<div class="nasa-panel-block">
<?php call_user_func($tab['callback'], $key, $tab); ?>
</div>
<?php if (trim($specifications) != '') : ?>
<div class="nasa-panel-block nasa-content-specifications">
<?php echo $specifications; ?>
</div>
<?php endif; ?>
<?php
else:
call_user_func($tab['callback'], $key, $tab);
endif;
?>
</div>
<?php
if ($key == 'description' && (trim($specifications) != '') && !$specifi_desc) : ?>
<div class="nasa-panel entry-content nasa-content-specifications" id="nasa-tab-specifications">
<p><?php echo $specifications; ?></p>
</div>
<?php
endif;
$k_tab++;
endforeach;
endif;
could please help me
I have a Jomi installation and I see that social icons are inserted at the bottom of my article while I would display them after the head section. What should I look for to modify this since the template settings just allow me to turn on/off the social bar? Should I look inside layouts or styles folder?
On feeling I looked into layouts/com_content/article and there is a default.php that looks something like a template for my articles, but I cannot find anything about social bar, here is its content:
<?php
/**
* #package Warp Theme Framework
* #author YOOtheme http://www.yootheme.com
* #copyright Copyright (C) YOOtheme GmbH
* #license http://www.gnu.org/licenses/gpl.html GNU/GPL
*/
// no direct access
defined('_JEXEC') or die;
// get view
$menu = JSite::getMenu()->getActive();
$view = is_object($menu) && isset($menu->query['view']) ? $menu->query['view'] : null;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
// Create shortcuts to some parameters.
$params = $this->item->params;
$images = json_decode($this->item->images);
$urls = json_decode($this->item->urls);
$canEdit = $this->item->params->get('access-edit');
$user = JFactory::getUser();
?>
<div id="system">
<?php if ($this->params->get('show_page_heading', 1)) : ?>
<h1 class="title"><?php echo $this->escape($this->params->get('page_heading')); ?></h1>
<?php endif; ?>
<article class="item"<?php if ($view != 'article') printf(' data-permalink="%s"', JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catslug), true, -1)); ?>>
<?php if ($params->get('show_title')) : ?>
<header>
<?php if (!$this->print) : ?>
<?php if ($params->get('show_email_icon')) : ?>
<div class="icon email"><?php echo JHtml::_('icon.email', $this->item, $params); ?></div>
<?php endif; ?>
<?php if ($params->get('show_print_icon')) : ?>
<div class="icon print"><?php echo JHtml::_('icon.print_popup', $this->item, $params); ?></div>
<?php endif; ?>
<?php else : ?>
<div class="icon printscreen"><?php echo JHtml::_('icon.print_screen', $this->item, $params); ?></div>
<?php endif; ?>
<?php if ($params->get('show_create_date')) : ?>
<header class="clearfix">
<time datetime="<?php echo substr($this->item->created, 0,10); ?>" pubdate>
<span class="day"><?php echo JHTML::_('date',$this->item->created, JText::_('d')); ?></span>
<span class="month"><?php echo JHTML::_('date',$this->item->created, JText::_('M')); ?></span>
<span class="year"><?php echo JHTML::_('date',$this->item->created, JText::_('Y')); ?></span>
</time>
<?php endif; ?>
<h1 class="title"><?php echo $this->escape($this->item->title); ?></h1>
<?php if (($params->get('show_author') && !empty($this->item->author)) || $params->get('show_category')) : ?>
<p class="meta">
<?php
if ($params->get('show_author') && !empty($this->item->author )) {
$author = $this->item->created_by_alias ? $this->item->created_by_alias : $this->item->author;
if (!empty($this->item->contactid) && $params->get('link_author') == true) {
$needle = 'index.php?option=com_contact&view=contact&id=' . $this->item->contactid;
$menu = JFactory::getApplication()->getMenu();
$item = $menu->getItems('link', $needle, true);
$cntlink = !empty($item) ? $needle . '&Itemid=' . $item->id : $needle;
echo JText::sprintf('<i class="icon-user"></i>');
echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', JRoute::_($cntlink), $author));
} else {
echo JText::sprintf('<i class="icon-user"></i>');
echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author);
}
}
if ($params->get('show_author') && !empty($this->item->author )) {
echo '. ';
}
if ($params->get('show_category')) {
echo JText::_('<i class="icon-folder-open-alt"></i>').' ';
echo JText::_('TPL_WARP_POSTED_IN').' ';
$title = $this->escape($this->item->category_title);
$url = ''.$title.'';
if ($params->get('link_category') AND $this->item->catslug) {
echo $url;
} else {
echo $title;
}
}
?>
</p>
<?php endif; ?>
</header>
<?php endif; ?>
<?php
if (!$params->get('show_intro')) {
echo $this->item->event->afterDisplayTitle;
}
echo $this->item->event->beforeDisplayContent;
if (isset ($this->item->toc)) {
echo $this->item->toc;
}
?>
<div class="content clearfix">
<?php
if ($params->get('access-view')) {
if (isset($urls) AND ((!empty($urls->urls_position) AND ($urls->urls_position=='0')) OR ($params->get('urls_position')=='0' AND empty($urls->urls_position) ))
OR (empty($urls->urls_position) AND (!$params->get('urls_position')))) {
echo $this->loadTemplate('links');
}
if (isset($images->image_fulltext) and !empty($images->image_fulltext)) {
$imgfloat = (empty($images->float_fulltext)) ? $params->get('float_fulltext') : $images->float_fulltext;
$class = (htmlspecialchars($imgfloat) != 'none') ? ' class="size-auto align-'.htmlspecialchars($imgfloat).'"' : ' class="size-auto"';
$title = ($images->image_fulltext_caption) ? ' title="'.htmlspecialchars($images->image_fulltext_caption).'"' : '';
echo '<img'.$class.$title.' src="'.htmlspecialchars($images->image_fulltext).'" alt="'.htmlspecialchars($images->image_fulltext_alt).'" />';
}
echo $this->item->text;
if (isset($urls) AND ((!empty($urls->urls_position) AND ($urls->urls_position=='1')) OR ( $params->get('urls_position')=='1') )) {
echo $this->loadTemplate('links');
}
// optional teaser intro text for guests
} elseif ($params->get('show_noauth') == true AND $user->get('guest')) {
echo $this->item->introtext;
// optional link to let them register to see the whole article.
if ($params->get('show_readmore') && $this->item->fulltext != null) {
$link1 = JRoute::_('index.php?option=com_users&view=login');
$link = new JURI($link1);
echo '<p class="links">';
echo '<a href="'.$link.'">';
$attribs = json_decode($this->item->attribs);
if ($attribs->alternative_readmore == null) {
echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
} elseif ($readmore = $this->item->alternative_readmore) {
echo $readmore;
if ($params->get('show_readmore_title', 0) != 0) {
echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
}
} elseif ($params->get('show_readmore_title', 0) == 0) {
echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
} else {
echo JText::_('COM_CONTENT_READ_MORE');
echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
}
echo '</a></p>';
}
}
?>
</div>
<?php if ($canEdit) : ?>
<p class="edit"><?php echo JHtml::_('icon.edit', $this->item, $params); ?> <?php echo JText::_('TPL_WARP_EDIT_ARTICLE'); ?></p>
<?php endif; ?>
<?php echo $this->item->event->afterDisplayContent; ?>
</article>
</div>
The only point that could reasonable be the social bar is this line:
<?php echo $this->item->event->afterDisplayContent; ?>
However it looks like a ore wider concept, since afterDisplayContent probably handles many things, and here is where I stop, I have no idea where to look for afterDisplayContent event definition, I guess that I should find an entry for social bar and copy/paste in the position that I want in my module.
How To Show "Shop By" left sidebar attribute list in "Dropdown" like as "Sort By" Toolbar?
I want to show attribute list same as "Sort By" Toolbar as Dropdown list.
my toolbar.phtml code is
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license#magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* #category design
* #package base_default
* #copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
* #license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
<?php
/**
* Product list toolbar
*
* #see Mage_Catalog_Block_Product_List_Toolbar
*/
?>
<?php
/**
* - Pager moved after sorter. Show pager only if there are pages.
* - Amount and limiter moved inside sorter
* - Changed order of the main elements
*/
?>
<?php if($this->getCollection()->getSize()): ?>
<div class="toolbar">
<?php if( $this->isExpanded() ): ?>
<div class="sorter">
<p class="amount">
<?php if($this->getLastPageNum()>1): ?>
<?php echo $this->__('Items %s to %s of %s total', $this->getFirstNum(), $this->getLastNum(), $this->getTotalNum()) ?>
<?php else: ?>
<strong><?php echo $this->__('%s Item(s)', $this->getTotalNum()) ?></strong>
<?php endif; ?>
</p>
<div class="sort-by">
<label><?php echo $this->__('Sort By') ?></label>
<select onchange="setLocation(this.value)">
<?php foreach($this->getAvailableOrders() as $_key=>$_order): ?>
<option value="<?php echo $this->getOrderUrl($_key, 'asc') ?>"<?php if($this->isOrderCurrent($_key)): ?> selected="selected"<?php endif; ?>>
<?php echo $this->__($_order) ?>
</option>
<?php endforeach; ?>
</select>
<?php if($this->getCurrentDirection() == 'desc'): ?>
<a class="category-desc ic ic-arrow-up" href="<?php echo $this->getOrderUrl(null, 'asc') ?>" title="<?php echo $this->__('Set Ascending Direction') ?>"></a>
<?php else: ?>
<a class="category-asc ic ic-arrow-down" href="<?php echo $this->getOrderUrl(null, 'desc') ?>" title="<?php echo $this->__('Set Descending Direction') ?>"></a>
<?php endif; ?>
</div>
<div class="sort-by">
<label><?php echo $this->__('Sort By') ?></label>
<select onchange="setLocation(this.value)">
<?php foreach($this->getAvailableOrders() as $_key=>$_order): ?>
<option value="<?php echo $this->getOrderUrl($_key, 'asc') ?>"<?php if($this->isOrderCurrent($_key)): ?> selected="selected"<?php endif; ?>>
<?php echo $this->__($_order) ?>
</option>
<?php endforeach; ?>
</select>
<?php if($this->getCurrentDirection() == 'desc'): ?>
<a class="category-desc ic ic-arrow-up" href="<?php echo $this->getOrderUrl(null, 'asc') ?>" title="<?php echo $this->__('Set Ascending Direction') ?>"></a>
<?php else: ?>
<a class="category-asc ic ic-arrow-down" href="<?php echo $this->getOrderUrl(null, 'desc') ?>" title="<?php echo $this->__('Set Descending Direction') ?>"></a>
<?php endif; ?>
</div>
<div class="limiter">
<label><?php echo $this->__('Show') ?></label>
<select onchange="setLocation(this.value)">
<?php foreach ($this->getAvailableLimit() as $_key=>$_limit): ?>
<option value="<?php echo $this->getLimitUrl($_key) ?>"<?php if($this->isLimitCurrent($_key)): ?> selected="selected"<?php endif ?>>
<?php echo $_limit ?>
</option>
<?php endforeach; ?>
</select><span class="per-page"> <?php echo $this->__('per page'); ?></span>
</div>
<?php if( $this->isEnabledViewSwitcher() ): ?>
<p class="view-mode">
<?php $_modes = $this->getModes(); ?>
<?php if($_modes && count($_modes)>1): ?>
<label><?php echo $this->__('View as') ?>:</label>
<?php //Removed spaces from the foreach loop to improve layout of the buttons ?>
<?php foreach ($this->getModes() as $_code=>$_label): ?><?php $codeToLower = strtolower($_code); if($this->isModeActive($_code)): ?><span title="<?php echo $_label ?>" class="<?php echo $codeToLower; ?> ic ic-<?php echo $codeToLower; ?>"></span><?php else: ?><?php endif; ?><?php endforeach; ?>
<?php endif; ?>
</p>
<?php endif; ?>
</div> <!-- end: sorter -->
<?php endif; ?>
<?php //Show pager only if there are pages ?>
<?php if ($pagerHtml = trim($this->getPagerHtml())): ?>
<div class="pager">
<?php echo $pagerHtml; ?>
</div>
<?php endif; ?>
</div>
<?php endif ?>
list.phtml code is
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license#magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* #category design
* #package base_default
* #copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
* #license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
<?php
/**
* Product list template
*
* #see Mage_Catalog_Block_Product_List
*/
?>
<?php
$_productCollection=$this->getLoadedProductCollection();
$_collectionSize = $_productCollection->count();
?>
<?php if ($_collectionSize && $tmpHtml = $this->getChildHtml('block_category_above_collection')): ?>
<div class="block_category_above_collection std"><?php echo $tmpHtml; ?></div>
<?php endif; ?>
<?php if(!$_collectionSize): ?>
<?php if ($tmpHtml = $this->getChildHtml('block_category_above_empty_collection')): ?>
<div class="block_category_above_empty_collection std"><?php echo $tmpHtml; ?></div>
<?php else: ?>
<p class="note-msg empty-catalog"><?php echo $this->__('There are no products matching the selection.') ?></p>
<?php endif; ?>
<?php else: ?>
<?php
$_helper = $this->helper('catalog/output');
$theme = $this->helper('ultimo');
$helpLabels = $this->helper('ultimo/labels');
$helpTemplate = $this->helper('ultimo/template');
$helpImg = $this->helper('infortis/image');
//Default image size
$imgWidth = 295;
$imgHeight = 295;
//Aspect ratio settings
if ($theme->getCfg('category/aspect_ratio'))
$imgHeight = 0; //Height will be computed automatically (based on width) to keep the aspect ratio
//Hide toolbar
$hideToolbar = false;
if ($this->getHideToolbar())
{
$hideToolbar = true;
}
?>
<div class="category-products">
<?php if (!$hideToolbar): ?>
<?php echo $this->getToolbarHtml() ?>
<?php endif; ?>
<?php if($this->getMode()!='grid'): //List mode ?>
<?php
//Get list configuration array
$lc = $theme->getCfgGroup('category_list');
//List classes
$listClasses = '';
if ($lc['hover_effect'])
$listClasses = ' hover-effect';
?>
<?php $_iterator = 0; ?>
<ul class="products-list<?php if($listClasses) echo $listClasses; ?>" id="products-list">
<?php foreach ($_productCollection as $_product): ?>
<li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
<?php //Product Image ?>
<div class="product-image-wrapper grid12-4 mobile-grid-half">
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image" style="max-width:<?php echo $imgWidth; ?>px;">
<img src="<?php echo $helpImg->getImg($_product, $imgWidth, $imgHeight, 'small_image'); ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
<?php if ($theme->getCfg('category/alt_image')): ?>
<?php echo $theme->getAltImgHtml($_product, $imgWidth, $imgHeight); ?>
<?php endif; ?>
<?php echo $helpLabels->getLabels($_product); //Product labels ?>
</a>
</div> <!-- end: product-image-wrapper -->
<?php //Product description ?>
<div class="product-shop grid12-5 mobile-grid-half">
<div class="product-shop-inner">
<?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
<h2 class="product-name"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></h2>
<?php if($_product->getRatingSummary()): ?>
<?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
<?php endif; ?>
<div class="desc std">
<?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
<?php echo $this->__('Learn More') ?>
</div>
</div>
</div>
<div class="right-column grid12-3 mobile-grid-half">
<?php echo $this->getPriceHtml($_product, true) ?>
<?php if($_product->isSaleable()): ?>
<p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
<?php else: ?>
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
<?php endif; ?>
<?php
if ($lc['addtolinks_simple'])
echo $helpTemplate->getCategoryAddtoLinks($_product, $this->getAddToCompareUrl($_product), 'addto-gaps-right');
else
echo $helpTemplate->getCategoryAddtoLinksComplex($_product, $this->getAddToCompareUrl($_product), 'addto-gaps-right');
?>
</div>
</li>
<?php endforeach; ?>
</ul>
<script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
<?php else: //Grid mode ?>
<?php
//Get grid configuration array
$gc = $theme->getCfgGroup('category_grid');
//Get number of columns (from parameter or from theme config)
$columnCount = 3;
if ($this->getGridColumnCount())
{
$columnCount = $this->getGridColumnCount();
}
else
{
$columnCount = $gc['column_count'];
}
//Grid classes
$gridClasses = '';
$productNameClasses = '';
if ($gc['display_name'] == 2 && $gc['display_name_single_line'] == true)
$gridClasses .= ' single-line-name';
if ($gc['display_name'] == 1)
$productNameClasses .= ' display-onhover';
if ($gc['centered'])
$gridClasses .= ' centered';
if ($gc['hover_effect'])
$gridClasses .= ' hover-effect';
if ($gc['equal_height'])
$gridClasses .= ' equal-height';
//Size of grid elements
if ($gc['elements_size'])
{
$gridClasses .= ' size-' . $gc['elements_size'];
}
else
{
//Calculate size based on number of columns
if ($columnCount >= 6)
{
$gridClasses .= ' size-xs';
}
elseif ($columnCount >= 4)
{
$gridClasses .= ' size-s';
}
}
//Container "actions" at the bottom of the grid item stores button and add-to links
//If at least one of those elements was set as "Display on hover" but no element was set as "Display":
//apply appropriate classes to the container.
$actionsClasses = '';
if ($gc['display_addtocart'] == 1 || ($gc['display_addtolinks'] == 1 && !$gc['addtolinks_simple']))
{
$actionsClasses = ' display-onhover';
}
if ($gc['display_addtocart'] == 2 || ($gc['display_addtolinks'] == 2 && !$gc['addtolinks_simple']))
{
$actionsClasses = '';
}
?>
<ul class="products-grid category-products-grid itemgrid itemgrid-adaptive itemgrid-<?php echo $columnCount; ?>col<?php if($gridClasses) echo $gridClasses; ?>">
<?php foreach ($_productCollection as $_product): ?>
<li class="item">
<div class="product-image-wrapper" style="max-width:<?php echo $imgWidth; ?>px;">
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true); ?>" class="product-image">
<img src="<?php echo $helpImg->getImg($_product, $imgWidth, $imgHeight, 'small_image'); ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true); ?>" />
<?php if ($theme->getCfg('category/alt_image')): ?>
<?php echo $theme->getAltImgHtml($_product, $imgWidth, $imgHeight); ?>
<?php endif; ?>
<?php echo $helpLabels->getLabels($_product); //Product labels ?>
</a>
<?php //Add-to links
if ($gc['display_addtolinks'] != 0 && $gc['addtolinks_simple'])
{
if ($gc['display_addtolinks'] == 1) //Display on hover
echo $helpTemplate->getCategoryAddtoLinksIcons($_product, $this->getAddToCompareUrl($_product), 'addto-links-icons addto-onimage display-onhover');
else //Always display
echo $helpTemplate->getCategoryAddtoLinksIcons($_product, $this->getAddToCompareUrl($_product), 'addto-links-icons addto-onimage');
}
?>
</div> <!-- end: product-image-wrapper -->
<?php if ($gc['display_name'] != 0): ?>
<h2 class="product-name<?php echo $productNameClasses; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h2>
<?php endif; ?>
<?php if ($_product->getRatingSummary()): ?>
<?php if ($gc['display_rating'] == 1): //Display on hover ?>
<div class="display-onhover ratings-wrapper"><?php echo $this->getReviewsSummaryHtml($_product, 'short') ?></div>
<?php elseif ($gc['display_rating'] == 2): //Always display ?>
<?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
<?php endif; ?>
<?php endif; ?>
<?php if ($gc['display_price'] == 1): //Display on hover ?>
<div class="display-onhover"><?php echo $this->getPriceHtml($_product, true); ?></div>
<?php elseif ($gc['display_price'] == 2): //Always display ?>
<?php echo $this->getPriceHtml($_product, true); ?>
<?php endif; ?>
<?php
//If at least one element was set as "Display on hover" but no element was set as "Display":
//aggregate classes from those elements and apply them to the "actions" container.
$actionsClasses = '';
if ($gc['display_addtocart'] == 1 || ($gc['display_addtolinks'] == 1 && !$gc['addtolinks_simple']))
{
$actionsClasses = ' display-onhover';
}
if ($gc['display_addtocart'] == 2 || ($gc['display_addtolinks'] == 2 && !$gc['addtolinks_simple']))
{
$actionsClasses = '';
}
?>
<div class="actions clearer<?php echo $actionsClasses; ?>">
<?php //Cart button ?>
<?php if ($gc['display_addtocart'] != 0): ?>
<?php if ($_product->isSaleable()): ?>
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
<?php else: ?>
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
<?php endif; ?>
<?php endif; ?>
<?php //Add-to links
if ($gc['display_addtolinks'] != 0 && !$gc['addtolinks_simple'])
{
echo $helpTemplate->getCategoryAddtoLinks($_product, $this->getAddToCompareUrl($_product), 'addto-gaps-right');
}
?>
</div> <!-- end: actions -->
</li>
<?php endforeach; ?>
</ul>
<?php endif; //end: if grid mode ?>
<?php if (!$hideToolbar): ?>
<div class="toolbar-bottom">
<?php echo $this->getToolbarHtml() ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($_collectionSize && $tmpHtml = $this->getChildHtml('block_category_below_collection')): ?>
<div class="block_category_below_collection std"><?php echo $tmpHtml; ?></div>
<?php endif; ?>
I would like to add the article tags in my blog layout in joomla 3.x.
I overwrote the joomla layout files and tried to add the code below in blog_style_default_item_title.php as it is in article
<?php if ($params->get('show_tags', 1) && !empty($this->item->tags)) : ?>
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
<?php endif; ?>
but it did not work. I guess variable name is not the good one. Any ideas?
My knowledges in php language are pretty weak but I had a look and tried a few think.
I finaly got something by adding code below in /com_content/category/blog_items.php
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
but i would like to add "tags" on the title line so in blog_style_default_item_title.phpfile
<?php
defined('_JEXEC') or die;
// Create a shortcut for params.
$params = $displayData->params;
$canEdit = $displayData->params->get('access-edit');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.framework');
?>
<?php if ($params->get('show_title') || $displayData->state == 0 || ($params->get('show_author') && !empty($displayData->author ))) : ?>
<div class="page-header">
<?php if ($params->get('show_title')) : ?>
<h2>essai
<?php if ($params->get('link_titles') && $params->get('access-view')) : ?>
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($displayData->slug, $displayData->catid)); ?>">
<?php echo $this->escape($displayData->title); ?></a>
<?php else : ?>
<?php echo $this->escape($displayData->title); ?>
<?php endif; ?>
</h2>
<?php endif; ?>
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
<?php if ($displayData->state == 0) : ?>
<span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
<?php endif; ?>
</div>
<?php endif; ?>
But i have a error???
Here is how they are added to individual weblinks
<?php $tagsData = $item->tags->getItemTags('com_weblinks.weblink', $item->id); ?>
<?php if ($this->params->get('show_tags', 1)) : ?>
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render($tagsData); ?>
<?php endif; ?>
What you would want to do is something similar but for com_content.article and make sure the $item and $this->params references match what you have.
Here a picture of the design I would like
And he below the way the page id made of (as i understood it)
in blog_item.php there is this line which call the
...
<?php echo JLayoutHelper::render('joomla.content.blog_style_default_item_title', $this->item); ?>
....
and so in blog_style_default_item_title.php
....
<div class="page-header">
<?php if ($params->get('show_title')) : ?>
<h2>essai
<?php if ($params->get('link_titles') && $params->get('access-view')) : ?>
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($displayData->slug, $displayData->catid)); ?>">
<?php echo $this->escape($displayData->title); ?></a>
<?php else : ?>
Did I make a mistake??
i installed SJ Financial Template joomla on my website caindiagroup.com,
but when i open article blog on my website, it show an error on sj_financial/html/com_content/category/blog_item.php file..
Fatal error: Class 'JLayoutHelper' not found in /home/caind126/public_html/templates/sj_financial/html/com_content/category/blog_item.php on line 25
Fatal error: Class 'JLayoutHelper' not found in /home/caind126/public_html/templates/sj_financial/html/com_content/category/blog_item.php on line 27
Fatal error: Class 'JLayoutFile' not found in /home/caind126/public_html/templates/sj_financial/html/com_content/category/blog_item.php on line 103
Fatal error: Call to a member function render() on a non-object in /home/caind126/public_html/templates/sj_financial/html/com_content/category/blog_item.php on line 104
My file Code is
`<?php
/**
* #package Joomla.Site
* #subpackage Layout
*
* #copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* #license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;?>
<?php
// Create a shortcut for params.
$params = $this->item->params;
$images = json_decode($this->item->images);
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
$canEdit = $this->item->params->get('access-edit');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.framework');
?>
<?php if ($this->item->state == 0) : ?>
<span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
<?php //intro images ?>
<?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?>
<div class="article-text">
<?php echo JLayoutHelper::render('joomla.content.blog_style_default_item_title, $this->item'); ?>
<?php if (!$params->get('show_intro')) : ?>
<?php echo $this->item->event->afterDisplayTitle; ?>
<?php endif; ?>
<?php echo $this->item->event->beforeDisplayContent; ?>
<?php if ($params->get('show_intro')) : ?>
<?php echo $this->item->introtext; ?>
<?php endif; ?>
<div class="item-headinfo">
<?php if (!$params->get('show_intro')) : ?>
<?php echo $this->item->event->afterDisplayTitle; ?>
<?php endif; ?>
<?php echo $this->item->event->beforeDisplayContent; ?>
<?php // to do not that elegant would be nice to group the params ?>
<?php if (($params->get('show_author')) or ($params->get('show_category')) or ($params->get('show_create_date')) or ($params->get('show_modify_date')) or ($params->get('show_publish_date')) or ($params->get('show_parent_category')) or ($params->get('show_hits'))) : ?>
<dl class="article-info muted">
<!--<dt class="article-info-term"><?php //echo JText::_('COM_CONTENT_ARTICLE_INFO'); ?></dt>-->
<?php endif; ?>
<?php if ($params->get('show_parent_category')) : ?>
<dd class="parent-category-name">
<?php $title = $this->escape($this->item->parent_title);
$url = '' . $title . ''; ?>
<?php if ($params->get('link_parent_category')) : ?>
<?php echo JText::sprintf('COM_CONTENT_PARENT', $url); ?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_PARENT', $title); ?>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_create_date')) : ?>
<dd class="create">
<i class="icon-calendar"></i>
<?php echo JText::sprintf( JHTML::_('date',$this->item->created, JText::_('DATE_FORMAT_LC'))); ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_modify_date')) : ?>
<dd class="modified">
<i class="icon-calendar"></i>
<?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED', JHTML::_('date',$this->item->modified, JText::_('DATE_FORMAT_LC'))); ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_publish_date')) : ?>
<dd class="published">
<i class="icon-calendar"></i>
<?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE', JHTML::_('date',$this->item->publish_up, JText::_('DATE_FORMAT_LC'))); ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_author') && !empty($this->item->author )) : ?>
<dd class="createdby">
<?php $author = $this->item->author; ?>
<?php $author = ($this->item->created_by_alias ? $this->item->created_by_alias : $author);?>
<?php if (!empty($this->item->contactid ) && $params->get('link_author') == true):?>
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY' ,
JHTML::_('link',JRoute::_('index.php?option=com_contact&view=contact&id='.$this->item->contactid),$author)); ?>
<?php else :?>
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_hits')) : ?>
<dd class="hits">
<?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $this->item->hits); ?>
</dd>
<?php endif; ?>
<?php if ($this->params->get('show_tags', 1)) : ?>
<dd class="item-tags">
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
</dd>
<?php endif; ?>
<?php if (($params->get('show_author')) or ($params->get('show_category')) or ($params->get('show_create_date')) or ($params->get('show_modify_date')) or ($params->get('show_publish_date')) or ($params->get('show_parent_category')) or ($params->get('show_hits'))) :?>
</dl>
<?php endif; ?>
</div>
<?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; ?>
<a class="readmore" href="<?php echo $link; ?>">
<?php if (!$params->get('access-view')) :
echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
elseif ($readmore = $this->item->alternative_readmore) :
echo $readmore;
if ($params->get('show_readmore_title', 0) != 0) :
echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
endif;
elseif ($params->get('show_readmore_title', 0) == 0) :
echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
else :
echo JText::_('COM_CONTENT_READ_MORE');
echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
endif; ?>
<i class="ico-arrow-right"></i>
</a>
<?php endif; ?>
</div>
<?php if ($this->item->state == 0) : ?>
</div>
<?php endif; ?>
<?php echo $this->item->event->afterDisplayContent; ?>`
Plz help me..
I'm not sure if it helps, but you can try to add following line just after defined('_JEXEC') or die;
require_once(JPATH_ROOT . '/libraries/cms/layout/helper.php');