7

I seem to be having an issue with the pagination on the news section appending an /index/ when using the {pagination_links} tag.

My news page has a template path of news/index and the posts template is news/post.

I am using structure with the news/post as a listing attached to the news/index page, to add|edit posts.

If you have a look at the website in question: http://www.wilbyltd.co.uk/news scroll to the bottom you will see the pagination, if you click either 1|2|3 or next page or last page you will get the page requested, the url looks like /news/P6, however now on this next page if you go to the pagination again and click any of them you will notice it has gone back to page 1 and the url has /news/index it seems to be appending or inserting between links /index/.

I have tried to the paginate_base="" in the channel entry but adding a base stops the categories from having a working pagination, categories also add /index/ between the links?

I have thought of hacking the core but seems the wrong approach just in case it ever gets updated.

I have tried .htaccess to remove the index, which didn't work.

RewriteRule ^/news/index/(.+)$ /news/$1 [L]

I have looked at the config for index.php which has been taken off and .htaccess has been used.

I have looked at the channel settings.

I have tried dynamic="off"|dynamic="on"

I understand that news/index it the correct path for the page to view, but if this is the case why doesn't it pick up the pagination?

If anyone could shed some light in to this I would be really grateful, here is the code containing the pagination.

{exp:channel:entries channel="posts" limit="6" dynamic="on" paginate="bottom" orderby="entry_date" sort="desc"}
  <div class="news-snippet span9">
   <a href="{url_title_path=">
   <div class="date-published textalign-center">
    <span class="day">{entry_date format="%d"}</span><span class="day-suffix">{entry_date format="%S"}</span>
    <span class="month">{entry_date format="%F"}</span>
   </div>
   </a>
   <div class="news-snippet-body pull-right">
    <div class="news-snippet-top-shadow">
     <div class="news-snippet-bottom-shadow">

      <a href="{url_title_path=">
       <div class="news-snippet-content clearfix">
        <div class="title">
         <h3>{title}</h3>
        </div>
        {if news_feature_image}
        <div class="clearfix image">
         <img src="{news_feature_image}" />
        </div>
        {/if}
        <p>{news_short_description}</p>
       </div>&lt;!-- end content --&gt;
      </a>

      <div class="news-snippet-options clearfix">
       <div class="news-tags pull-left">
        <i class="icon-tags"></i>
        {exp:tagger:tags entry_id="{entry_id}" }
           <a href="/news/tags/{tagger:urlsafe_tagname}" title="{tagger:tag_name}"><span class="label label-inverse tags">{tagger:tag_name}</span></a>
        {/exp:tagger:tags}
       </div>
       <div class="social-share pull-right textalign-center">
        <i class="icon-random"></i>
        <a class="addthis_button"url="{url_title_path="title="{title}" href="http://www.addthis.com/bookmark.php?v=300&amp;pubid=ra-5141a60a37fa6e4e">Share</a>
       </div>
      </div>

     </div>&lt;!-- end bottom-shadow --&gt;
    </div>&lt;!-- end top-shadow --&gt;
   </div>&lt;!-- end snippet-body --&gt;        
  </div>&lt;!-- end news-snippet --&gt;

  {paginate}       
   <div class="clearfix paginate">
     {pagination_links}
     <div class="total-pages pull-left">
      <p>Page {current_page} of {total_pages} pages</p>
     </div>
     <div class="pagination pagination-mini pull-right">
      <ul>
      {first_page}
       <li><a href="{pagination_url}" class="page-first">First Page</a></li>
      {/first_page}

      {previous_page}
       <li><a href="{pagination_url}" class="page-previous">Previous Page</a></li>
      {/previous_page}

      {page}
       <li><a href="{pagination_url}" class="page-{pagination_page_number} {if current_page}active{/if}">{pagination_page_number}</a></li>
      {/page}

      {next_page}
       <li><a href="{pagination_url}" class="page-next">Next Page</a></li>
      {/next_page}

      {last_page}
       <li><a href="{pagination_url}" class="page-last">Last Page</a></li>
      {/last_page}
      </ul>
     </div>
    {/pagination_links}
   </div>&lt;!-- end clearfix --&gt;
  {/paginate}
 {/exp:channel:entries}

I have also had this on Ellis Labs forum for a couple of weeks: http://ellislab.com/forums/viewthread/237601/

Tuz
  • 119
  • 1
  • 6

1 Answers1

0

Try to override the {paginate_base} parameter in your channel entries tag

{exp:channel:entries channel="posts" paginate_base="news/" ...}
Carlos Quijano
  • 1,566
  • 15
  • 23