We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Structure module - pagination not working

Development and Programming

patrick-vibes's avatar
patrick-vibes
63 posts
16 years ago
patrick-vibes's avatar patrick-vibes

I am using the following code to try and create pagination on my news section:

{exp:structure:breadcrumb here_as_title="yes"}


{exp:weblog:entries}
<h1>{title}</h1>
{page_body}
{/exp:weblog:entries}

{exp:structure:paginate parse="inward"}
{exp:weblog:entries weblog="news_and_events" dynamic="off" limit="2"}
<div class="item">
<h3><a href="http://{page_url}">{title}</a></h3>
<strong>{entry_date format="%d/%m/%Y"}</strong>
{news_headline}

</div>


<hr >
{/exp:weblog:entries}
{/exp:structure:paginate}

the buttons appear but content is not changing when I click them, it’s just the same two posts on the page but URL changes to “news_and_events?page=2”

The way my news listing page is setup, and my news detail (to read the whole single item) is as per the instructions on the Structure site - where I have created a blog called “news_and_events” and have two templates - news and news_detail.

Help appreciated as I am wrecking my head with this - i need to get this paginating as I am not setting up archives.

       
patrick-vibes's avatar
patrick-vibes
63 posts
16 years ago
patrick-vibes's avatar patrick-vibes

Bump?

       
Phil Norton's avatar
Phil Norton
41 posts
16 years ago
Phil Norton's avatar Phil Norton

Are you using the LG .htaccess Generator to remove the index.php by any chance? I had exactly the same problem, so I disabled the extension and used the following method and pagination worked perfectly:

RewriteEngine on 
RewriteCond $1 !^(images|system|themes|favicon\.ico|robots\.txt|path\.php|index\.php|([a-z0-9-]+).html) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]

This uses the ‘Exclude’ method which works perfectly. The first condition should list all the files or folders to NOT be rewritten (ie images, system etc).

       
patrick-vibes's avatar
patrick-vibes
63 posts
16 years ago
patrick-vibes's avatar patrick-vibes

@Phil: perfect! got it working with that rule - was not using lg, had manually written the rewrite - but dd not have the line you had there for pagination. Thanks mate!

       
aimelise's avatar
aimelise
31 posts
16 years ago
aimelise's avatar aimelise

I’ve got a dev site here: http://gsis.amystoddard.com

I am not using the LG Site Access Generator. The page I’m having issues with is here: http://gsis.amystoddard.com/index.php/about/staff-directory/?page=2

If I leave the “index.php” as part of the URL, page 2 renders fine. If I take it out, it doesn’t paginate.

I’ve tried two different .htaccess files. The first uses the “File and Directory Check Method” found here and looks like this:

# BEGIN Expression Engine Rewrite
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
Options +FollowSymLinks

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?$1 [L]

</IfModule>
# END Expression Engine Rewrite
*****

I tried a second method using the "<a href="http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Exclude_List_Method">Include/Exclude</a>" method that was recommended to me by Travis (creator of the "Structure" module).  This still isn't working.  My "system" folder is renamed to "admin."  With this .htaccess file...all the "pages" are broke unless i manually include "index.php" in the URL.
*****
# BEGIN Expression Engine Rewrite
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(images|admin|css|js|site|themes|favicon\.ico|robots\.txt|path\.php|index\.php|([a-z0-9-]+).html) [NC]
RewriteRule ^(.*)$ /index.php?$1 [L]

</IfModule>
# END Expression Engine Rewrite

Is there something I can add to this .htaccess file that will make it paginate w/o the index.php in the URL?

       
ngenworks's avatar
ngenworks
3 posts
16 years ago
ngenworks's avatar ngenworks

Amy, try using the following .htaccess

RewriteEngine On
RewriteBase /
Options +FollowSymLinks

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

The difference from the one you had previously is in the index.php/$1 instead of what you had index.php?$1

If that doesn’t help PM me and I’ll see if I can help since I used to do the code for Structure.

       
rockthenroll's avatar
rockthenroll
485 posts
16 years ago
rockthenroll's avatar rockthenroll

That’s the one I had her try and put in myself, but it seems to break her pages still.

       
Eric Nance's avatar
Eric Nance
25 posts
16 years ago
Eric Nance's avatar Eric Nance

I’m having the same issue as Amy. I have tried both htaccess rewrite rules with no luck. The page this is happening at is located here:

http://agedefy.server288.com/press-and-media/current-news/

My hosting company is ICDSoft. If anyone has experience getting this to work on ICDSoft servers please let me know. I’ve tried contacting their support team but they say it’s beyond their tech support capability.

Amy, have you had any luck with this?

       
aimelise's avatar
aimelise
31 posts
16 years ago
aimelise's avatar aimelise

Hi Eric. Travis and I are still actively looking into the issue. I will post it here when we’ve found a solution. I’m hosting at Hostgator. A PHP info shows what’s running here:

http://gsis.amystoddard.com/info.php

       
rockthenroll's avatar
rockthenroll
485 posts
16 years ago
rockthenroll's avatar rockthenroll

Just to follow up, we found it was an edge case issue for certain hosting environments and will be patched in the next version.

       
Greg Stewart's avatar
Greg Stewart
8 posts
16 years ago
Greg Stewart's avatar Greg Stewart

Can you post the solution to this? I am having the same issue where the GET variable is being ignored.

       
rockthenroll's avatar
rockthenroll
485 posts
16 years ago
rockthenroll's avatar rockthenroll

Here’s the file for anyone having the same issue. The next version will include these fixes as well, of course.

       
Greg Stewart's avatar
Greg Stewart
8 posts
16 years ago
Greg Stewart's avatar Greg Stewart

thanks for the fix, looks like it’s working again 😊

I noticed the file says pagination_and_category, does that mean categories work now?

Greg

       
rockthenroll's avatar
rockthenroll
485 posts
16 years ago
rockthenroll's avatar rockthenroll

Categories refers to pagination now working when specifying a category on the weblog tag. It didn’t retain the proper page count before.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.