Изменить макет вывода блога категорий

Тема в разделе "Изменение шаблона (кастомизация)", создана пользователем Lepiloff, 16.12.2015.

  1. Offline

    Lepiloff Недавно здесь

    Регистрация:
    16.12.2015
    Сообщения:
    4
    Симпатии:
    0
    Пол:
    Мужской
    Доброго дня! Joomla 3.4.6 Шаблон Helix 3 . Имею стандартный вывод блога категорий - заголовок - специнфа - изображение (https://workhard.by/bodibilding.html). Хочу переделать так что бы изображение было сверху (как здесь http://мышцы.рф/статьи). Вывод осуществляется из файла шаблона templates/shaper_helix3/html/com_content/category/ blog_item.php , но что именно отвечает не понимаю, помогите пожалуйста!

    Код (PHP):
    1. <?php
    2. /**
    3. * @package     Joomla.Site
    4. * @subpackage  Layout
    5. *
    6. * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
    7. * @license     GNU General Public License version 2 or later; see LICENSE.txt
    8. */
    9.  
    10. defined('_JEXEC') or die;
    11.  
    12. // Create a shortcut for params.
    13. $params = $this->item->params;
    14. $tpl_params     = JFactory::getApplication()->getTemplate(true)->params;
    15. JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
    16. $canEdit      = $this->item->params->get('access-edit');
    17. $info         = $params->get('info_block_position', 0);
    18. $useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_create_date')
    19.     || $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category') || $params->get('show_author') );
    20.  
    21. // Post Format
    22. $post_attribs = new JRegistry(json_decode( $this->item->attribs ));
    23. $post_format = $post_attribs->get('post_format', 'standard');
    24. ?>
    25.  
    26. <?php if ($this->item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate())
    27.     || ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate())) : ?>
    28.     <div class="system-unpublished">
    29. <?php endif; ?>
    30.  
    31. <?php
    32.     if($post_format=='standard') {
    33.         echo JLayoutHelper::render('joomla.content.intro_image', $this->item);
    34.     } else {
    35.         echo JLayoutHelper::render('joomla.content.post_formats.post_' . $post_format, array('params' => $post_attribs, 'item' => $this->item));
    36.     }
    37. ?>
    38.  
    39. <div class="entry-header<?php echo $tpl_params->get('show_post_format') ? ' has-post-format': ''; ?>">
    40.  
    41.     <?php echo JLayoutHelper::render('joomla.content.post_formats.icons',  $post_format); ?>
    42.  
    43.     <?php if ($useDefList && ($info == 0 || $info == 2)) : ?>
    44.         <?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'above')); ?>
    45.     <?php endif; ?>
    46.  
    47.     <?php echo JLayoutHelper::render('joomla.content.blog_style_default_item_title', $this->item); ?>
    48. </div>
    49.  
    50. <?php if ($canEdit || $params->get('show_print_icon') || $params->get('show_email_icon')) : ?>
    51.     <?php echo JLayoutHelper::render('joomla.content.icons', array('params' => $params, 'item' => $this->item, 'print' => false)); ?>
    52. <?php endif; ?>
    53.  
    54. <?php if (!$params->get('show_intro')) : ?>
    55.     <?php echo $this->item->event->afterDisplayTitle; ?>
    56. <?php endif; ?>
    57. <?php echo $this->item->event->beforeDisplayContent; ?>
    58.  
    59. <?php $rating = (int) $this->item->rating; ?>
    60.  
    61. <?php echo $this->item->introtext; ?>
    62.  
    63. <?php if ($useDefList && ($info == 1 || $info == 2)) : ?>
    64.     <?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'below')); ?>
    65. <?php  endif; ?>
    66.  
    67. <?php if ($params->get('show_readmore') && $this->item->readmore) :
    68.     if ($params->get('access-view')) :
    69.         $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language));
    70.     else :
    71.         $menu = JFactory::getApplication()->getMenu();
    72.         $active = $menu->getActive();
    73.         $itemId = $active->id;
    74.         $link1 = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId);
    75.         $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language));
    76.         $link = new JUri($link1);
    77.         $link->setVar('return', base64_encode($returnURL));
    78.     endif; ?>
    79.  
    80.     <?php echo JLayoutHelper::render('joomla.content.readmore', array('item' => $this->item, 'params' => $params, 'link' => $link)); ?>
    81.  
    82. <?php endif; ?>
    83.  
    84. <?php if ($this->item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate())
    85.     || ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate())) : ?>
    86. </div>
    87. <?php endif; ?>
    88.  
    89. <?php if ($params->get('show_tags') && !empty($this->item->tags->itemTags)) : ?>
    90.     <?php echo JLayoutHelper::render('joomla.content.tags', $this->item->tags->itemTags); ?>
    91. <?php endif; ?>
    92.  
    93. <?php echo $this->item->event->afterDisplayContent; ?>

    Код (PHP):
    1. <?php
    2. /**
    3. * @package     Joomla.Site
    4. * @subpackage  Layout
    5. *
    6. * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
    7. * @license     GNU General Public License version 2 or later; see LICENSE.txt
    8. */
    9.  
    10. defined('_JEXEC') or die;
    11.  
    12. // Create a shortcut for params.
    13. $params = $this->item->params;
    14. $tpl_params     = JFactory::getApplication()->getTemplate(true)->params;
    15. JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
    16. $canEdit      = $this->item->params->get('access-edit');
    17. $info         = $params->get('info_block_position', 0);
    18. $useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_create_date')
    19.     || $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category') || $params->get('show_author') );
    20.  
    21. // Post Format
    22. $post_attribs = new JRegistry(json_decode( $this->item->attribs ));
    23. $post_format = $post_attribs->get('post_format', 'standard');
    24. ?>
    25.  
    26. <?php if ($this->item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate())
    27.     || ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate())) : ?>
    28.     <div class="system-unpublished">
    29. <?php endif; ?>
    30.  
    31. <?php
    32.     if($post_format=='standard') {
    33.         echo JLayoutHelper::render('joomla.content.intro_image', $this->item);
    34.     } else {
    35.         echo JLayoutHelper::render('joomla.content.post_formats.post_' . $post_format, array('params' => $post_attribs, 'item' => $this->item));
    36.     }
    37. ?>
    38.  
    39. <div class="entry-header<?php echo $tpl_params->get('show_post_format') ? ' has-post-format': ''; ?>">
    40.  
    41.     <?php echo JLayoutHelper::render('joomla.content.post_formats.icons',  $post_format); ?>
    42.  
    43.     <?php if ($useDefList && ($info == 0 || $info == 2)) : ?>
    44.         <?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'above')); ?>
    45.     <?php endif; ?>
    46.  
    47.     <?php echo JLayoutHelper::render('joomla.content.blog_style_default_item_title', $this->item); ?>
    48. </div>
    49.  
    50. <?php if ($canEdit || $params->get('show_print_icon') || $params->get('show_email_icon')) : ?>
    51.     <?php echo JLayoutHelper::render('joomla.content.icons', array('params' => $params, 'item' => $this->item, 'print' => false)); ?>
    52. <?php endif; ?>
    53.  
    54. <?php if (!$params->get('show_intro')) : ?>
    55.     <?php echo $this->item->event->afterDisplayTitle; ?>
    56. <?php endif; ?>
    57. <?php echo $this->item->event->beforeDisplayContent; ?>
    58.  
    59. <?php $rating = (int) $this->item->rating; ?>
    60.  
    61. <?php echo $this->item->introtext; ?>
    62.  
    63. <?php if ($useDefList && ($info == 1 || $info == 2)) : ?>
    64.     <?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'below')); ?>
    65. <?php  endif; ?>
    66.  
    67. <?php if ($params->get('show_readmore') && $this->item->readmore) :
    68.     if ($params->get('access-view')) :
    69.         $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language));
    70.     else :
    71.         $menu = JFactory::getApplication()->getMenu();
    72.         $active = $menu->getActive();
    73.         $itemId = $active->id;
    74.         $link1 = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId);
    75.         $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language));
    76.         $link = new JUri($link1);
    77.         $link->setVar('return', base64_encode($returnURL));
    78.     endif; ?>
    79.  
    80.     <?php echo JLayoutHelper::render('joomla.content.readmore', array('item' => $this->item, 'params' => $params, 'link' => $link)); ?>
    81.  
    82. <?php endif; ?>
    83.  
    84. <?php if ($this->item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate())
    85.     || ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate())) : ?>
    86. </div>
    87. <?php endif; ?>
    88.  
    89. <?php if ($params->get('show_tags') && !empty($this->item->tags->itemTags)) : ?>
    90.     <?php echo JLayoutHelper::render('joomla.content.tags', $this->item->tags->itemTags); ?>
    91. <?php endif; ?>
    92.  
    93. <?php echo $this->item->event->afterDisplayContent; ?>

     
    Последнее редактирование: 16.12.2015
  2.  
  3. OlegM
    Offline

    OlegM Russian Joomla! Team Команда форума

    Регистрация:
    12.04.2007
    Сообщения:
    4 311
    Симпатии:
    375
    Пол:
    Мужской
    Как я понимаю, проблема решена?
     
  4. Offline

    Lepiloff Недавно здесь

    Регистрация:
    16.12.2015
    Сообщения:
    4
    Симпатии:
    0
    Пол:
    Мужской
    Ну ка же, все по старому. Я не осилил, помощь не пришла)
     

Поделиться этой страницей

Загрузка...