title: Creating article pagination
body: <p>Hi I'm using silverstripe 2.4.7 and I'm having difficulty getting the pagination to work. I've created a function in my page.php to get the latest articles like so</p>
  
  <pre><code>function AllNewsPosts($num=1) { 
  $news = DataObject::get_one("NewsHolder"); 
  return ($news) ? DataObject::get("NewsEntry", "ParentID &gt; 0", "Date DESC", "", $num) : false; 
  }
  </code></pre>
  
  <p>Then when i put this function into the control and pagination tags one article shows up however the links to the concurrent articles do not work - essentially the pagination is not working and I'm not sure how to fix it  </p>
  
  <pre><code>&lt;% if AllNewsPosts %&gt;
          &lt;% control AllNewsPosts %&gt;
            &lt;div class="event"&gt;
             &lt;h2&gt;$MenuTitle |&lt;span class="date"&gt; $Date.Time $Date.Long&lt;/span&gt;&lt;/h2&gt;
             &lt;p&gt;$Content.FirstParagraph&lt;/p&gt;
              &lt;a href="$Link"&gt;See more about this event&lt;/a&gt;
            &lt;/div&gt;
          &lt;% end_control %&gt; 
          &lt;% else %&gt;
          &lt;div class="no-entry"&gt;'There are no entries'&lt;/div&gt;
          &lt;% end_if %&gt;
  
          &lt;% if AllNewsPosts.MoreThanOnePage %&gt;
    &lt;div id="PageNumbers"&gt;
      &lt;p&gt;
        &lt;% if AllNewsPosts.NotFirstPage %&gt;
          &lt;a class="prev" href="$AllNewsPosts.PrevLink" title="View the previous page"&gt;&lt;span class="yellow-background"&gt;Prev&lt;/span&gt;&lt;/a&gt;
        &lt;% end_if %&gt;
  
        &lt;span&gt;
            &lt;% control AllNewsPosts.PaginationSummary(0) %&gt;
            &lt;% if CurrentBool %&gt;
              &lt;span class="current"&gt;$PageNum&lt;/span&gt;
            &lt;% else %&gt;
              &lt;% if Link %&gt;
                &lt;a href="$Link" class="numbers" title="View page number $PageNum"&gt;$PageNum&lt;/a&gt;
              &lt;% else %&gt;
                &amp;hellip;
              &lt;% end_if %&gt;
            &lt;% end_if %&gt;
          &lt;% end_control %&gt;
        &lt;/span&gt;
  
        &lt;% if AllNewsPosts.NotLastPage %&gt;
          &lt;a class="next" href="$AllNewsPosts.NextLink" title="View the next page"&gt;&lt;span class="yellow-background"&gt;Next&lt;/span&gt;&lt;/a&gt;
        &lt;% end_if %&gt;
      &lt;/p&gt;
    &lt;/div&gt;
  &lt;% end_if %&gt;
  </code></pre>
  
  <p>Any help is much appreciated</p>