Постраничная навигация

Discussion in 'Навигационная структура сайта' started by windin, Apr 13, 2012.

  1. Offline

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

    Joined:
    Apr 13, 2012
    Messages:
    15
    Likes Received:
    0
    Gender:
    Male
    Народ очень нужно, но не могу найти, хочу постраничную навигацию ту что внизу, сделать что бы она же ещё вверху была, над текстом. Где прописанно как она появляется на странице? что бы можно было скопировать перед статьей?
     
  2.  
  3. joomguru
    Offline

    joomguru Модератор => Cпециалист <=

    Joined:
    Dec 3, 2010
    Messages:
    456
    Likes Received:
    77
    Gender:
    Male
    Прописано вот этим блоком в файле components/com_content/views/category/tmpl/blog.php

    Код (PHP):
    1. <?php if (($this->params->def('show_pagination', 1) == 1  || ($this->params->get('show_pagination') == 2)) && ($this->pagination->get('pages.total') > 1)) : ?>
    2.         <div class="pagination">
    3.                         <?php  if ($this->params->def('show_pagination_results', 1)) : ?>
    4.                         <p class="counter">
    5.                                 <?php echo $this->pagination->getPagesCounter(); ?>
    6.                         </p>
    7.  
    8.                 <?php endif; ?>
    9.                 <?php echo $this->pagination->getPagesLinks(); ?>
    10.         </div>
    11. <?php  endif; ?>


    Продублируй его в этом же файле перед строками
    Код (PHP):
    1. <?php $leadingcount=0 ; ?>
    2. <?php if (!empty($this->lead_items)) : ?>
     
  4. Offline

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

    Joined:
    Apr 13, 2012
    Messages:
    15
    Likes Received:
    0
    Gender:
    Male
    У меня файлик выглядит немного иначе, и точных совпадений нет, а во стором случае даже частичных.

    Код (PHP):
    1. <?php // no direct access
    2. defined('_JEXEC') or die('Restricted access');
    3. $cparams =& JComponentHelper::getParams('com_media');
    4. ?>
    5. <?php if ($this->params->get('show_page_title', 1)) : ?>
    6. <div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
    7.     <?php echo $this->escape($this->params->get('page_title')); ?>
    8. </div>
    9. <?php endif; ?>
    10. <table class="blog<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" cellpadding="0" cellspacing="0">
    11. <?php if ($this->params->def('show_description', 1) || $this->params->def('show_description_image', 1)) :?>
    12. <tr>
    13.     <td valign="top">
    14.     <?php if ($this->params->get('show_description_image') && $this->category->image) : ?>
    15.         <img src="<?php echo $this->baseurl . '/' . $cparams->get('image_path') . '/'. $this->category->image;?>" align="<?php echo $this->category->image_position;?>" hspace="6" alt="" />
    16.     <?php endif; ?>
    17.     <?php if ($this->params->get('show_description') && $this->category->description) : ?>
    18.         <?php echo $this->category->description; ?>
    19.     <?php endif; ?>
    20.         <br />
    21.         <br />
    22.     </td>
    23. </tr>
    24. <?php endif; ?>
    25. <?php if ($this->params->get('num_leading_articles')) : ?>
    26. <tr>
    27.     <td valign="top">
    28.     <?php for ($i = $this->pagination->limitstart; $i < ($this->pagination->limitstart + $this->params->get('num_leading_articles')); $i++) : ?>
    29.         <?php if ($i >= $this->total) : break; endif; ?>
    30.         <div>
    31.         <?php
    32.             $this->item =& $this->getItem($i, $this->params);
    33.             echo $this->loadTemplate('item');
    34.         ?>
    35.         </div>
    36.     <?php endfor; ?>
    37.     </td>
    38. </tr>
    39. <?php else : $i = $this->pagination->limitstart; endif; ?>
    40.  
    41. <?php
    42. $startIntroArticles = $this->pagination->limitstart + $this->params->get('num_leading_articles');
    43. $numIntroArticles = $startIntroArticles + $this->params->get('num_intro_articles');
    44. if (($numIntroArticles != $startIntroArticles) && ($i < $this->total)) : ?>
    45. <tr>
    46.     <td valign="top">
    47.         <table width="100%"  cellpadding="0" cellspacing="0">
    48.         <tr>
    49.         <?php
    50.             $divider = '';
    51.             if ($this->params->def('multi_column_order', 0)) : // order across, like front page
    52.                 for ($z = 0; $z < $this->params->def('num_columns', 2); $z ++) :
    53.                     if ($z > 0) : $divider = " column_separator"; endif; ?>
    54.                     <?php
    55.                     $rows = (int) ($this->params->get('num_intro_articles', 4) / $this->params->get('num_columns'));
    56.                     $cols = ($this->params->get('num_intro_articles', 4) % $this->params->get('num_columns'));
    57.                     ?>
    58.                     <td valign="top"
    59.                         width="<?php echo intval(100 / $this->params->get('num_columns')) ?>%"
    60.                         class="article_column<?php echo $divider ?>">
    61.                         <?php
    62.                         $loop = (($z < $cols)?1:0) + $rows;
    63.  
    64.                         for ($y = 0; $y < $loop; $y ++) :
    65.                             $target = $i + ($y * $this->params->get('num_columns')) + $z;
    66.                             if ($target < $this->total && $target < ($numIntroArticles)) :
    67.                                 $this->item =& $this->getItem($target, $this->params);
    68.                                 echo $this->loadTemplate('item');
    69.                             endif;
    70.                         endfor;
    71.                         ?></td>
    72.                 <?php endfor;
    73.                         $i = $i + $this->params->get('num_intro_articles') ;
    74.             else : // otherwise, order down, same as before (default behaviour)
    75.                 for ($z = 0; $z < $this->params->get('num_columns'); $z ++) :
    76.                     if ($z > 0) : $divider = " column_separator"; endif; ?>
    77.                     <td valign="top" width="<?php echo intval(100 / $this->params->get('num_columns')) ?>%" class="article_column<?php echo $divider ?>">
    78.                     <?php for ($y = 0; $y < ($this->params->get('num_intro_articles') / $this->params->get('num_columns')); $y ++) :
    79.                     if ($i < $this->total && $i < ($numIntroArticles)) :
    80.                         $this->item =& $this->getItem($i, $this->params);
    81.                         echo $this->loadTemplate('item');
    82.                         $i ++;
    83.                     endif;
    84.                 endfor; ?>
    85.                 </td>
    86.         <?php endfor;
    87.         endif; ?>
    88.         </tr>
    89.         </table>
    90.     </td>
    91. </tr>
    92. <?php endif; ?>
    93. <?php if ($this->params->get('num_links') && ($i < $this->total)) : ?>
    94. <tr>
    95.     <td valign="top">
    96.         <div class="blog_more<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
    97.             <?php
    98.                 $this->links = array_splice($this->items, $i - $this->pagination->limitstart);
    99.                 echo $this->loadTemplate('links');
    100.             ?>
    101.         </div>
    102.     </td>
    103. </tr>
    104. <?php endif; ?>
    105. <?php if ($this->params->get('show_pagination')) : ?>
    106. <tr>
    107.     <td valign="top" align="center">
    108.         <?php echo $this->pagination->getPagesLinks(); ?>
    109.         <br /><br />
    110.     </td>
    111. </tr>
    112. <?php endif; ?>
    113. <?php if ($this->params->get('show_pagination_results')) : ?>
    114. <tr>
    115.     <td valign="top" align="center">
    116.         <?php echo $this->pagination->getPagesCounter(); ?>
    117.     </td>
    118. </tr>
    119. <?php endif; ?>
    120. </table>
     
  5. joomguru
    Offline

    joomguru Модератор => Cпециалист <=

    Joined:
    Dec 3, 2010
    Messages:
    456
    Likes Received:
    77
    Gender:
    Male
    Я писал для Joomla 2.5. У тебя похоже 1.5 ?

    Тогда за вывод навигации отвечает вот этот блок
    Код (PHP):
    1. <?php if ($this->params->get('show_pagination')) : ?>
    2.  
    3. <tr>
    4.  
    5.     <td valign="top" align="center">
    6.  
    7.         <?php echo $this->pagination->getPagesLinks(); ?>
    8.  
    9.         <br /><br />
    10.  
    11.     </td>
    12.  
    13. </tr>
    14.  
    15. <?php endif; ?>
    16.  
    17. <?php if ($this->params->get('show_pagination_results')) : ?>
    18.  
    19. <tr>
    20.  
    21.     <td valign="top" align="center">
    22.  
    23.         <?php echo $this->pagination->getPagesCounter(); ?>
    24.  
    25.     </td>
    26.  
    27. </tr>
    28.  
    29. <?php endif; ?>


    Скопируй его вверх перед строкой
    Код (PHP):
    1. <?php if ($this->params->get('num_leading_articles')) : ?>
     
  6. Offline

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

    Joined:
    Apr 13, 2012
    Messages:
    15
    Likes Received:
    0
    Gender:
    Male
    Спасибо огромное. Да, у меня 1,5.
     
  7. Offline

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

    Joined:
    Apr 13, 2012
    Messages:
    15
    Likes Received:
    0
    Gender:
    Male
    Народ, проблема не решена, исправления в данном файле ни к чему не привели. Подскажите пожалуйчаста решение. Где тот кусочек кода живет?))
     

Share This Page

Loading...