2

I'm working on a blog site that uses a base index file as a "driver", with embedded templates for all the important data. The embedded templates both have {exp:channel:entry} tags that display a certain # of blog entries. Each template is formatted differently per the certain # of blog entries being shown, as I wanted the last four entries to look different than the first four.

The issue I'm having with pagination is that in the index files {exp:channel:entry} tag, I've set the limit to 1, and now it's giving me 10 pages worth of results (which is the total # of entries I have), but what I really want is just normal pagination that shows eight entries per page, formatted as I normally do.

Here's the relevant code:

<? //Formats article page w/ embedded EE variables. ?>

{embed="home/header" page-title="Lean Articles"}
{embed="resources/subhead"}

<? //Container for multiple blog articles, 700px wide defined by Grid system. ?> 

{embed="a_update/article-nav"}

{if segment_2 == "" || segment_2 == "category" || segment_2 == "P1"}

    <span class="rightcol-700">

<?//Embed main and side content for Homepage section of site.?>

{exp:channel:entries channel="aupdate" limit="1" paginate="bottom" orderby="desc" dynamic="off"}
    {embed="a_update/.hidden_main_content"}
    {embed="a_update/.hidden_side_content"}

       {paginate}
              <p id="pagination">Page {current_page} of {total_pages} pages {pagination_links}</p>
      {/paginate} 

{/exp:channel:entries}

    </span>
</div>
  • 1
    Is this not just limit="8", or am I missing something? – Dave Forber Sep 24 '13 at 20:09
1

It would be, but within those embeds are channel entry tags that have each display a limit of 4, with different styling, such as:

<div style="width:400px;float:left;padding-right: 30px; border-right:solid 1px #3e3e3e">
    {exp:channel:entries channel="aupdate" limit="4"}
                    <div style="font-size:14px;color:#2b637e;font-weight:bold;line-height:1.2em">
                        <a href="{site_url}/a_update/{url_title}" style="text-decoration: none;">{title}</a>
                    </div>
    <?//Article date token, taken from Date field in Article channel. ?>
                    <div style="font-size:11px;color:#959190;line-height:1.6em">
                        {entry_date format="%F %d, %Y"}
                    </div>
    <?//Article Banner Image.?>
                    <div>
                        {exp:ed_imageresizer image="{article_image}" maxWidth="200px" maxHeight="80px" class="banner_image"}{/exp:ed_imageresizer}
                    </div>

     <?//Article summary token, taken from Summary field in Article channel. ?>
                    <p>{article_summary}</p>                        
                    <div>
                        [ <a href="{site_url}/a_update/{url_title}">read more</a> ]
                    </div>
                    <br clear="all">
                    <hr>
    {/exp:channel:entries}
</div>

And the second embed:

{exp:channel:entries channel="aupdate" limit="4" offset="4"}

<div style="width:165px;float:left;padding-left:30px;">
        <div style="font-size:12px; color: black;font-weight: normal;">
            <p><a href="{site_url}/a_update/{url_title}">{title}</a></p>
        </div>  
        <div style="font-size:11px;color:#959190;line-height:1.6em">
            {entry_date format="%F %d, %Y"}
        </div>
        <p>{article_promo}</p>
        <hr>
</div>

{/exp:channel:entries}

So if I set the limit to 8, what happens is that it returns all my results squared, effectively, displaying way too many results/duplicates on the screen.

| improve this answer | |
0

Sounds like you just need to change limit="1" to limit="8" on your channel:entries tag unless I'm missing something.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.