Проблема Поменять местами заголовок и текс статьи

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

  1. tanyaromanyuk94
    Offline

    tanyaromanyuk94 Пользователь

    Регистрация:
    02.09.2015
    Сообщения:
    44
    Симпатии:
    0
    Такой вопрос, как поменять местами вывод заголовка и саму статью. Т.е. чтоб загловок выводился под статьей.
    Вот код default.php в папке html шаблона
    Я знаю, что за заголовок отвечает класс componentheading а за саму статью класс text-article. Но просто поставить блок с текстом статьи перед заголовком - не помогло. Помогите с решением проблемы
    Код (PHP):
    1. <?php
    2. defined('_JEXEC') or die('Restricted access');
    3. ?>
    4.  
    5. <?php if (($this->user->authorize('com_content', 'edit', 'content', 'all') || $this->user->authorize('com_content', 'edit', 'content', 'own')) && !($this->print)) : ?>
    6. <div class="contentpaneopen_edit<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
    7.     <?php echo JHTML::_('icon.edit', $this->article, $this->params, $this->access); ?>
    8. </div>
    9. <?php endif; ?>
    10. <p class="buttonheading">
    11.     <?php if ($this->print) :
    12.         echo JHTML::_('icon.print_screen', $this->article, $this->params, $this->access);
    13.     elseif ($this->params->get('show_pdf_icon') || $this->params->get('show_print_icon') || $this->params->get('show_email_icon')) : ?>
    14.     <?php if ($this->params->get('show_pdf_icon')) :
    15.         echo JHTML::_('icon.pdf', $this->article, $this->params, $this->access);
    16.     endif;
    17.     if ($this->params->get('show_print_icon')) :
    18.         echo JHTML::_('icon.print_popup', $this->article, $this->params, $this->access);
    19.     endif;
    20.     if ($this->params->get('show_email_icon')) :
    21.         echo JHTML::_('icon.email', $this->article, $this->params, $this->access);
    22.     endif;
    23.     endif; ?>
    24. </p>
    25. <?php if ($this->params->get('show_page_title',1) && $this->params->get('page_title') != $this->article->title) : ?>
    26. <h1 class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
    27.     <?php
    28.     // create title
    29.     $pos   = JString::strpos($this->escape($this->params->get('page_title')), ' ');
    30.     $title = ($pos !== false) ? JString::substr($this->escape($this->params->get('page_title')), 0, $pos).'<span>'.JString::substr($this->escape($this->params->get('page_title')), $pos).'</span>' : $this->escape($this->params->get('page_title'));
    31.     ?>
    32.     <?php echo $title; ?>
    33. </h1>
    34. <?php endif; ?>
    35. <?php if ($this->params->get('show_title')) : ?>
    36. <h1 class="contentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
    37.     <?php if ($this->params->get('link_titles') && $this->article->readmore_link != '') : ?>
    38.     <a href="<?php echo $this->article->readmore_link; ?>" class="contentpagetitle<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
    39.    
    40.     <?php
    41.     // create title
    42.     $pos   = JString::strpos($this->escape($this->article->title), ' ');
    43.     $title = ($pos !== false) ? JString::substr($this->escape($this->article->title), 0, $pos).'<span>'.JString::substr($this->escape($this->article->title), $pos).'</span>' : $this->escape($this->article->title);
    44.     ?>
    45.        
    46.     <?php echo $title; ?>
    47.     </a>
    48.     <?php else :
    49.    
    50.     // create title
    51.     $pos   = JString::strpos($this->escape($this->article->title), ' ');
    52.     $title = ($pos !== false) ? JString::substr($this->escape($this->article->title), 0, $pos).'<span>'.JString::substr($this->escape($this->article->title), $pos).'</span>' : $this->escape($this->article->title);  
    53.     echo $title;
    54.    
    55.     endif; ?>
    56. </h1>
    57. <?php endif; ?>
    58. <?php if ((intval($this->article->modified) !=0 && $this->params->get('show_modify_date')) || ($this->params->get('show_author') && ($this->article->author != "")) || ($this->params->get('show_create_date'))) : ?>
    59. <p class="articleinfo">
    60.     <?php if (intval($this->article->modified) !=0 && $this->params->get('show_modify_date')) : ?>
    61.     <span class="modifydate">
    62.         <?php echo JText::sprintf('LAST_UPDATED2', JHTML::_('date', $this->article->modified, JText::_('DATE_FORMAT_LC2'))); ?>
    63.     </span>
    64.     <?php endif; ?>
    65.     <?php if (($this->params->get('show_author')) && ($this->article->author != "")) : ?>
    66.     <span class="createdby">
    67.         <?php JText::printf('Written by', ($this->article->created_by_alias ? $this->escape($this->article->created_by_alias) : $this->escape($this->article->author))); ?>
    68.     </span>
    69.     <?php endif; ?>
    70.     <?php if ($this->params->get('show_create_date')) : ?>
    71.     <span class="createdate">
    72.         <?php echo JHTML::_('date', $this->article->created, JText::_('DATE_FORMAT_LC2')); ?>
    73.     </span>
    74.     <?php endif; ?>
    75. </p>
    76. <?php endif; ?>
    77. <?php if (!$this->params->get('show_intro')) :
    78.     echo $this->article->event->afterDisplayTitle;
    79. endif; ?>
    80. <?php if (($this->params->get('show_section') && $this->article->sectionid) || ($this->params->get('show_category') && $this->article->catid)) : ?>
    81. <p class="iteminfo">
    82.     <?php if ($this->params->get('show_section') && $this->article->sectionid) : ?>
    83.     <span>
    84.         <?php if ($this->params->get('link_section')) : ?>
    85.             <?php echo '<a href="'.JRoute::_(ContentHelperRoute::getSectionRoute($this->article->sectionid)).'">'; ?>
    86.         <?php endif; ?>
    87.         <?php echo $this->escape($this->article->section); ?>
    88.         <?php if ($this->params->get('link_section')) : ?>
    89.             <?php echo '</a>'; ?>
    90.         <?php endif; ?>
    91.         <?php if ($this->params->get('show_category')) : ?>
    92.             <?php echo ' - '; ?>
    93.         <?php endif; ?>
    94.     </span>
    95.     <?php endif; ?>
    96.     <?php if ($this->params->get('show_category') && $this->article->catid) : ?>
    97.     <span>
    98.         <?php if ($this->params->get('link_category')) : ?>
    99.             <?php echo '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->article->catslug, $this->article->sectionid)).'">'; ?>
    100.         <?php endif; ?>
    101.         <?php echo $this->escape($this->article->category); ?>
    102.         <?php if ($this->params->get('link_category')) : ?>
    103.             <?php echo '</a>'; ?>
    104.         <?php endif; ?>
    105.     </span>
    106.     <?php endif; ?>
    107. </p>
    108. <?php endif; ?>
    109. <?php echo $this->article->event->beforeDisplayContent; ?>
    110. <?php if ($this->params->get('show_url') && $this->article->urls) : ?>
    111. <span class="small">
    112.     <a href="<?php echo $this->escape($this->article->urls); ?>" target="_blank">
    113.         <?php echo $this->escape($this->article->urls); ?></a>
    114. </span>
    115. <?php endif; ?>
    116. <?php if (isset ($this->article->toc)) :
    117.     echo $this->article->toc;
    118. endif; ?>
    119. <article class="text-article">
    120. <?php echo JFilterOutput::ampReplace($this->article->text); ?>
    121. </article>
    122. <?php echo $this->article->event->afterDisplayContent; ?>
     
  2.  
  3. tanyaromanyuk94
    Offline

    tanyaromanyuk94 Пользователь

    Регистрация:
    02.09.2015
    Сообщения:
    44
    Симпатии:
    0
    Пыталась перенести код :
    Код (PHP):
    1. [LIST=1]
    2. [*]<?php if ($this->params->get('show_page_title',1) && $this->params->get('page_title') != $this->article->title) : ?>
    3. [*]<h1 class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
    4. [*]   <?php
    5. [*]   // create title
    6. [*]   $pos = JString::strpos($this->escape($this->params->get('page_title')), ' ');
    7. [*]   $title = ($pos !== false) ? JString::substr($this->escape($this->params->get('page_title')), 0, $pos).'<span>'.JString::substr($this->escape($this->params->get('page_title')), $pos).'</span>' : $this->escape($this->params->get('page_title'));
    8. [*]   ?>
    9. [*]   <?php echo $title; ?>
    10. [*]</h1>
    11. [*]<?php endif; ?>
    12. [/LIST]


    просто в самый конец файла - тоже не помогло
    --- добавлено: 04.12.2015, первое сообщение размещено: 04.12.2015 ---
    Очень нужна помощь
     
  4. OlegK
    Offline

    OlegK Russian Joomla! Team Команда форума ⇒ Профи ⇐

    Регистрация:
    17.01.2011
    Сообщения:
    7 813
    Симпатии:
    771
    Пол:
    Мужской
    Версия Джумла ?
     
  5. tanyaromanyuk94
    Offline

    tanyaromanyuk94 Пользователь

    Регистрация:
    02.09.2015
    Сообщения:
    44
    Симпатии:
    0
    Joomla 1.5
     
  6. OlegK
    Offline

    OlegK Russian Joomla! Team Команда форума ⇒ Профи ⇐

    Регистрация:
    17.01.2011
    Сообщения:
    7 813
    Симпатии:
    771
    Пол:
    Мужской
    Ну шаблон не родной Джумла. Ну а заголовок выводит без условий ,и в параметрах статьи разрешено выводить заголовок статьи?
     
  7. tanyaromanyuk94
    Offline

    tanyaromanyuk94 Пользователь

    Регистрация:
    02.09.2015
    Сообщения:
    44
    Симпатии:
    0
    Да, разрешено.
    Суть вот в чем.
    На сайте есть категории где выводяться превью-видео(тобиш статьи). Над каждой превьюшкой заголовок с классом componentheading. Нужно чтоб этот заголовок не над преью выводиля, а под ним. Выше я как раз выкладывала код самого шаблона
     
  8. OlegK
    Offline

    OlegK Russian Joomla! Team Команда форума ⇒ Профи ⇐

    Регистрация:
    17.01.2011
    Сообщения:
    7 813
    Симпатии:
    771
    Пол:
    Мужской
    О-о,а сразу написать можно было,что переопределить вывод категории , а не статьи ?
    Вот код заголовока
    Код (PHP):
    1. <?php if ($this->params->get('show_title')) : ?>
    2. <h1 class="contentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
    3.    <?php if ($this->params->get('link_titles') && $this->article->readmore_link != '') : ?>
    4.     <a href="<?php echo $this->article->readmore_link; ?>" class="contentpagetitle<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
    5.    
    6.    <?php
    7.    // create title
    8.    $pos = JString::strpos($this->escape($this->article->title), ' ');
    9.    $title = ($pos !== false) ? JString::substr($this->escape($this->article->title), 0, $pos).'<span>'.JString::substr($this->escape($this->article->title), $pos).'</span>' : $this->escape($this->article->title);
    10.    ?>
    11.        
    12.    <?php echo $title; ?>
    13.     </a>
    14.    <?php else :
    15.    
    16.    // create title
    17.    $pos = JString::strpos($this->escape($this->article->title), ' ');
    18.    $title = ($pos !== false) ? JString::substr($this->escape($this->article->title), 0, $pos).'<span>'.JString::substr($this->escape($this->article->title), $pos).'</span>' : $this->escape($this->article->title);
    19.    echo $title;
    20.    
    21.    endif; ?>
    22. </h1>
    23. <?php endif; ?>
     
  9. tanyaromanyuk94
    Offline

    tanyaromanyuk94 Пользователь

    Регистрация:
    02.09.2015
    Сообщения:
    44
    Симпатии:
    0


    ну не совсем. Должно выглядеть так как на скриншоте
     

    Вложения:

  10. OlegK
    Offline

    OlegK Russian Joomla! Team Команда форума ⇒ Профи ⇐

    Регистрация:
    17.01.2011
    Сообщения:
    7 813
    Симпатии:
    771
    Пол:
    Мужской
    путь к файлу /templates/you_templatee/html/com_content/category/blog_item.php
     

    Вложения:

    • blog_item.zip
      Размер файла:
      1.3 КБ
      Просмотров:
      2

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

Загрузка...