Mephisto Plugin: Full Archives (plus: an irresistable offer)
posted: November 25th, 2007 · by: Sven
For popular demand (that is, if you agree to call a request by someone like Liz popular) here’s a really tiny plugin for Mephisto that allows you to have a full archive page.
By “full archive” simply a list of all your blog posts is meant, most probably just titles grouped by month. This is supported by quite some big blogging engines.
To learn how to install and use this plugin just head over to my project page: Mephisto Plugin: Full Archives (tricky edition)
I really enjoyed putting this together with Liz. She even helped me to make the first version of the plugin even simpler and told me about the {% ifchanged %} Liquid tag that I wasn’t aware of.
Also, I was quite impressed how Liz - doing unusual things in Liquid - got Mephisto to do funky things that the software is rather not designed for. I initially called it a “hack” but meanwhile I think that’s what’s really called “thinking outside the box”. :-) Anyways, this was both instructive and fun!
And it also sparked the idea for the following offer:
Send me your Mephisto plugin requests!
If you think there’s something missing in Mephisto and it could be done as a plugin, just drop me a note (or post to the Mephisto mailinglist). If I agree that it’s a feature that would make sense I might have a stab at implementing it.
Of course I don’t want to waste time (mine and yours) with weird stuff and there might be a multitude reasons to reject a request. But if by any means it’s a reasonable feature that I can implement without spending ages of time, I very well might just do it.
So, give it a try!
There are a couple of ways to contact me listed on my about page.
dy said December 10th, 2007 at 07:31 PM ¶
Great plugin,that’s what i’m looking for ! one more thing,how did you display the full archive in your /articles ? create a new session named articles ? and then what ?
Sven said December 13th, 2007 at 05:25 PM ¶
Hi dy
I’m not if I understand your question. There’s no archive in /articles, it’s in /archives: http://www.artweb-design.de/archives
And it get’s there by just installing the plugin :)
dy said December 16th, 2007 at 06:43 AM ¶
I mean I want to create a page to display my articles, so I create a new seeion named archives, and copy your code in my archive.liquid, but when I visit www.mysite.com/archives there is noting happens.
EnvyGeeks said December 16th, 2007 at 10:16 AM ¶
When I mix your Archives plugin with your Pagination plugin I get the following Liquid Error ” Liquid error: undefined method
current_page' for # Liquid error: undefined methodcurrent_page’ for #” can you give me some insight as to what’s wrong?Sven said December 16th, 2007 at 10:20 AM ¶
Ah, now I get it :)
No, I think you should not have a section named “archives”. That might be the problem as it might keep Mephisto from actually dispatching the the archives action (but instead uses the default section action).
Interesting find. Just install the plugin and add the template, remove the “archives” section. That should be working. If it doesn’t, please email me so we can figure out what’s wrong.
Sven said December 16th, 2007 at 10:26 AM ¶
Hey EnvyGeeks,
do you mean that you are trying to paginate the full-archives list of articles?
That most probably won’t work, because there’s no pagination added to this list by the fullarchives plugin. That would require to have the pagination plugin monkeypatch the fullarchives plugin and I’m not sure if that’s a really good idea.
EnvyGeeks said December 16th, 2007 at 10:35 AM ¶
Is there a way I can have it dispatch the entire month on one page and have it use a different layout the the general layout.liquid. I would like my tags and archives section to be the only pages that have the “Monthly archives” section, this isn’t as much a “need be” since I can pull some OutSide-Box-Thinking in Liquid to do that, the main thing I’m worried about is I would like it to list the full month on that singular month page and output a 404 error for just /archives/200(7|8|9) (right now it simply outputs the liquid error or a blank page). The /archives/2007 is really important to me because it could mess with my total SEO and penetration with just a blank page.
Sorry for all the questions and thanks for all the help :)
Sven said December 16th, 2007 at 10:58 AM ¶
You have a really nice blog theme, btw!
No problem with the questions, that’s what this blog is here for. You may also contact me by email. If this is getting a long conversation about stuff that’s not related to this archives plugin that probably would make sense. Also, some of your questions would make sense on the Mephisto user mailing list :)
I’m not sure if you can have a dedicated archives layout, but it might work. See: http://mephisto.stikipad.com/help/show/CustomSectionLayout … that’s for sections, though, and the archives aren’t sections, technically.
Re: blank page and liquid error. That looks like produced by the pagination plugin, right? That shouldn’t be on your archives template at all. (I know it’s stupid that it throws this error, it should just silently return nothing.)
EnvyGeeks said December 16th, 2007 at 11:56 AM ¶
I’ve made examples, the following example demonostrate:
http://en-us.envygeeks.com/archives/2007/ < Should Return 404 http://en-us.envygeeks.com/archives/2007/11 < Pagination Error http://en-us.envygeeks.com/archives/2007/01 < Should Return 404 http://en-us.envygeeks.com/archives/ < Currently not “Enabled”
Could you give me insight on how to fix these?
dy said December 16th, 2007 at 12:28 PM ¶
Thank you so much man, it works ! I just add monthly archive links to my sidebar, and then visit /archives,it’s displayed like yours Great job :)
Sven said December 16th, 2007 at 12:46 PM ¶
EnvyGeeks: without hacking Mephisto (or doing your own plugin) I don’t see how this could be accomplished, really. Mephisto by default always gives you an archive per year and per year/month.
If you want to paginate archive pages like archives/2007/11 that should work out of the box with the pagination plugin (no idea, what the “pagination error” means, here). If you’re going to use the fullarchives plugin, this won’t paginate.
dy: great :)
Bryan said June 29th, 2009 at 04:14 AM ¶
Hi Sven,
I had the plugin working on Drax/Rails 2.0.2.
Do you know if it should work on 0.8.2/Master on Rails 2.2.2?
Thanks,
Bryan