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

Pagination links broken

Development and Programming

jwindhorst's avatar
jwindhorst
99 posts
14 years ago
jwindhorst's avatar jwindhorst

I’ve been searching all over the forums trying to figure this out and I’m not getting anywhere. I have a page that is a combination of a single entry and then multiple entries below it. It’s basically an image gallery with a description at the top.

Here is the channel entries tag I am using:

{exp:channel:entries channel="gallery-entry" limit="10" dynamic="no" paginate="top" }

Then inside there I have:

{paginate}
    {pagination_links}
{/paginate}

The links for the pagination show up just fine, however the /P10 that it’s adding to the URL is not recognize and thus 404’ing on me.

I do have a .htaccess file but I tried ripping it out for testing and it did not fix the issue. I’m also running EE2.1.3.

As a related question I would have expect the /P# to be /P2. I realize it is likely getting that from my limit, but it seems like it should be relating to pages, not entries.

       
Boyink!'s avatar
Boyink!
5,011 posts
14 years ago
Boyink!'s avatar Boyink!

You can’t turn dynamic off and have pagination work - returning content in a paginated way is one of the ways the channel:entries tag is dynamic.

In other words, the channel entries tag knows when to paginate by watching the URL. By turning dynamic=”no” you’ve now told the channel:entries to not do anything different based on the URL.

       
jwindhorst's avatar
jwindhorst
99 posts
14 years ago
jwindhorst's avatar jwindhorst

Turning dynamic off is the only way that I could get the second channel entries to play nicely inside of a “Pages Module” page, so that needs to be set that way. Does this mean I need to roll my pagination? That seems silly.

       
Boyink!'s avatar
Boyink!
5,011 posts
14 years ago
Boyink!'s avatar Boyink!

Well, paginated content and the Pages module aren’t a great fit either. The intent of the Pages module is to present static, standalone pages unlike blog entries, or multi-page content.

What was your reason for using the Pages module?

       
jwindhorst's avatar
jwindhorst
99 posts
14 years ago
jwindhorst's avatar jwindhorst

Were using taxonomy to build our navigation. (It saved a lot of time when building the 125 or so pages that are being roped into the site.) That being said, we needed the pages module as well. The page I’m currently stuck on, is a “Pages” page, which then calls in entries from a different channel.

{exp:channel:entries channel="galleries" paginate="top"}
...
{/exp:channel:entries}

{exp:channel:entries channel="gallery-entry" limit="10" dynamic="no" paginate="top" }
{paginate}
   {pagination_links}
{/paginate}
...
{/exp:channel:entries}

Does that clarify the situation? The first is literally just a description of the gallery. Each image in the “gallery” portion has 3 text fields that are associated with the image. So each image and text group creates an entry.

       
Boyink!'s avatar
Boyink!
5,011 posts
14 years ago
Boyink!'s avatar Boyink!

It’d be best to talk to Ian about the capabilities of taxonomy, but I can’t see how you can get EE’s pagination to work with URLs not showing what pagination needs to work.

Curious - what about using Matrix to hold all your images in one entry vs. putting them in another channel? Then you wouldn’t need two channel entries loops.

       
iain's avatar
iain
317 posts
14 years ago
iain's avatar iain

The ‘page’ at the top can use a pages module uri, but you’d need to ‘fix’ that into place with a hardcoded entry_id and dynamic=”off” because as soon as the pagination kicks in it’s going to kill your page uri.

The second tag can be dynamic simply with the show_pages=”no” parameter…

Does that solve your problem?

EDIT: My bad, actually the show_pages param not display_pages.

       
jwindhorst's avatar
jwindhorst
99 posts
14 years ago
jwindhorst's avatar jwindhorst

Thanks for chiming in iain but no in fact it did not fix it. At this point I’m thinking about rolling my own pagination using POST vars, it’s just annoying to me that such basic functionality is apparently missing.

If anyone else has any thoughts on the matter I would love to hear them.

       
Boyink!'s avatar
Boyink!
5,011 posts
14 years ago
Boyink!'s avatar Boyink!

You’ really just trying to use the system is a way that it wasnt designed to be used…:)

I’d either investigate using Matrix to store the images in the same channel so all of the content is available at the Pages URL, or ditch the Pages module so you can take advantage of the dynamic nature of the Channel Entries tag.

Most of EE’s tagset relies on getting information from the URL to know how to present content. The Pages Module nueters that ability-it was (IMHO) never intended to be used as the basis for an enter website, but rather as a solution for the odd “static” page here and there ( About, terms of use, etc).

3rd party folks have greatly extended it’s abilities past that initial thought, but I’d still be reluctant to build an entire site on the Pages Module.

       
jwindhorst's avatar
jwindhorst
99 posts
14 years ago
jwindhorst's avatar jwindhorst

In our case most of the pages are primarily static. As a dev team we aren’t owning the content though, and therefore don’t want to be responsible for the periodic changes to verbiage that the marketing department may want to make moving forward, thus the CMS. Using Taxonomy, which as far as I understand requires the pages module, saved us numerous hours in building out the 125 pages of content that we need.

All that being said, I can roll my own pagination with relative ease, I was just hoping the out of the box pagination would save me that headache this week as I facedown a pending deadline.

Thanks again for all your input though, and if anyone else comes up with a solution, I would still be interested in hearing it as we have numerous other projects in the pike that might run into the same problem.

       
Boyink!'s avatar
Boyink!
5,011 posts
14 years ago
Boyink!'s avatar Boyink!

Oh - I understand the desire for a CMS..😉

But I’d suggest (based on teaching many, many people EE) if you are still thinking of your site in terms of having to build “pages” and then worry about how to build navigation to those pages you haven’t fully grokked EE yet. EE is a post (or entry) based CMS, not a “page-based hierarchical” CMS. This is a paradigm shift that can be hard to get your head around if you’ve used other page-based, hierarchical CMS.

Here’s a primer I wrote trying to help explain the concept of what static content means in EE.

Some of my earliest tutorials were how to use EE to build sites with static content and dynamic navigation without the use of extra addons.

       
jwindhorst's avatar
jwindhorst
99 posts
14 years ago
jwindhorst's avatar jwindhorst

Actually I have read that primer. Our goal however was to have one CMS that would cover numerous projects. The one I am currently working on is almost entirely what you refer to as “Static Pages” and there are quite a few of them. Personally in working with CMS’s I prefer the terms Multiple Entry Pages (MEP) vs. Single Entry Pages (SEP) because all of the content in a CMS is dynamic by the very nature of the system. So and I trying to fit a square peg through a round hole? Yes! I was just hoping that someone had a jig saw to fix the problem.

Having looked at Matrix more closely however, I believe that you were correct in suggesting. Being new to EE2 it’s tough to keep up on which add-ons do what. Another reason for us going with EE was the community behind it though, so I suppose I should learn to listen to them better! 😉 Thanks for the help and follow ups though.

       
iain's avatar
iain
317 posts
14 years ago
iain's avatar iain

Whilst I agree partly about the paradigm shi(f)t, there’s no reason why you can’t mix pages and dynamic content.

Maybe if you post some simplified code of that template I can help you some more. I use dynamic paginated content on a page_uri all the time.

for example on http://northpower.com/news/ - the meta, page title, browser title, and page introduction are managed via a ‘page’ entry using a /news page uri, and the news items are all dynamic and using pagination.

       
jwindhorst's avatar
jwindhorst
99 posts
14 years ago
jwindhorst's avatar jwindhorst

I can share the code for the entire page if you want, but for now I’ll just share what appears relevant.

The single entry portion:

<div id="gallery-page-content">

        {exp:channel:entries channel="galleries" paginate="top"}
            {gallery_description}

            <ul id="gallery-filters">
                <li>
                    <input type="text" name="gallery_search" />
                    <input type="submit" name="gallery_search_submit" value="GO" />
                </li>
                <li><strong>{title} Filters</strong></li>
                <li><a>All</a></li>
                <li><a>Cover Design</a></li>
                <li><a>High School</a></li>
                <li><a>Middle School</a></li>
                <li><a>University</a></li>
            </ul>
            <?php $entry_id = '{entry_id}'; ?>
        {/exp:channel:entries}

And the multi-entry portion:

{exp:channel:entries channel="gallery-entry" limit="10" dynamic="no" paginate="top" }
                {if gallery == <?php echo $entry_id; ?>}
                    <div id="paging-wrapper">


                        {paginate}
                            {pagination_links}
                        {/paginate}
                    </div>
<div class="gallery-element">
                        <div class="gallery-inner-wrapper">
                            <a href="http://<?php" class="lightbox">_                                {image}_                            </a>
                            <ul>
                                {if image_description_1 != ''}
                                <li>{image_description_1}</li>
                                {/if}
                                {if image_description_2 != ''}
                                <li>{image_description_2}</li>
                                {/if}
                                {if image_description_3 != ''}
                                <li>{image_description_3}</li>
                                {/if}
                            </ul>
                        </div>
                    </div>
                    {/if}
            {/exp:channel:entries}

There is some PHP doing string manipulations in the dynamic section of the template as well, but I don’t see how that could be effecting the pagination.

Sorry about the indenting, that was all pasted from VIM.

       
iain's avatar
iain
317 posts
14 years ago
iain's avatar iain

I’ll post a reply to your code above when I get some time, but scanning the thread again I noticed this:

Using Taxonomy, which as far as I understand requires the pages module, saved us numerous hours in building out the 125 pages of content that we need.

That’s not the case. Taxonomy can work with the pages module, but it can also work with native templates too. For example the documentation section on my site is powered by a single template: software/docs/url_title. That contains ‘pages’ which are several levels deep and just uses the same url structure. It’s not using the pages module at all.

IMO it’s more the interface that needs to tell the user where they are, not the url.

I don’t get hung up about urls that don’t follow a user down a page tree, and most of the time I convince clients that they don’t need to be either. The pages module is useful but it’s not a defacto with me. I review on a case by case basis and sometimes it is the best option and sometimes it isn’t.

       
1 2

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.