MainDoctor WhoMusicSoftware
Main Page

Alden Bates' Weblog

Feigning normality since 1973

Paged Archives v1.30

Filed in: Movable Type.

This release adds in a MTPAEntryLink tag, which is a paging-aware version of the standard MTEntryLink tag - you can use it to link to the Monthly or Category archive page which an entry appears on. It assumes you're not using the MTPASettings tag to alter the number of items per page, and that the items are in reverse chronological order. I might add an argument later to allow for forward ordering as well. This tag was requested by Blogosfere.

According to the MT wiki MT4 plugin compatability list, PagedArchives is compatible with Movable Type 4* - hopefully nothing in this release breaks that. I haven't downloaded the version 4 beta to look at yet.

You can download this plugin on the Paged Archives page.

* Though it would have been nice if it was listed in the "rendered obsolete" section.

Posted June 16, 2007 4:46 PM

Comments

Here's a completely irrelevant question (which you might want to pull out to a seperate blog entry): how do you decide how major an upgrade you've done? For example, why 1.30 instead of 1.25?

Posted by: Thad Ritchards | June 18, 2007 2:41 PM

1.21 to 1.24 were a series of minor bugfixes to try to fix an issue with the way the plugin constructed links to the other pages, so they were extremely minor and not worth jumping up a whole number for. :)

Posted by: Alden Bates | June 18, 2007 4:08 PM

Thank you so much, Alden. I have been searching for about 12 months now for an MT pagination solution without dynamic pages. It works so well.

I hope you can help me with one point. The system works great on my category pages, but I'd really like to use it on my homepage. The problem is that I use several MTEntries tags on this page, so the most recent article shows full content and then the remaining articles show only the first few words (using offset and lastn). I've tried putting the MTPAEntry and MTPAEnd tags in many different places within the MTentries tags but nothing works. Can you think of any other options?

Thanks

Mike

Posted by: Mike Oakey | June 26, 2007 12:33 AM

Hey everybody!
I used to have a Google ad between my first and second post, but had to give it up after I started using 'Paged Archives' (which is a fantastic plugin).
I would like to put it back in, but don't know how!
Any ideas?

Posted by: Tyler | June 29, 2007 8:28 AM

Tyler: You can do it in a similar way to what Mike's doing. You just need to put the <MTPAEntry> tags in the right place. I sent an email to Mike suggesting a solution to his problem, but he hasn't replied yet, so here's how you convert from a one-post + google ad + rest of posts layout to PagedArchives. Presumably at the moment you have code which looks something like:

<MTEntries lastn="1">
[first entry]
</MTEntries>
[Google ad code]
<MTEntries offset="1" lastn="9">
[rest of entries]
</MTEntries>

So, presuming you want to provide a history of ten pages with 10 entries per page, you'd change it to:
<MTEntries lastn="1"><MTPAEntry>
[first entry]
</MTEntries>
[google ad code]
<MTEntries offset="1" lastn="99"><MTPAEntry>
[rest of entries]
</MTEntries><MTPAEnd>

Note that there is only a MTPAEnd after the last MTEntries tag. Also, this will only put a google ad on the first page.

You'll also need to go into your settings to the General tab, and change the "Entries to display" setting to "100 Entries".

Posted by: Alden Bates | June 29, 2007 8:46 AM

Can images be used somehow for MTPAPreviousPage and MTPANextPage?

Posted by: LeeW | July 21, 2007 8:53 AM

Lee: You should be able to use something along the lines of <MTPANextPage text="<img src='next.gif' alt='next page'>">

Posted by: Alden | July 21, 2007 10:49 AM

I try use it this plugin but in the header show:
MAIN
PAGE of 6
and in the bottom of the page:
<!-- --PAPageList -->
The CHMOD is 755 for the files (i try before with 777)

Posted by: manu-el | August 24, 2007 1:33 PM

Are there any errors listed in your activity log? It looks like the plugin is having trouble running when the file is rebuilt.

Posted by: Alden | August 24, 2007 2:40 PM

I just upgraded to MT4.
Plugin works fine with Categories archives but not with Monthly archives.
In Monthly archives, the bottom shows just as in the post above by 'manu-el'.
(Same tags were placed on Category Archive Template and Date Based Archive Template)

Posted by: S-Kumar | August 25, 2007 6:56 PM

Hmm, I'll do some testing tomorrow and see what I can turn up. I may have to fork a version for MT4. :/

Posted by: Alden | August 25, 2007 9:40 PM

I did some testing with running PagedArchives on MT4 with paging on for monthly archives and it's working fine. If you're having trouble with it not working on specific templates, please double-check the tags.

If you're still unable to get it working, feel free to contact me using the feedback form, and I'll see if I can help you by email.

Posted by: Alden | August 26, 2007 3:02 PM

Thanks. I did as instructed. PagedArchives is now working fine for Monthly Archives as well. What a handy plugin!

Posted by: S-Kumar | August 26, 2007 9:28 PM

Cool! Glad to hear you got it working. :)

Posted by: Alden | August 26, 2007 10:21 PM

Hello Alden !
I've just gotten familiar with MT and i'm new with the plugins installation.
Your plugin is really fantastic !
Unfortunately i have a problem with gettin it to work.
I have like 70 Entries in this category so i should have 1,2,3 numbers on the page ( i chose 30 entries per page ) but there's just number 1 and there's no 2 and 3 ! ( it shows only the last 30 of entries )
so i know that i've made a mistake somewhere.
Is the order of the plugin's tags correct ?
Do i have to use another tags like : <MTPAIfMultiplePages></MTPAIfMultiplePages> ?
if yes where should i add them ? can you please place them in my code ?
Here is my code :

<MTPASettings entriesperpage="30"></MTPASettings>
<MTEntries category="Movie">
<MTPAEntry>
<$MTEntryTrackbackData$>
<td style="padding-right: 30px;"><img src="/images/dot.gif" /> <a href="<$MTEntryPermalink$>"><font color="black"><$MTEntryTitle$></font></a></td>
<tr>
</MTEntries>
<MTPAEnd>
<td style="padding-right: 30px;"><MTPAPageList></td>

so sorry for troubling you and my poor english.
Thanks a lot !

Posted by: Anonymous | August 30, 2007 11:22 AM

Oh i thought the code will be displayed ! sorry !
can you help me just by the info ?

Posted by: Anonymous | August 30, 2007 11:24 AM

Is there some upper limit on the number of pages? I have a blog with 440 or so entries, but if I set the display number for the main page at X (where X is greater than the number of entries) and the number of listings per page at 30, I only get 14 pages.

Doing the math, I'm losing the last 20 or entries of the blog. There should be a 15th page.

Posted by: Culture Snob | September 1, 2007 10:20 AM

There is no upper limit, though I haven't tested it on a page count that high... Have you checked the last page to see if your earliest posts are on it?

Posted by: Alden | September 1, 2007 11:47 AM

@Alden:

Yes, I've checked the last page, and the earliest posts aren't on it. If I increase the number of listings per page so that the earliest entries will naturally fall on an earlier page, it works. But I can't get it to go above 14 pages in MT4.

Posted by: Culture Snob | September 1, 2007 4:08 PM

Hrm, that's strange - I increased the number of entries on my test blog's index page to 500 and did a rebuild. With 10 entries per page, it generated 48 pages.

I'm not sure what could be different with your site...

Posted by: Alden | September 1, 2007 4:52 PM

I am having a bit of trouble getting the plugin to work properly, but I have a feeling it may be server problems. Does this line of code mean something to someone who knows more than me?

Paged Archives died with: Can't call method "outfile" on an undefined value at /blog-mt7/plugins/pagedarchives.pl line 194.

Posted by: Sean | September 1, 2007 6:06 PM

Sean: that error would occur if an index template is not associated with an output file. I.E. template doesn't have the "Output file" field filled in.

Posted by: Alden | September 1, 2007 6:49 PM

That's weird. This is what happened when I tried to put it into my main index. It works fine in the monthly archive.

Posted by: Sean | September 2, 2007 4:22 AM

@Alden:

Might it make a difference that it was the main page rather than other archives?

I might play around with more and see how it behaves.

Posted by: Culture Snob | September 2, 2007 9:23 AM

Sean: which version of MT do you have? The only thing I can think of is that it might work differently in your version.

Culture Snob: I did my testing on my main page, and it worked fine. :)

Posted by: Alden | September 2, 2007 10:43 AM

@Alden:

I think I have a little better idea what's going on.

The problem isn't that there's a limit on the number of pages; the problem appears to be that the plugin doesn't want to build an incomplete page.

For example, if based on my settings I should have 15 pages of 20 entries, with 6 leftover entries beyond that, the plugin is only building 15 pages of entries. In other words, it doesn't build that 16th page with the remaining 6 entries. It doesn't appear to like partial archive pages.

In this case, I have my entry listing default to a number greater than my actual number of entries.

Posted by: Culture Snob | September 2, 2007 4:22 PM

Here's another possibility: My main page uses . Is it possible that the plugin is calculating the number of pages based on only one blog, and is therefore cutting off listings prematurely because it isn't considering the second blog?

Posted by: Culture Snob | September 3, 2007 3:41 PM

Trying again ... .

Here's another possibility: My main page uses the tag 'mt:entries include_blogs="1,2"'. Is it possible that the plugin is calculating the number of pages based on only one blog, and is therefore cutting off listings prematurely because it isn't considering the second blog?

Posted by: Culture Snob | September 3, 2007 3:43 PM

Greets:

Thank you for offering this plugin but I'm having a problem with it that I'm hoping you can offer assistance with. I'm using the 4.01 version of MT and have had it installed for about a week now with the "Use Publishing Queue" choosen just for reference. While the first page of the paged archive is showing up fine, the second page (and other even numbered pages) is without content while the third page (and the other odd numbered pages) is a repeat of the first page. Nothing has appeared within the MT error logs.

Thanks for your time,
-drmike

Posted by: drmike | October 6, 2007 2:30 AM

does the current version fully work in MT4?

Posted by: Pai | October 14, 2007 3:40 AM

Yes, this weblog is running PagedArchives on MT4 and I haven't had any problems.

There's a caveat however that there may be problems with using it with the MT4 default templates. I've been trying to test this, but am having problems getting the TemplateRefresh plugin to work.

Posted by: Alden | October 14, 2007 10:24 AM

I've managed to get the default MT4 templates set up on my test blog, and have solved drmike's problem, so I've added an example MT4-style template to the example page.

Posted by: Alden | October 16, 2007 10:36 PM

For the record, I solved Culture Snob's problem in email as well - because the plugin can't see the arguments on the MTEntries tag, it doesn't know about any extra entries. I supplied Culture Snob with a beta release of the next version to get around this.

Posted by: Alden | October 16, 2007 10:43 PM

Greets:

Yes, it did fix our issue. I also did the fix on a new install as well and it worked there as well.

Thanks again,
-drmike

Posted by: drmike | October 17, 2007 1:07 AM

Hi,

I am having a bit of trouble as I do not have a MTDateHeader tag in my template. In that case where would I work in the MTPADate tags?

I have a div id=post-date section that appears right after the MTEntries section of the code.

Thanks,
John

Posted by: John | November 22, 2007 3:31 PM

If you're not using the MTDateHeader tags (the MT4 style templates, or at least the default ones, don't), then you don't need to use the MTPADate tags. The MTPADate tags are simply to ensure that the date header occurs at the top of the next page if the page break happens in the middle of several entries on the same day. :)

Posted by: Alden | November 22, 2007 11:18 PM

Hi,

Great plugin !

Having a little problem with the following situation:

I have category archives being paginated, and want to have an adblock after the 3rd post on each of the pages.

I thought something like this would work:


<MTEntries lastn = "2"><MTPAEntry>
  ...
</MTEntries>

  Ad code goes here

<MTEntries offset = "2">

   ...

</MTEntries><MTPAEnd>

This works fine on the first page, but repeats the first 2 posts in the category on every subsequent page. The remaining items on each page are correct.

So - looks to me like the offset works within the context of MTPAEntry (as it respects the offset relative to the current page), but the lastn attribute doesn't consider the context of the current page.

Is this an easy fix ? I'm not a perlhead at all, but don't mind diving into the code if I can get a few pointers ! Or have I missed something completely obvious ?

Cheers

anu

Posted by: anu | December 4, 2007 11:58 PM

anu: put a <MTPAEntry> tag after your second MTEntries tag. IE:

<MTEntries offset = "2"><MTPAEntry>

Unfortunately that will only put the ad block on the first page. It's not possible to have something after the third post on *every* page in the sequence...

Posted by: Alden | December 5, 2007 8:04 AM

Hi Alden,

Thanks for that - unfortunately I do need an ad block on every page.

I've worked around it with a fairly trivial bit of PHP:

Add this before the tag
<?php
$post_counter = 1;
$ad_post = 3;
?>

And just before the closing MTEntries tag, add this:

<?php
if ($post_counter == $ad_post) {
?>
**** put ad code here

<?php
}
$post_counter++;
?>
</MTEntries><MTPAEnd>

This will display whatever is put in the ad block section between then 3rd and 4th post on every paginated page. Change the value of $ad_post to move it around. Hope this is useful for someone !

Posted by: anu | December 5, 2007 10:27 PM

Ahhh, PHP :)

There's also a counter variable in MT4, which I think could be used, but I haven't investigated it enough yet.

Posted by: Alden | December 5, 2007 10:41 PM

First of all, this plugin is absolutely awesome, thank you Alden!

I have a slight problem though, I was able to setup the date and category based archives with no problem, but I'm having problems implementing this on the main index file. I've read the instructions and read all these posts, when I try and add the code to the main index file, the side navigation on my page is missing, the layout on the main page is messed up, and the page numbers don't show up at all.

Any ideas what is wrong here?

<MTSetVar name="page_type" value="none">
<$MTInclude module="header-common"$>

<MTEntries>
<MTPAEntry>
<$MTEntryTrackbackData$>
<a name="post-<$MTEntryID$>" id="a<$MTEntryID pad="1"$>"></a>
<div class="post" id="post-<$MTEntryID$>">
<div class="post-header"><h2><a href="<$MTEntryPermalink$>"
rel="bookmark" title="Permanent Link to <$MTEntryTitle$>"><$MTEntryTitle$></a></h2></div>
<span class="post-date"><b><$MTEntryDate format="%A, %x"$></b></span>
<br>
<br>
<div class="post-body">
<$MTEntryBody$>
<MTEntryIfExtended>
<p class="entry-more-link">
<a href="<$MTEntryPermalink$>#more">Continue reading "<$MTEntryTitle$>" ยป</a>
</p>
</MTEntryIfExtended>

</div>

<div class="post-metadata">
<span class="post-comments"><MTIfCommentsActive><a
href="<$MTEntryPermalink$>#comments"><MTIfNonZero
tag="MTEntryCommentCount">Comments (<$MTEntryCommentCount$>)<MTElse>Add a Comment Now</MTElse></MTIfNonZero></a></MTIfCommentsActive> - We Want to Hear From You</span><br><br>
</div>
</div>
</MTEntries>
<MTPAEnd> <MTPAIfMultiplePages><div style="text-align: center"><h2>
<br>
<MTPAPreviousPage show="1"> <MTPAPageList> <MTPANextPage
show="1"></div></MTPAIfMultiplePages></h2>
<$MTInclude module="footer-common"$>

Posted by: Jeff Noble | December 14, 2007 12:21 PM

Jeff: Well, for one thing you've got the closing </h2> in the wrong place in your IfMultiplePages section:

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

It should be before the </div>...

Posted by: Alden | December 14, 2007 12:36 PM

Thanks Alden, this seems to work really well on my category and date pages, but totally screws up the index page layout. As in, the sidebar is pushed all the way into the content area, with no page numbers.

I have read the instructions for using this on the main index file, any other ideas? Any help would be appreciated.

Thanks!
jeff

Posted by: Jeff Noble | December 21, 2007 3:54 AM

I tried to install this plugin with MT4, and even though I followed the directions and templates perfectly, it just didn't work (I kept getting the error that drmike was getting). I decided to uninstall for the time being, and that's when I faced real problems. After following the directions on the uninstall, I now have a situation where if I go to the main index of my site (http://www.bsideblog.com), it doesn't update when a new entry or comment has been published. However, http://www.bsideblog.com/index.html DOES update. New visitors won't know that though. I imagine I've done something wrong. I just want it to go back to normal! Ack! Help!

Posted by: Ben | January 4, 2008 8:30 AM

Never mind. I think I fixed my problem. It had nothing to do with the plugin!

Posted by: Ben | January 4, 2008 9:14 AM

Ben: Whew! :)

Posted by: Alden | January 4, 2008 11:56 AM

Greets again:

I just tried this plugin with a 4.1 install and am getting a number of errors when I try to rebuild.

Error rebuilding file /home/cynix/public_html/drmike/2001/06/index.html: An error occurred publishing date-based archive 'Monthly20010601000000': Publish error in template 'Entry Listing': Error in <mt:Entries> tag: Unknown tag found: PAEntry Error rebuilding file /home/cynix/public_html/drmike/2001/06/index.html: An error occurred publishing date-based archive 'Monthly20010601000000': Publish error in template 'Entry Listing': Error in <mt:Entries> tag: Unknown tag found: PAEntry : An error o

Long story short: I gather it's telling me that it can't understand the PAEntry error.

The plugin is activated. Did it automatically and didn't go through any setup which i thought was weird. I tried turning the plugin off and on via the main interface (I guess we can't do that with the individual blogs anymore) but that didn't help.

Using the middle example from the other page.

Hoping for some assistance once again. :)

-drmike

Posted by: drmike | February 2, 2008 9:47 AM

Hey Alden,

I've noticed that PagedArchives doesn't take account of a lastn="xx" attribute for MTEntries.

I did some rebuilds with and without the PAentry, PAEnd tags: without them, only the last (eg) 50 entries were built, with them, all entries were output.

I've hardcoded things for now by adding this (eww !) above line 122:
$entrycount=50 if($entrycount>50);,

is there an easy way to get the lastn attribute and use that instead ?

Posted by: anu.gupta.myopenid.com | February 28, 2008 2:18 AM

Unfortunately the problem is that PA doesn't have access to what parameters mt:Entries has been given, hence it has to assume the "default" number of entries based on the archive and type. I've got a beta version which will provide a new tag to get around this problem, so you'll be able to use that when I release the next version.

Posted by: Anonymous | February 28, 2008 7:46 AM

Post a comment





Tetrap.com Site Map