ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Limiting entries to a page

November 08, 2007 3:56pm

Subscribe [2]
  • #1 / Nov 08, 2007 3:56pm

    wizzbang

    17 posts

    What is the coding required to limit page length, and then automatically start a new page (basically 1,2,3 pagination)? I’m new to this, as you can guess

  • #2 / Nov 08, 2007 7:32pm

    ruraldreams

    279 posts

    See here

    There’s also a plugin, I believe, that lets you use a single field and insert code where you want the page breaks to happen.

  • #3 / Nov 08, 2007 8:23pm

    wizzbang

    17 posts

    thanks for that. The thing is, I can’t see how to state the required length of each page. I’m designing a shop site, and want to limit each page to, say, 10 items including a thumbnail

  • #4 / Nov 08, 2007 8:35pm

    ruraldreams

    279 posts

    That’s the wrong docs page for that - try this one.

    Set limit= to however many items you want to appear on each page.

  • #5 / Nov 09, 2007 9:35am

    wizzbang

    17 posts

    hi
    well, I’ve tried working out where exactly the code should be placed, and exactly which parts of the code, but all results I get don’t work. Any halp appreciated. This is the code I’m trying to add it to. Thanks

    {embed="building_series_embeds/html_header" my_page_title="Ch. 12 Products List{exp:weblog:category_heading weblog="bees_products"} | {category_name}{/exp:weblog:category_heading}”}
    <body>
      <div id=“content”>
          {embed="building_series_embeds/logo_title"}
          {embed="building_series_embeds/main_nav" my_location="products"}
          {embed="building_series_embeds/search_section_intros" the_url_title="products"}
           
          <div id=“maincontent”>
            <div id=“right_side”>
              {embed="building_series_embeds/latest_news"}
              {embed="building_series_embeds/latest_products"}
            </div><!—close right_side—>

            <div id=“left_side”>

              {exp:weblog:category_heading weblog="bees_products"}

    {category_name}

                  {if category_description}
                    {category_description}
                  {/if}

              {/exp:weblog:category_heading}

              {exp:weblog:entries weblog="bees_products" disable="member_data|trackbacks" orderby="title" sort="asc"}
       
                  <h2 class=“underline”>{title}</h2>
              {product_thumbnail}
                  {product_description}

                  View Product Details >>

                  <div [removed]></div>
                 
              {/exp:weblog:entries}
             
            </div><!—close left side div—>
     
          </div><!—close main content div—>
     
          {embed="building_series_embeds/footer"}
           
      </div>  <!—close content div—>
      </body>
    </html>

  • #6 / Nov 09, 2007 10:12am

    ruraldreams

    279 posts

    There’s nothing in that code about pagination.  In your weblog entries tag you need a limit parameter and a paginate parameter.  Then you need some paginate tags that indicate the type of pagination links that you want.

  • #7 / Nov 09, 2007 10:22am

    wizzbang

    17 posts

    no, I know. I removed it. I used the first code, found here: http://expressionengine.com/docs/modules/weblog/pagination_page.html
    but my rendered page either showed code or had an altered appearance. What I posted previously was the page before I added any pagination code to it

  • #8 / Nov 09, 2007 2:52pm

    wizzbang

    17 posts

    please find below just one of the possibililties I’ve tried without luck. This limits entries to 10 per page, but it also displays code in the page that shouldn’t be there.

    {embed="building_series_embeds/html_header" my_page_title="Ch. 12 Products List{exp:weblog:category_heading weblog="bees_products"} | {category_name}{/exp:weblog:category_heading}”}
    <body>
      <div id=“content”>
          {embed="building_series_embeds/logo_title"}
          {embed="building_series_embeds/main_nav" my_location="products"}
          {embed="building_series_embeds/search_section_intros" the_url_title="products"}
           
          <div id=“maincontent”>
            <div id=“right_side”>
              {embed="building_series_embeds/latest_news"}
              {embed="building_series_embeds/latest_products"}
            </div><!—close right_side—>

            <div id=“left_side”>{exp:weblog:entries weblog="bees_products" orderby="date" sort="desc" limit="10" paginate="bottom"}
           

    {category_name}

                  {if category_description}
                    {category_description}
                  {/if}

              {/exp:weblog:category_heading}

              {exp:weblog:entries weblog="bees_products" disable="member_data|trackbacks" orderby="title" sort="asc"}
       
                  <h2 class=“underline”>{title}</h2>
              {product_thumbnail}
                  {product_description}

                  View Product Details >>

                  <div [removed]></div>
    {multi_field="page1|page2|page3|page4"}

    {paginate}
    Page {current_page} of {total_pages} {pagination_links}
    {/paginate}

                 
              {/exp:weblog:entries}
             
            </div><!—close left side div—>
     
          </div><!—close main content div—>
     
          {embed="building_series_embeds/footer"}
           
      </div>  <!—close content div—>
      </body>
    </html>

  • #9 / Nov 09, 2007 3:02pm

    ruraldreams

    279 posts

    {exp:weblog:entries weblog="bees_products" orderby="date" sort="desc" limit="10" paginate="bottom"}
    
    <h3>{category_name}</h3>
    
    <p>{if category_description}<br />
    <i>{category_description}</i><br />
    {/if}</p>
    
    <p>{/exp:weblog:category_heading}

    Your tags are mismatched here - you want the opening to be the category heading tag - and you want limit and paginate in the weblog entries tag that follows this.

  • #10 / Nov 10, 2007 7:05pm

    wizzbang

    17 posts

    I’ve updated the code, and it’s almost there, apart from

    | LP”}

    appearing in the rendered page. I’m not sure how to eliminate that. Can you see what I’m doing wrong now? Thanks

    {embed="building_series_embeds/html_header" my_page_title="Ch. 12 Products List"}
    <body>
      <div id=“content”>
          {embed="building_series_embeds/logo_title"}
          {embed="building_series_embeds/main_nav" my_location="products"}
          {embed="building_series_embeds/search_section_intros" the_url_title="products"}
           
          <div id=“maincontent”>
            <div id=“right_side”>
              {embed="building_series_embeds/latest_news"}
              {embed="building_series_embeds/latest_products"}
            </div><!—close right_side—>

            <div id=“left_side”>

              {exp:weblog:category_heading weblog="bees_products"}

    {category_name}

    {exp:weblog:category_heading weblog="bees_products"} | {category_name}{/exp:weblog:category_heading}”}

                  {if category_description}
                    {category_description}
                  {/if}

              {/exp:weblog:category_heading}

              {exp:weblog:entries weblog="bees_products" disable="member_data|trackbacks" orderby="title" sort="desc" limit="10" paginate="bottom"}
       

                  <h2 class=“underline”>{title}</h2>
              {product_thumbnail}
                  {product_description}

                  View Product Details >>

                  <div [removed]></div>
                  {multi_field="page1|page2|page3|page4"}

    {paginate}
    Page {current_page} of {total_pages} {pagination_links}
    {/paginate}


              {/exp:weblog:entries}
             
            </div><!—close left side div—>
     
          </div><!—close main content div—>
     
          {embed="building_series_embeds/footer"}
           
      </div>  <!—close content div—>
      </body>
    </html>

  • #11 / Nov 10, 2007 7:11pm

    ruraldreams

    279 posts

    It’s here I think -

    {exp:weblog:category_heading weblog="bees_products"} | {category_name}{/exp:weblog:category_heading}"}

    remove the bracket and quote at the end.

  • #12 / Nov 10, 2007 7:21pm

    wizzbang

    17 posts

    just tried that. Now I get

    | LP (or other category heading)

    in the rendered page

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases