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.

limit parameter returning no entries

August 07, 2012 1:30pm

Subscribe [1]
  • #1 / Aug 07, 2012 1:30pm

    srevoal

    14 posts

    very stumped.

    {exp:channel:entries channel="body" dynamic="no" orderby="title" sort="desc"}

    works fine. returns all entries.

    {exp:channel:entries channel="body" dynamic="no" orderby="title" sort="desc" limit="5"}

    returns nothing. I’m not sure what’s going on. Here’s the full code:

    <div class="clear lightgrey_div">/div>
    <div class="clear green_div">/div>
    <div class="darkgrey_div footer t4">
          <div> 
              <div class="whitetext left">
                  <a href="/index.php/main/about-us/">_      about_     </a>
         <ul>
         {exp:channel:entries channel="body" dynamic="no" }
          {if footer_submenu=="About"}
           <li>
            <a href="/index.php/main/{url_title}/">_         {title}_        </a>
           </li>
          {/if}
          {/exp:channel:entries}
         </ul>
              </div>
              
              <div class="whitetext left ">
                  <a href="/index.php/main/our-wines/">_      wines_     </a>
         <ul>
         {exp:channel:entries channel="body" dynamic="no" orderby="title" sort="desc" limit="5"}
          {if footer_submenu=="Wines"}
           <li>
            <a href="/index.php/main/{url_title}/">_         {title}_        </a>
           </li>
          {/if}
          {/exp:channel:entries}
         </ul>
              </div>
              
              <div class="whitetext left ">
                  <a href="/index.php/main/events/">_      events_     </a>
         <ul>
         {exp:channel:entries channel="body" dynamic="no" }
          {if footer_submenu=="Events"}
           <li>
            <a href="/index.php/main/{url_title}/">_         {title}_        </a>
           </li>
          {/if}
          {/exp:channel:entries}
         </ul>
              </div>
              
              <div class="whitetext left ">
                  <a href="/index.php/main/trade-media/">_      trade/media_     </a>
         <ul>
         {exp:channel:entries channel="body" dynamic="no" }
          {if footer_submenu=="Trade Media"}
           <li>
            <a href="/index.php/main/{url_title}/">_         {title}_        </a>
           </li>
          {/if}
          {/exp:channel:entries}
         </ul>
              </div>
              
              <div class="whitetext left textright">
                  <div>
                      search box
                  </div>
                  <div class="clear"></div>
                  <div class="greentext  t3">
                      <a href="#">_      About_     </a>
           | 
         <a href="#">_      Wines_     </a>
           | 
         <a href="#">_      Events_     </a>
            | 
         <a href="#">_      Wine Club_     </a>
            | 
         <a href="#">_      Trade/Media_     </a>
            | 
         <a href="#">_      Shop_     </a>
            | 
         <a href="#">_      Contact_     </a>
                      
    
                      Sweet Cheeks Winery 2012. All Rights Reserved.
                      
    
                      1-877-309-WINE (9463) or 1-541-349-WINE (9463)
                      
    
                      
    
                    <a href="#" target="_blank" rel="noopener">_      Like us on Facebook_     </a>
           | 
         <a href="#" target="_blank" rel="noopener">_      Follow us on Twitter_     </a>
                  </div>
              </div>
              
              <div class="clear"></div>
              
              <div class="whitetext  left">
                  <a href="/index.php/main/wine-club/">_      wine club_     </a>
              </div>
              
              <div class="whitetext left ">
                  <a href="/index.php/main/contact-us/">_      contact_     </a>
              </div>
              
              <div class="whitetext left t_5">
                  <a href="#">_      shop_     </a>
              </div>
              <div class="clear"></div>
          </div> 
      </div>
  • #2 / Aug 07, 2012 1:49pm

    srevoal

    14 posts

    never mind. figured it out. if anyone else stumbles across this, the solution is as follows.

    <ul>
         {exp:channel:entries channel="body" dynamic="no" orderby="title" sort="desc" limit="5"}
          {if footer_submenu=="Wines"}
           <li>
            <a href="/index.php/main/{url_title}/">_         {title}_        </a>
           </li>
          {/if}
          {/exp:channel:entries}
         </ul>

    doesn’t work because it loops through the first 12 body channel entries based on name. if foot_submenu doesn’t = wines, non of them will display. the desired behavior was to display the first 12 where footer_submenu = wines. because that field is a dropdown, I can use:

    <ul>
       {exp:channel:entries channel="body" search:footer_submenu="Wines"  orderby="title" sort="desc" dynamic="no" limit="8"}
          <li>
       <a href="/index.php/main/{url_title}/">_      {title}_   </a>
          </li>
       {/exp:channel:entries}
    </ul>

    this is also a very good method for making css menus on the fly btw. particularly functional with the playa module. you can make dynamic drop downs with several tiers this way.

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

ExpressionEngine News!

#eecms, #events, #releases