CatEntries 2.8 allows offset with days (that is, offset="3" days="4" means "four days of entries starting three days ago"), and using lastn with days will work as normal for days, but only return at most lastn entries.
Mihai Bocsaru wanted to show "the last three entries starting seven days ago," and this allows you to (<MTCatEntries days="20" offset="7" lastn="3">). At this point I wouldn't be surprised if you used CatEntries without specifying any categories, just to get better control of the displayed range. Thanks for the suggestion, Mihai!
Comments
comment
Mark, Quick query. I just upgraded to MT3 and a random error appeared whilst I was rebuilding my site. Whilst it doesn’t throw up a problem on some pages, it through up an error “Not an ARRAY reference at C:\www\webroot\MT\plugins\CatEntries.pl line 95.” in the following code: <MTCatEntries lastn=”1” exclude=”currently”> <li class=”first”><a href=”<$MTEntryLink regex=”stripFile”$>” title=”<$MTEntryBody words=”20”$>…”><$MTEntryTitle$></a></li> </MTCatEntries> <MTCatEntries lastn=”999” offset=”1” exclude=”currently”> <li><a href=”<$MTEntryLink regex=”stripFile”$>” title=”<$MTEntryBody words=”20”$>…”><$MTEntryTitle$></a></li> </MTCatEntries>
Any thoughts would be appreciated. Kind regards, skitz
comment
Are you using 2.8, then? There’s a 3.0 version for MT3 (I haven’t linked it from the page yet).
comment
I was indeed. Have upgraded and the build error has stopped which is good. Code above does seem to be reacting oddly, but I am sure thats just my bad coding. Sure it’ll go if I tighten it a bit. Many thanks for your feedback and help Kind Regards, skitz
comment
Mark,
I installed 3.0 to get rid of the same problem skitz had. But now in my Daily archives when using ‘MTCatEntries exclude=”category”’ I get all entries from the entire month. When I use ‘MTCatEntries exclude=”category” days=”1”’ to get only articles of this day, the excluded category is shown again. Any ideas?
Thanks, Marza
comment
Installed MTCatEntries this morning in MT 3.15 and had instant success using it in an index template. Brilliant! But then I tried it in a category template (hoping to hide entries that were also categorized to another specific category) and on rebuild got the error message: “Not an ARRAY reference at plugins/CatEntries2.8.pl line 95.” Am I trying to do something CatEntries isn’t supposed to do? Or is there a way to fix this?
comment
It may help to use CatEntries 3.0 for that error. However I’m not sure CatEntries in general will behave as you want; I was confused over how it should work in archive pages (if you’d use it for filtering main content or as a main list in a sidebar). Hopefully it’ll work!
comment
That did the trick. Thanks!
comment
I am actually using the CatEntries 3.0 plugin in a sidebar in my category archives, and it works great except for one little hitch. As long as you have it displaying days=”x” it will display entries from whatever categories you want to include or exclude as it was designed.
But when you use lastn=”x” to display the last entries rather than by the date it will only display entries from the category archive it was called from.
Any ideas? Going by days works fine, but I’d much rather use lastn=”x”
comment
What happened to CatEntries??
comment
I’ve started moving some of the rest of my site into Movable Type, and changed the URL for the CatEntries page to lower case. I thought I had configured a redirect but it wasn’t working! It works now though. Sorry about that!