Create Pagination

Hey Fourm, 

The last couple of says I have hit a stump which I can't seem to figure out. I am trying to create a pagnation feature on my website.

What pagination looks like: http://cdn.onextrapixel.com/wp-content/uploads/2009/06/pagination.jpg

I am using Foundation 5 Pagination markup which is:
http://pastebin.com/B3EudwXp

I want to load 6 articles on every page. Every 6 articles I create will generate the next page number and add it to the list. I have been using Razor but I am struggling with this portion and would like some advice or links to point me to the right direction. I am still getting the hang of all this information but this would really help me move along.

Quick questions:
I see people using code like this -

foreach (var group in items.Children.InGroupsOf(3)) {
foreach (var item in group)  {
<li><a href="#">@item.Name</a></li>
 }
}

 


Instead of items, they use Model or Umbraco. Can someone explain or link me to why it seems I can only use Currentpage and nothing else?

Another question I have is in the code above, how can I generate three <a href="#">@item.Name</a> and then inject an <li> to surround all of them rather than having 3 <li><a href="#">@item.Name</a></li> seperate Li tags?

Thanks hopefully I can solve a few of these issues. 

 


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/53662-create-pagination