Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: Article Manager 2:
Pagination with numbers

 

 


nkerschgens
User

Apr 3, 2008, 6:10 AM

Post #1 of 11 (5260 views)
Shortcut
Pagination with numbers Can't Post

Hi,

Is it possible to create a pagination with numbers like:

< previous | 1 | 2 | 3 | 4 | next >

now i have this:


Code
<div id="pagination"> 
<!-- templateIf : $articleList.prevPageNumber$ ne "" -->
<div class="prev">
<a href="$settings.searchurl$?action=search&amp;page=$articleList.prevPageNumber$&amp;perpage=$articleList.perpage$&amp;template=$articleList.template$&amp;includeSubcats=$articleList.includeSubcats$&amp;categoryNum=$category.num$" name="Previous page">&lt;&lt; previous page</a>
</div>
<!-- /templateIf -->

<!-- templateIf : $articleList.nextPageNumber$ > $articleList.thisPageNumber$ -->
<div class="next">
<a href="$settings.searchurl$?action=search&amp;page=$articleList.nextPageNumber$&amp;perpage=$articleList.perpage$&amp;template=$articleList.template$&amp;includeSubcats=$articleList.includeSubcats$&amp;categoryNum=$category.num$" name="Next page">next page &gt;&gt;</a>
</div>
<!-- /templateIf -->
</div>



Jake
Staff / Moderator


Apr 4, 2008, 2:51 PM

Post #2 of 11 (5238 views)
Shortcut
Re: [nkerschgens] Pagination with numbers [In reply to] Can't Post

Hi nkerschgens,

This can be accomplished, but it takes a fair amount of work.

Basically, what you need to do is create a new publishing rule for each potential page of results. Each of these rules will be 'clones' of one another, except they will each have a different set of numbers entered into the "Limit Results" publishing rule setting (ie. 1-10, 11-20, and so on) and will use different placeholder set names. You would also need to use custom templates for each one of these publishing rules so that you can create next and previous links that reference the custom placeholder set names for each page. To only display the pertinent page links you would also need to code several templateIf statements to show or hide each page's link as necessary.

Let us know if you have any other questions about this. Smile
-----------------------------------------------------------
Cheers,
Jake Swanson - Product Specialist
support@interactivetools.com


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.



jublack2000
User

Jun 18, 2008, 10:26 PM

Post #3 of 11 (5100 views)
Shortcut
Re: [Jake] Pagination with numbers [In reply to] Can't Post

Hi Jake,

Hope all is well. This is actually something I'm trying to accomplish... so I was wondering if you could elaborate on the coding that would be needed. I understand the 1st part... i.e. I've created separate publishing rules for the each category page and created clone templates for each rule.

1. What I'm unclear about is the coding to use for the template ifs statments that will link the index pages together (prev | 1 | 2 | 3 | next).

2. The second thing I was wondering is what kind of code I would use to generate a statement like "1-10 of x articles displayed", then on category index 2 it would say "11-20 of x articles displayed". So far I've got a statement like this:

"Displaying 1 - 10 of <?php include('$published.numberOfArticles.filepath$'); ?> articles"

It's the "1-10" part that I'm not sure how to generate that dynamically.

Thanks for your help!

Juliana


Jake
Staff / Moderator


Jun 19, 2008, 12:23 PM

Post #4 of 11 (5084 views)
Shortcut
Re: [jublack2000] Pagination with numbers [In reply to] Can't Post

Hi Juliana,

Thanks for posting. Smile

Firstly, you will need to create a different template file for each page of results. To get the page links to display as required, you would need to use some templateIf's like this on your first page template:


Code
1  

<!-- templateIf: $articlelist.totalresults$ > "10" -->
| <a href="$published.categoryIndexPage2.url$">2</a>
<!-- /templateIf -->

<!-- templateIf: $articlelist.totalresults$ > "20" -->
| <a href="$published.categoryIndexPage3.url$">3</a>
<!-- /templateIf -->

<!-- templateIf: $articlelist.totalresults$ > "30" -->
| <a href="$published.categoryIndexPage4.url$">4</a>
<!-- /templateIf -->

etc.


Your second page's template would need the above code modified like this, to hide the page 2 link since that's the page that the user is currently on, and to display the link for the first page:


Code
<a href="$published.categoryIndexPage1.url$">1</a>  

| 2

<!-- templateIf: $articlelist.totalresults$ > "20" -->
| <a href="$published.categoryIndexPage3.url$">3</a>
<!-- /templateIf -->

<!-- templateIf: $articlelist.totalresults$ > "30" -->
| <a href="$published.categoryIndexPage4.url$">4</a>
<!-- /templateIf -->

etc.


So you'll need to make similar adjustments for each page's template. TemplateIf's are't required for pages that precede the current page's template, since it can be assumed that those pages do exist.

To create the "Displaying 1 - 10 of X articles" is a bit trickier, since you don't want to display a message that says "Displaying 11-20 articles of 15". You need to use two different templateIf's to get this to work correctly, and you'll need to change this code slightly for each different page's template. Here's what you'd use on the page one template:


Code
<!-- templateIf: $articlelist.totalresults$ < "10" --> 
Displaying articles 1-$articlelist.totalresults$ of $articlelist.totalresults$
<!-- /templateIf -->

<!-- templateIf: $articlelist.totalresults$ > "10" -->
Displaying articles 1-10 of $articlelist.totalresults$
<!-- /templateIf -->


On your page two template, the code needs to be adjusted like this:


Code
<!-- templateIf: $articlelist.totalresults$ < "20" --> 
Displaying articles 11-$articlelist.totalresults$ of $articlelist.totalresults$
<!-- /templateIf -->

<!-- templateIf: $articlelist.totalresults$ > "20" -->
Displaying articles 11-20 of $articlelist.totalresults$
<!-- /templateIf -->


As above, you'll need to make minor adjustments to that code for each subsequent page of results.

I realize that this is a bit complicated, so if you have any more questions about this or have trouble setting it up, let me know and I'll lend a hand!
-----------------------------------------------------------
Cheers,
Jake Swanson - Product Specialist
support@interactivetools.com


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.



jublack2000
User

Jun 20, 2008, 4:30 PM

Post #5 of 11 (5073 views)
Shortcut
Re: [Jake] Pagination with numbers [In reply to] Can't Post

Thanks Jake! This all makes sense... I will give it a try and let you know how it goes.

I was wondering if there is a way for me to know all the different placeholders that can be used in template if statments... like "$articlelist.totalresults$".... i've never seen that one before.

I'm familiar with all the placeholders that appear by default in the templates, but it would be nice if there was a manual or a way to know about these less common ones and what they mean... anything like that hiding somewhere?

Thanks again!

Juliana


Jake
Staff / Moderator


Jun 21, 2008, 1:27 PM

Post #6 of 11 (4822 views)
Shortcut
Re: [jublack2000] Pagination with numbers [In reply to] Can't Post

Hi Juliana,

There is actually a way to see all of the placeholders available on any given page on your site. Just add this line of code to your template file and publish the corresponding page:

<!-- templateplaceholderlist -->

You won't want to do that on a live site, since it will display a large table contains every placeholder and its value for that page, but it's really handy when you're trying to set up templateIf's or create display other information on your pages.

I hope that helps!
-----------------------------------------------------------
Cheers,
Jake Swanson - Product Specialist
support@interactivetools.com


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.



carminejg3
User

Aug 7, 2008, 2:12 PM

Post #7 of 11 (3533 views)
Shortcut
Re: [Jake] Pagination with numbers [In reply to] Can't Post

Hi Jake, Great post....

Do I understand this right. I would basically need to copy my articleList.html page template once for each page I want to create? So in this example, I would have 10 articlelistpages, like articleList1.html, articleList2.html and so on. Then each of these pages would need a publishrule one for each page number?

It does seem like a lot of work, but... the final results would be seo urls through the cat index so it would pay off in the long run.


Webmaster Wink
http://news.carjunky.com


Donna
Staff / Moderator


Aug 8, 2008, 11:45 AM

Post #8 of 11 (3432 views)
Shortcut
Re: [carminejg3] Pagination with numbers [In reply to] Can't Post

Hi there!

That's right -- however, it's easier than you'd think. The changes made on each template & publish rule are miniscule, so you're mostly just making copies. :)

Donna


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.


carminejg3
User

Aug 8, 2008, 2:51 PM

Post #9 of 11 (3284 views)
Shortcut
Re: [Donna] Pagination with numbers [In reply to] Can't Post

works great after I copied the Category Index page and modified a few feilds.

One question. Is there a way to prevent this from buildin a page fro every Category page? I noticed it built pages 1-10 for categories that only had say 10 articles. It doesnt link to them but built them. So every category now has 10 pages.

Could we change this or is it a part of the process?


Webmaster Wink
http://news.carjunky.com

(This post was edited by carminejg3 on Aug 8, 2008, 2:53 PM)


Jake
Staff / Moderator


Aug 10, 2008, 2:20 PM

Post #10 of 11 (2953 views)
Shortcut
Re: [carminejg3] Pagination with numbers [In reply to] Can't Post

Hi carminejg3,

The way this is set up means that all of those pages have to be created - there's no way to stop that from happening, since Article Manager was not really designed with this type of pagination in mind.

Let us know if you have any other questions. Smile
-----------------------------------------------------------
Cheers,
Jake Swanson - Product Specialist
support@interactivetools.com


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.



carminejg3
User

Aug 10, 2008, 4:22 PM

Post #11 of 11 (2946 views)
Shortcut
Re: [Jake] Pagination with numbers [In reply to] Can't Post

Thanks Jake, this workaround does the job. The lack of pagination is actually not good since once your category hits a certain size your articles will drop out of the seach engines cause they wont be able to locate them. I have our pages showing 100 articles on each index just to counter the lack of pagination. BUT, this is one example of the power of artman2 since with this simple change I now can get about 1000 articles back into the serps.

What we are setting up with your example is 10 pages each with 100 articles per page. I have disabled the last 3 since i don't need then yet and went through the categories and only include the category's with articles over each mark. This has cut down from me getting an extra 400 plus pages.

To only using pages 2-10 on the cats that have several hundred articles.


Webmaster Wink
http://news.carjunky.com

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4