MainDoctor WhoMusicSoftware
Main Page

Alden Bates' Weblog

Feigning normality since 1973

Paged Archives v1.31

Filed in: Movable Type.

Wow, I can't believe it's nearly nine months since the last PagedArchives update.

This version adds two parameters to the MTPASettings tag, and three new tags.

<MTPASettings numofentries="NN"> - PagedArchives does its best to work out how many entries there are on the archive page which it's splitting up. Sometimes it gets the count wrong, usually when the <MTEntries> tag has extra arguments to it. E.g., if you have <MTEntries limit="100">, you could specify <MTPASettings numofentries="100">. You can also use MT tags in the argument, such as <MTPASettings numofentries="<mt:EntriesCount />">

<MTPASettings pagelistlimit="NN"> - Normally <MTPAPageList> will just display a list of all the pages like "1 2 3 4 5 6 7 8 9 10", but if you specify a pagelistlimit of, for instance, 5, it will only display the current page number and two pages to either side (As in our example "... 3 4 5 6 7 ..."). Naturally if you're at the start of the list, you'll get the first five pages: "1 2 3 4 5 ...".

<MTPAFirstPage>, <MTPALastPage> - These work in the same way as <MTPANextPage> and <MTPAPreviousPage>, but create links to the first and last pages in the sequence, respectively.

<MTPAEntryExtra entrynumber="NN">Some HTML goes in here</MTPAEntryExtra> - When used within the <MTEntries> tag, this will limit the contained HTML to only appear on the NNth entry on each page. For instance, if you want your Google adverts to appear after the first entry on each page, you could slip in a <MTPAEntryExtra entrynumber="1">(Advert HTML)</MTPAEntryExtra> before the closing </MTEntries>. Note: this currently only works if there are no line breaks in the enclosed HTML.

I think that covers all the changes! As always, you can download PagedArchives on the Paged Archives page.

[Edit: as first published the first argument was erroneously listed as "entrycount" which it should have been "numofentries". My apologies for any problems caused.]

Posted March 4, 2008 8:08 PM

Comments

I'm sure this all means something to smart people, but it's...ah, it's just gibberish to me, man. :)

Posted by: Jeff Stone | March 4, 2008 10:27 PM

Great job Alden

I'm already using these features for some time, but I'm delighted to see they are part of the official plugin

Just had to confirm to a job that I'm doing that you will support MTPAEntryExtra on your plugin

Very glad all these functions are up :)

Posted by: Mihai Bocsaru | March 5, 2008 11:01 PM

We are trying to pull entries from a specific category on the index page, but are having problems limiting the number of pages. Say there are 100 entries in the blog, but only 20 of them from the category we are pulling. Even if we specify entrycount="20" it still creates 10 pages (at 10 entries per page) instead of 2 pages, and it just repeats the entries across them. Why would this be the case? No matter what we put in entrycount (it is at the top of the page) it doesn't change the number of pages. Any ideas?

Posted by: Jay | April 23, 2008 1:09 PM

I have the same problem that Jay... Please, any solution?

Posted by: Miguel | May 10, 2008 9:55 PM

The readme.txt file erroneously states that the argument for MTPASettings is called "entrycount" but it is actually "numofentries" as per the online copy of the documentation.

Posted by: Alden Author Profile Page | May 10, 2008 10:02 PM

Fantastic plugin Alden :-)

Only one little problem under MT4 : it works fine for the main index and archives, except for the category archive :

http://www.benoa.net/blog/business-travel/

Oddly enough the category-monthly archive works fine...

Any idea what is wrong ?

Posted by: Benoist | May 12, 2008 8:48 PM

do you test it on mt4.12 os, dose it work?

Posted by: Pouya | August 1, 2008 2:37 AM

This blog is running 4.12, and the plugin works fine on it.

Posted by: Alden Author Profile Page | August 1, 2008 8:29 AM

Hi, first of all congrats because the plugin is great. Although I've got a problem with it. My blog index excludes some categories because I am using them to build another section. How could I modify the plugin in order to exclude these categories from the pagination?
Thanks

Posted by: retroriff Author Profile Page | August 22, 2008 10:07 PM

Without knowing more about your setup, I'm not sure. If the other categories are using different templates, you can simply leave the tags out.

Posted by: Alden Author Profile Page | August 22, 2008 10:38 PM

Hi Alden, this is my entry tag code:

<MTEntries category="NOT Citas AND NOT Jukebox">
Content
</MTEntries>
<MTPAEnd>
<MTInclude module="Pagination">

However Paged Archives builds more pages on the index because it is contiung theses excluded categories. I guess <MTPAPageCount> is not receiving the right value :(

Posted by: retroriff Author Profile Page | August 24, 2008 9:16 PM

Oh, I see! You can fix that using the numofentries parameter on the MTPASettings as described in my post above.

I think you can use <mt:EntriesCount category="NOT Citas AND NOT Jukebox">, but the documentation isn't clear.

Posted by: Alden Author Profile Page | August 24, 2008 10:33 PM

Thanks Alden! It was enough with:

<MTPASettings numofentries="<mt:EntriesCount />">

:)

Posted by: retroriff Author Profile Page | August 25, 2008 8:02 PM

Hi Allen, I've got another question. I've got a code on my index to display a class on the first entry:

class="heading"

This conditional currently is only working on the index. It doesn't work on the next index pages such as index2.php.

Any suggestion?

Thanks

Posted by: retroriff Author Profile Page | August 27, 2008 9:08 PM

Retroriff: try:
<div <MTPAEntryExtra entrynumber="1">class="heading"</MTPAEntryExtra > >

Not sure if you can nest tags like that, but it's worth a try. :)

Posted by: Alden Author Profile Page | August 27, 2008 10:14 PM

Mr.

Please give me advice.
In using this plugin on a index template,I find a difficult to select divided page no.1.

I already use an index template(index.html).
I made a new index template(entries_all.html) which I tried to divide into some pages.
I succeeded to divide entries_all.html into 4 pages.But when in the page No.2(entries_all2.html) the link to previous page was "index.html" (not "entries_all.html").

The following is the html source of sellecting navigation of page No1 ,No2, No3, No4, respectively.
(No.1)
<<previous_page/this_page<strong>1</strong>/<a href="entries_all2.html" rel="next">next_page>></a>
(N0.2)
<a href="/blog/news-topics/" rel="prev"><<previous_page</a>/this_page<strong>2</strong>/<a href="entries_all3.html" rel="next">next_page>></a>
(No.3)
<a href="entries_all2.html" rel="prev"><<previous_page</a>/this_page<strong>3</strong>/<a href="entries_all4.html" rel="next">next_page>></a>
(no.4)
<a href="entries_all3.html" rel="prev"><<previous_page</a>/this_page<strong>4</strong>/next_page>>

looking at (No.2),url of the "previous_page" is "/blog/news-topics/" which indicates the index.html I already make past day.

Please tell me how to make correct source to return "entries_all.html" which is the page No.1 after dividing.

Posted by: Minoru Nakamura | September 23, 2008 1:17 PM

Sorry, the plugin assumes that the first page is index.html. This will be fixed in a later version.

Posted by: Alden Author Profile Page | September 23, 2008 5:08 PM

Mr.
Thank you.
Does it mean we can not control by HTML coding on deviding index template?

Posted by: Minoru Nakamura | September 23, 2008 10:59 PM

I'm sorry, I don't know what you mean by that.

Posted by: Alden Author Profile Page | September 24, 2008 11:48 AM

Yay! It works in MT4.21 as well. First I thought it wouldn´t be working because the MTEntry Tags look so different now but luckily I came here to look it up and saw the new version and took the chance to pick it up. And I didn´t knew it would work on categories too before and did that too.

Thanks for the great plugin.

Posted by: Elisa Author Profile Page | September 27, 2008 7:58 AM

Hi again, I've detected that the plugin is counting the excluded categories. This issue was fixed when you suggested me to add <MTPASettings numofentries="<mt:EntriesCount />">. However it is not working anymore, probably because of the 4.2 version? Any suggestion?
Thank you.

Posted by: retroriff Author Profile Page | October 2, 2008 9:22 PM

I don't know of any changes that would affect that. Did it stop working when you upgraded MT?

Posted by: Alden Author Profile Page | October 2, 2008 9:37 PM

I'm not sure 4.2 has affected it because I don't know exactly when it stopped working.

Posted by: retroriff Author Profile Page | October 3, 2008 11:54 PM

OK, I'm going to look at doing a better way of working out how many entries are on the page, probably by counting them myself. :)

Posted by: Alden Author Profile Page | October 4, 2008 8:42 AM

Hi Alden,

Great plugin, works with 4.21 using older 3.5 templates. How can I style this? I want to use the flickr style

the code would look something like this when published, just not sure how to add it to the template.

<div class="pagination"><span class="disabled">&#9668;</span>
<span class="current">1</span>
<a href="page=2">2</a>
<a href="page=3">3</a>
<a href="page=4">4</a>
<a href="page=5">5</a>
<a href="page=6">6</a>
<a href="page=7">7</a>...
<a href="page=199">199</a>
<a href="page=200">200</a>
<a href="page=2" class="next">&#9658;</a>
</div>

I'm using the code on the category page. Any help would be great.

Thanks
Toni

Posted by: Toni Author Profile Page | October 8, 2008 12:28 AM

Hi Toni

You can wrap the code in a div like so:
<MTPAIfMultiplePages><div class="pagination"><MTPAPreviousPage show="1" text="&#9668;"> <MTPAPageList> <MTPANextPage show="1" text="&#9658;"></div></MTPAIfMultiplePages>

Posted by: Alden Author Profile Page | October 8, 2008 7:38 AM

Thank you Alden,

It worked beautifully. I added classes to the previous and next tags, and changed the span class current to b in the stylesheet and it overrode the bold and gave me the colour I wanted for the current page.

http://www.bestoday.com.au/wind/archives/family/index3.php for an example.

I'll use it on more than the category pages now that I know I can style it however I like. There's some great examples of styling at http://www.mis-algoritmos.com/2007/03/16/some-styles-for-your-pagination/

Posted by: Toni Author Profile Page | October 8, 2008 8:39 PM

Cool! Good to hear :)

Posted by: Alden Author Profile Page | October 8, 2008 9:36 PM

I tried installing this on MT 4.21 I been getting a syntax error: unrecognized tag 'mtpaentry'(Smarty_Compiler.class.php line 580) any idea?

This is the code I'm using on the main index:
...

<MTEntries>
<MTPAEntry>
<$MTEntryTrackbackData$>
<$MTInclude module="Entry Summary"$>
</MTEntries>
<MTPAEnd>

...

Posted by: Tom | October 17, 2008 9:04 AM

Tom: As mentioned on the paged archives page, the plugin doesn't work for dynamic publishing.

Posted by: Alden Author Profile Page | October 17, 2008 10:48 AM

Note that this plugin doesn't work when using MTOptimizeHTML.

Posted by: Patrick | October 27, 2008 2:40 PM

Hi Alden.

I have been using this plugin since MTPC but after a move to a new server (same host but from FreeBsD to Linux and Apache 2 and Perl version: 5.8.8, ) it kills my website. I has taken me 2 weeks to figure out what is going on (I refreshed and all worked then I added my changes one by one and it all stopped working, today I did it in a different way and voila it is MTPA and when I removed the MTPA settings from the category template it only gives 500 server error sometimes. I still have the PCA code on the monthly and yearly archives and I really need to get it working on the category again but I just do not know how to get passed the errors it renders.

Have you got any idea as to how get passed this and I am not using dynamic publishing and I have the latest of mt, 4.21 PRO.

Thanks in advance.

//Carina

Posted by: Carina Author Profile Page | November 3, 2008 3:15 AM

Hrm, not sure, Carina. I can't see anything about that setup which would make that major a difference. This site is running on a Linux server with Perl 5.8.8, but it's running Apache 1.3.41, which may make the difference.

How many categories/posts does your blog have?

Posted by: Alden Author Profile Page | November 4, 2008 7:19 PM

Hi Alden.

I have 16 maincategories and 2 of them have 1 respective 6 subcategories. I have 1265 entries.

I did make a totally fresh install and added plugin by plugin and tried rebuilding and everything worked fine so without the MTPA code in categories all works and there are so far no server errors. As I wrote earlier I still have the code in the monthly archives which produce monthly, yearly and daily archives.

This is the code, perhaps I have done something wrong to this that I cannot even see:

<MTPAIfMultiplePages><br /> <MTPAPreviousPage text="«"> Sida <MTPAPageNum> av <MTPAPageCount> <MTPANextPage text="»"></MTPAIfMultiplePages>
<div class="content-nav">
<MTArchivePrevious><a href="<$MTArchiveLink$>">« <$MTArchiveTitle$></a> |</MTArchivePrevious>
<a href="<$MTLink template="main_index"$>">Index</a> |
<a href="<$MTLink template="archive_index"$>">Arkiv</a>
<MTArchiveNext>| <a href="<$MTArchiveLink$>"><$MTArchiveTitle$> »</a></MTArchiveNext>
</div>

<mt:Ignore><!-- Limit number of entries to the number set in Blog Entry Settings --></mt:Ignore>
<mt:Unless name="datebased_archive"><$mt:Var name="limit" value="auto"$></mt:Unless>
<br/><br/><mt:Entries><MTPAEntry>
<mt:Ignore><!-- Use the Entry Summary module for each entry published on this page --></mt:Ignore>
<$mt:Include module="Entry Summary"$>
</mt:Entries><MTPAEnd>

<br/><MTPAIfMultiplePages><div style="text-align: center"><MTPAPreviousPage show="1"> <MTPAPageList> <MTPANextPage show="1"></div></MTPAIfMultiplePages><br/><br/>

Any idea at all or so as what to try would be great.

Thanks in advance.

//Carina

Posted by: Carina Author Profile Page | November 9, 2008 6:42 PM

The code "disappeared" and I cannot add it, sorry.

Posted by: Carina Author Profile Page | November 9, 2008 6:45 PM

I can't see anything glaringly wrong there. The only thing I can suggest is trying it without the two MTPAIfMultiplePages sections to see if they make a difference.

Posted by: Alden Author Profile Page | November 9, 2008 7:00 PM

Hi Alden.

I did try your solution and it did not even pass the first 1% in rebuilding before it killed MT. I had to remove it.

It is strange though that it works with the monthly archiving without any issues and kills everything in category rebuilding. I have chosen 10 entries per page as well.

Any more ideas or so?

Thanks!

Carina

Posted by: Carina Author Profile Page | November 10, 2008 2:47 AM

I'm sorry, but I have to admit I'm stumped on this problem. I can't see any reason why it should work with monthly archives but no category archives. It uses the same code to split up both into pages.

Posted by: Alden Author Profile Page | November 10, 2008 9:51 PM

Hi, has anybody used this plugin with the Multiblog 2.0 feature on MT 4.1? We are having some troubles with paginating when the blog is pulling in entries from 2 or 3 other blogs. Any ideas on that?

Posted by: rosy | November 26, 2008 2:02 AM

Hi Alden,

We have implemented 1.31 with MT 4.21 on RHEL. In some cases it's working perfectly (e.g., category archives and on the homepage). But we are trying to build a pages liks of all entries ("All Archives") and the plugin seems to be breaking. We are seeing the comments come through in the output (like "--PA-Entry--"). We are outputting to a PHP file and building an array of the entries. So the comments are breaking the PHP.

Additionally, MTPAIfMultiplePages seems to always be false in this context. It's very strange.

Any ideas how we can debug this?

thanks,
Brice

Posted by: Brice | December 2, 2008 12:03 AM

Hi Alden,

I solved my problem by changing the Archive Type from "Archive Index" to "Custom Index Template". Is this expected behavior?

-Brice

Posted by: Brice | December 2, 2008 12:34 AM

Brice: the Active Index template type may not be supported in the plugin, but I'll have to investigate further.

Posted by: Alden Author Profile Page | December 2, 2008 5:52 AM

When I use the PagedArchives plugin to generate an HTML page it works fine. But when I use this plugin to generate a PHP page (I just change the extension to .php instead of .html), it does not paginate the entries. Instead it displays all the entries.

Can I know the reason for this?

Thanks,
Deepak

Posted by: Deepak Gupta | December 20, 2008 2:02 AM

How are you changing the extension? Changing the "Archive Path" in the template's settings? Which option do you have under "Publishing" for that template?

Posted by: Alden Author Profile Page | December 20, 2008 7:06 AM

Great plugin. After days of messing around with Mark Careys pagination and it not working and seeing terrible documentation as well as lack of user support for a paid plugin I found your site via a link.

Alden, you've documented the code and followed the K.I.S.S. principle. Others could learn a lesson from you.

I'll donate so you can have a few beers on me and I hope you don't mind if I write a post about it.

http://www.kopacetic.com/2009/02/paged-archives-entries-for-movable-type.html

Posted by: Daniel Kobayashi | February 8, 2009 8:03 AM

Heh, thanks Daniel! :)

Posted by: Alden Author Profile Page | February 8, 2009 8:57 AM

I must first admit that I'm not a developer. I'm running MT 4.1 and this plugin sounds great. I followed the instructions, installing the plugin in the proper directory and copy/pasting the example code into the "Entry Listing" template for my blog. When I went to re-publish the site I got the following error:

Statement has no result columns to bind (perhaps you need to successfully call execute first) at /home/virtual/site240/fst/var/www/cgi-bin/mt/extlib/Data/ObjectDriver/Driver/DBI.pm line 119.

Please Help


Posted by: Steve Park | February 13, 2009 4:35 AM

Hi Steve, are you sure it's PagedArchives causing the problem? The plugin itself doesn't do any database queries, relying on functions already in MT to get information.

Posted by: Alden Author Profile Page | February 13, 2009 11:37 AM

Everything was running fine until I installed the plugin. So I'm assuming that is the issue. It seems to happen when I try to Publish the "Only Entry Archives" If you have any idea why that would happen or can help me set this up properly that would be great. I will compensate you of course. I really want this pagination feature to work for me. you can reach me via my email or via http://www.stevepark.ca/pages/contact-me.html

Posted by: Steve Park | February 14, 2009 4:36 AM

I've been using this plug-in since last summer and it's been working perfectly...until today. I decided to change the number of entries displayed on each archive page, and now it's giving a link to the next page even when the number of entries in that category or month is the exact maximum specified. Clicking the link only brings you to a blank page, as of course there are no further entries.

Here is the example.

Thanks for any advice you can give!

Posted by: Nancy | February 15, 2009 6:01 PM

Nancy: That looks pretty cool! I love the way you've got the pictures in a grid there.

It sounds like it's not picking up the correct number of entries in the archive page. Are you using the MTPASettings tag at all?

Posted by: Alden Author Profile Page | February 15, 2009 6:38 PM

Thanks!

No, I'm not using the MTPASettings tag, but I wasn't using it before when the display was correct. I set the number of entries in the plugins screen in MT. Basically I went from a 6x10 grid (setting the entries at 60) to an 8x8 grid (set at 64). Previously, I had a few categories/months with exactly 60 entries, but never had the "multiple pages" link show up unless there actually was another page.

How do I use the settings tag? Thanks.

Posted by: Nancy | February 16, 2009 4:14 AM

Oops, didn't see the MTPASettings tag sample was right on top of the page. Working perfectly now, thanks!

Posted by: Nancy | February 16, 2009 4:19 AM

Sorry to bother you again, but the index2.html pages suddenly disappeared! I went back and moved a couple older entries to a different category, but not so many that there still wouldn't be an index2 page. I then went into my FTP program to delete those entries from the original category I moved them from. At some point during all this, the index2.html page deleted as well. Even from a monthly archive that I hadn't touched. I rebuilt a couple times, no luck.

I've also gone through and changed the settings to fewer entries, rebuilt so I could see that the index2 page does still generate. Some of the previously-hidden entries reappeared, but still not all the ones in those months or categories. And when I switch back to 64 entries per page, the link to index2 disappears again. Yet, all the individual entries are still there, and correctly archived.

Sorry if this is convoluted. Any thoughts?

Posted by: Nancy | March 15, 2009 6:46 AM

I'm not sure I'm following what you're saying. The index2 is generating, but there's no link to it from the first index page?

Posted by: Alden Author Profile Page | March 16, 2009 4:28 PM

No, the index2 is NOT generating. I can force it to generate by setting the number of entries in the plug-in to a smaller number, but then with fewer entries, there actually should be an index3 as well...and there isn't. There are entries that still clearly exist because I can hit them by clicking through entries continuously, or directly link to them, but they no longer show up in the category or month view.

You can see it here: http://www.nancychuang.com/2007/07/

July 2007 entries. If you open the earliest one (bottom right corner), you can hit the "previous" arrow on the entry page and see that the previous entry was also from July 2007, yet did not force the creation of an index2 page.

Help! Thanks! :)

Posted by: Nancy | March 18, 2009 5:23 PM

Hi Alden.

I was just wondering if there was a method of telling your plugin to have the Main Index start with index1.html instead of index.html? I'm moving into a multiple site setup and want to use the index.html for a static page covering all of the sites.

Hope this makes sense.

Thanks,
-drmike

Posted by: Dr. Mike Wendell | March 21, 2009 11:09 AM

If you change the mapping on the main index template to point to index1.html it may work, however the extra pages will be index12.html, index13.html etc. If you're going to have a multi-site setup, would you not have each blog in its own subdirectory?

Posted by: Alden Author Profile Page | March 22, 2009 1:20 PM

Hi Alden,
I'm looking to download the Paged Archives plugin, but I'm having trouble getting to the page.

The link: http://www.aldenbates.com/plugins/pagedarchives.html does not seem to be working for me.

Is there a way we can get in touch so can install this module? I've seen nothing but great feedback about it, and I'd like to implement it, if possible.

Many, many thanks.

Posted by: Rob | May 9, 2009 5:43 AM

Oops. A week or so ago, while trying to fix a problem I was having with MT, I deleted and reinstalled it. I thought that I'd left the plugins directory alone, but must have deleted it as well!

I have re-uploaded it to the server, so you should be able to get the plugin now.

Posted by: Alden Author Profile Page | May 9, 2009 11:08 AM

Thanks!

Posted by: Rob | May 12, 2009 3:11 AM

Post a comment





Tetrap.com Site Map