Let’s be clear that I’m not going to win any python programming competitions but I love Plone and wanted to try my hand at a blog. Sure, it means running the risk of analyzing navel lint but it’s also a potentially easy way to publish frequent content. I started by looking at some Zope blog products and thought that I’d found a solution with the Collective’s CMF Weblog.
That was after I had installed PA Blog but not had any success in getting it to work correctly. The CMF Weblog,was clunky – it didn’t quite fit into the Plone – but at least I could add content and I was even able to customize the Weblog document type so that new posts were reflected on the Calendar Slot. It installed without any problem and I was able to tweak the interface to sit better within my site.
But I could not get the Title to pick up – and, as I said, at some point I had to decide to go with a slightly broken CMF Weblog or find another solution. So I started to think about how I could do this more simply. Let me say that I don’t mean to cast aspersions on either product – PA Blog wasn’t intended for Plone and CMF Weblog hadn’t even reached version 1.0 – and it’s likely that user error was the prime reason my attempts with those products stalled.
One of the things I have learned with Plone is that you can do an awful lot with the topics and new document types. I’ve created a tolerable job bank using the same mixture. Is it the best way? Perhaps not. But here’s how I’ve added a blog to my site without using any additional products beyond base Plone:
- Added a document type (called DBlog Item) that was an exact copy of the News item;
- Copied the topic_view page template from portal_skins/zpt_topic so I had a custom topic template. Since I don’t like the topic look anyway (the table that has four columns and stretches across the screen), I reformatted it to handle my blog, with a colored title, date, description, and then a jump link over to the full log post.
This is the basic functionality of the News item, but I set the topic’s criteria to pull just the DBlog Item. I also customized the topic_view template to limit the blog to 5 posts per page, to include the navigation bar at top/bottom of the blog pages to see the other posts, and did some extra formatting. I created a topic called “blog” that has two criteria:
- Type = DBlog item
- Date = Sort Descending
To avoid having the blog relegated just to the top navigation bar slots and down in the site, I copied my already-custom News slot and made a new Topic slot. A few minor changes – to look for DBlog Item instead of News, to restrict the pull to 5 posts, and a bit more formatting to diminish the size of each listing in the slot – and I was able to put the Blog slot in the main template.
About the same time, I was playing with links, and decided to use the same custom topic_view format for links as well. The topics for the links used criteria that said (a) give me all links where (b) content=keywords, and the keywords are the metadata that I’ve set for each link document. That worked pretty well, except that the topic_view was set for News/DBlog documents, and so there was a jump link to a full-text document – which doesn’t exist for a link document. This problem was eliminated when I put in a conditional span to check for a “remote URL” – if there is, then it shows a clickable link to the URL in the link document. If there isn’t, it treats it like a normal News item and prints a link to the full-text document.
So now I’ve got a “blog”, a bit snazzier topic view, and I had a bit of fun fooling around with how the topic gathers up content.