Posts Tagged ‘blogging’

Running Multiple Blogs in dotCMS

// August 5th, 2009 // 4 Comments » // Software, Tech, Web

blogEarlier today, a question was raised on Twitter about how one handles multiple blogs using dotCMS.  Out of the box, dotCMS comes with a rather decent blogging system.  And with some tweaking, that decent system can pretty much kick the ass of anything Wordpress driven any day of the week.  That’s so long as you’re only running ONE blog.  When you get into a position where you want to run more than one, things can get icky real fast.  I want to share some of the reasons why, and what you can do to help solve the issues.

First, if you’re going to run multiple blogs, basically commit to abandoning most everything built in.  The Starter Site blog is single purpose, and won’t scale how you want.  This is sort of like the calendar that’s built into dotCMS.  Good calendar, but you discover if you run 12 domains out of one dotCMS instance, they’re all tied to the single calendar.  That’s a little rough.  Once you’ve realized that issue, then you get to learn the other two reasons why multiuser blogs are hard: permissions and relationships. dotCMS currently lacks true user level permissions, so every blog you make will have to have a role associated to it (more on this later), and relationships are just too hard.

Let me start with relationships.  Don’t use them.  Period.  It seems at face value to be the logical choice – make a blog structure, and relate posts to a blog.  The problem is that while the instinct to use them makes sense, and they’re powerful and great tools for someone writing complex apps in dotCMS, the average grade blog user has no clue why they have to set them up, especially when they only use one blog.  Ideally, dotCMS itself should handle it like this: If a structure requires a relationship, and via permission restrictions a user only has one piece of content to relate it to, it should just force that relationship by default (I suspect using the pre-content hook you could write a plugin to do that, but I don’t think it’d be easy).  But it doesn’t, so users just get hit with a needless extra layer of work to get a blog post out.  And besides, it’s just not needed for this.  Leave relationships for more programatically useful tasks.

blogCategoriesThe solution to the relationship issue is categories.  This is actually the crux of the entire multiuser issue.  Categories are where you can segment blogs, and control their display.  Like I mentioned, you’re going to have to create a role for each blog anyway.  No way around it.  The benefit of that is that you can run all the blog entries from one structure, and by controlling user access to categories, you control the blogs they post to.  Each blog/role gets a category, like:

Blogs
  + My First Blog
    + Category 1
    + Category 2
  + Someone Else's Blog
    + Category 3
    + Category 87

Someone permissioned on “My First Blog” wouldn’t even see “Someone Else’s Blog” under the blog entry categories, and like magic, you’ve now segmented everything (additional advantage, one person could have roles for several blogs, and post to them all at the same time.  This goes further and is true really for any kind of content that you need to do “access control” on.  If you can tie it with category permissions, it’s a great, simple way to have several people working in one structure without getting into each other’s stuff).  Now, when you build out the blog page, you build based on parent categories, rather than relationships.  Combine all this with a login protected page on the front end using the Front End Content Submission plugin, and users never even need to log in to /c.

My suggestion is two structures, a blog entry content structure (which comes with the starter site, so you could just modify it), and a blog page widget structure.  The widget would let you turn any page into a blog, by covering all the listing and displaying functionality, and allow you to define the category it should pull, and all that extra bloggy stuff.  In ours, you can add Feedburner links, decide to show excerpts or full posts, control global commenting and rating settings, and even upload custom CSS (Cascading Style Sheets) files.  If you have two dozen templates, the widget route would let you turn any of those templates into a blog.  Here’s an example setup.

blogEntryStructure blogWidgetStructure

The smart thing to do in the widget code for the actual blog widget would be to just have it dotParse() an appropriate .vtl file for single view or an archive view (normal, date, category, etc).  You could break that down as far as you’d want, but that’d keep the code segments less in the widget, and more in actual files.

commentsAnother area that dotCMS hurts in right out of the gates is commenting.  The commenting system itself works, but the design is just bad.  The markup isn’t good, and the layout is ugly.  Luckily for you, you can override that.  If you look at the code that drives the Comment macro, you’ll see that it calls in a template file from the file system.  Also, if you look at that code, you’ll notice there’s a variable you can set that isn’t mentioned in the documentation: $commentSourceCode.  This lets you control how your comments are marked up, which is a major deal.  You can actually go in, copy that source file, edit it to meet your needs, and add some good semantic markup to both the form and the comments – making them both easier to manipulate and style.  You could even integrate Gravatar support with the help of some Javascript MD5 code.  Here’s an example of some massaged comments:

The form there is easier to read and use, and the comments look nicer and are easier to change with better XHTML markup.  You can even go further into the HTML to do threaded commenting, just like in Wordpress.  Combine that with some jQuery, and you can get real fancy.  Alternative, you could just go outside with a commenting system like Disqus if you want more functionality, which you can embed in your blog post view template.  There’s one gotcha to commenting I haven’t solved yet (at least, not without editing some field data in the database).  If you delete comments, the comment count doesn’t change.  So if you got 6 spam comments on a blog and deleted them all, the blog still says it has 6.  The field the count is stored in isn’t user editable (as mentioned, you could change this in the database itself), and there’s no hook to subtract from it when comments are deleted.  A workaround would be to count the size of the actual list from the comment relationship pull rather than trusting that field.

Everything’s not all roses and puppies and sunshine though.  The way I do things, it scales better, but not great.  This isn’t bad for a couple dozen blogs, but I still wouldn’t do it for hundreds until there’s a better way to attach permissions at the user level, and automate it.  The major limit is that role issue, and I’m happy to entertain ideas as to how to get around it (ultimately, it could be done with a CMS (Content Management System) Owner role, which is in the system now, but not quite used “right” enough for this purpose).  You could make pretty much make everything 100% dynamic, and from an infrastructure point of view, it’d just scale and scale and scale, so long as you’re willing to make a role manually each and every time.

Additionally, there’s no easy route into creating categories for the user.  You can give them access in the back end to add their own, but it’s not as easy as in other systems.  That’s not really a fault in dotCMS, since categories can do so much in the system, they just need to be in their own portlet.  So, you either end up manually maintaining categories for them, forcing everyone to use a common set, or hope they’re savvy enough to use the category manager (keep in mind, if they have to log in to /c to edit categories and whatnot, it sort of kills the reason to do a front end page mentioned above). Your environment will pretty much entirely dictate your approach, so this could be a non-issue for you, or maybe not.

I’ll present our web office blog at PSU as an example of this sort of system in use, and then a test blog, using the same system in a different place.  Different paths, different categories and RSS feeds, but using the same system.  I’m also working with another client on a very similar implementation, but with some differences, such as how the actual blog pages are built out (for about 2 dozen blogs).  Naturally, pulling this off takes a little time, and you’re going to need to be comfortable working with Velocity to pull it off, but I’ll tell you, in one page of Velocity I can duplicate almost all the core Wordpress display functionality (single, archive, category, tag, and author views), and have most of it done in under a day.

I’ll close by saying that if anyone has the skill and time to tackle the idea of doing a multiuser blog portlet plugin for the back end, I know it’d be well received in the community.  This could help get around every single deficiency that exists now, though I think within the next two releases, we’ll see some of the modifications needed to really implement this well natively inside dotCMS.

Here’s a Big Fat Digest

// August 12th, 2008 // 1 Comment » // Brain dumps, Creativity, Tech, Web, Writing

Okay, here’s a summary post to cover a bunch of different crap.  Turns out I’m very busy lately, and there have been some changes that will probably impact my normal blog posting routine.  I know… you’re heartbroken.  Now, I’m fully aware that I have no routine as it is, but I aspire to, and those aspirations are being interrupted somewhat.

So, the first big news is that I am now blogging “professionally” for .eduGuru, which is a web technology development blog sorta thing for higher education.  That means things that I used to talk about here will probably get diverted there.  Now, generic web stuff I’ll still post here, as well as things like dotCMS guides and my personal stuff will be here, so don’t panic or anything.  If anything, it means stuff around here will be less dry, and I’ll get to tickle your funny bone more.  And believe it or not, my first post is already up at .eduGuru.  I invite you to go read it, of course.  Here’s a snippet:

Is Hosted Search Really Ready for Prime Time?
Google Mini Summon Ninja ButtonIn my years that I’ve now spent in higher education, one universal truth I have found is that nothing quite moves a project along like when someone much more important and much less web savvy than you deems an issue worth addressing.  Such was the case only a couple months after I had started at the university, when the Director of Marketing noticed that new information she had put up on the site wasn’t coming up in search results, and the results that were hitting weren’t particularly relevant to the topic in the first place.  Thus, a mission was born, to find a way to make our search better, and to do it NOW.  That’s the other thing about people higher up than you, when they say jump, generally you jump…
[read the rest of this at .eduGuru]

Naturally, that will probably appeal to all two of you.  Something more interesting, however, is that I have a new play idea I am currently researching.  It’s the sort of thing that I feel has the potential to be great, too.  I just got the memoirs of the chap that’s at the heart of the story that I finally tracked down on interlibrary loan (I only found one copy for sale online, and it was over $200).  I have one other book that I need to track down a copy of as well.  Hopefully it will be everything I expect.  I will give you more information once I have a better idea of if it will pan out the way I hope it will.  Research must come first though.

I relaunched Penpedia tonight.  I decided Drupal was a little too robust for my needs, and I don’t have time to learn it to a degree to really leverage its power well.  I’m like a monkey with a jackhammer when it comes to Drupal.  Wordpress, on the other hand, I know inside and out, so I switched to that for the new system.  I was lazy and did not design the theme, though I plan on doing some work to customize it a little in the near future.  So if you’re a fountain pen person, go give the new site a look-see.

Brandon showed me a cool site the other day I’d like to share.  It’s an online stock trading game called UpDown.com.  Basically, it’s a total nerd type game.  Think fantasy football, only with stocks (but I have a fantasy football league going too).  You start with a million bucks, and see how well you can play the market.  This sounds stupid, only it isn’t.  For one, it’s actually kinda cool, because you really are fighting the system, and you have limited time to do it (the stock market isn’t open 24 hours a day after all).  Plus, it can help you get an idea of how to play the market, should you want to do it for real later, so it’s great practice, especially for you kiddos out there who actually understand the only way you will survive retirement is to have your own money.  So go check it out.

Clean up

// March 12th, 2008 // 2 Comments » // Brain dumps

Marisol is finally over with.  The play ended well, and ran smoothly throughout.  I think I accomplished my goal of gaining back lost ground.  Everyone seemed to think that the sound was more than adequate.  Memorial Auditorium came through with their stage mic.  However, I think it’s time for a break again.  I enjoy it, but it is very stressful, and I find myself so busy that committing the time to taking care of sound for a show is not the easiest thing in the world right now.  I’d also like a chance to pick up a few new pieces of gear before the next show I do.

That said, I did get a group together after the post mortem today to do a reading of Freefall, my one act that I’ve been writing since finishing Walking.  It went well, and the feedback was very positive.  I was pleased with the comments made on the dialog, something I’ve been taking a lot of care with.  I plan on doing the first round of major revisions now, as well as lengthening it some to address what I found out today.  I could sure use someone looking to direct a new one act, hint, hint.  I do need to start scouting festivals and such to submit to though.  I think Freefall is some of my better work recently.  So, while I don’t want to work on a show again right away, I do plan on using the down time to funnel creative energy into my own projects.

Michaele and I, Valentine’s Day 2008Speaking of creativity, I’m in the middle of redesigning my blog.  I’m about 45% done so far.  I haven’t done a Wordpress theme in quite a while, so it’s been a little slow getting back in to it.  My development environment is also not ideal, it turns out.  It’s just giving me some bugs when trying to work on it at home.  I think you’ll like it though, quite a bit different from the way it is now.  I’m pretty happy with how it’s shaping up, and I don’t normally give myself a ton of credit in the design realm.  It’s not that I can’t, it’s just that to do it well, I generally have to put forth more effort than I want to do for myself, or for free.  Just so happens that this covers both of those.  Sure, I suppose I could pay myself, but where would that really get me?

Michaele and I took advantage of the play being over to start some wedding planning.  June 6th is the big date it looks like.  Next year, not this year.  I’m not that crazy.  I also posted one of the pictures we had taken.  Wal-Mart does pretty cheap portraits, though the other picture came out awfully dark.  It doesn’t help that I don’t photograph well.  I’m not good at smiling on command, as as you can see, I look bucktoothed.  We’re trying to get a budget in line right now.  Unfortunately, I’m a little new to the whole marriage thing, so I’m not totally sure what we should be shooting for.  Advice?

Making changes

// November 16th, 2007 // No Comments » // Life and Times, Web

Okay, so, I am changing things yet again with my blog. First off, if you are reading this at MySpace, you are in the wrong place.  Otherwise, you are in the right place.  New theme. You like? Informational links on it are in the footer. It’s called Redoable, and I plan on doing some work to make it a little more “mine” soon, but right now I have neither the time nor inclination to design a theme from scratch. I’m fine with that. For a canned template, this one is pretty nice.

Second, I am giving MySpace the bird. My account will still be there, but my blog is moving here. I have already started migrating my old posts here, which is a tedious manual process, but so far I have everything as far as July of last year. I am actually shocked that no one has written a script yet that can scrape a MySpace blog and convert it into XML that can be imported into other blogs. Wordpress has a number of blog importing tools, but none for MySpace yet. Naturally, MySpace doesn’t want you to leave, so offers no exporting tools besides a weak RSS feed. But that’s exactly the problem. I don’t like not having control over my content. Maybe I’ll get lucky and someone will pull something out in the next couple days, right?

So, this means my original plans for this to be primarily a professional blog have changed. It’s too much trouble to try and maintain different crap at different sites, so this will just cover it all. Maybe a post is personal, maybe it’s professional, maybe it’s something we haven’t even thought of yet. One site, one tool, easy for me. Subscribe to the RSS feed to keep up with it the easy way. I’ll probably syndicate the feed over on MySpace, but it’ll shoot everyone over here.

But, keep in mind the holidays are coming up, plus I’m buying a house today, so I shall remain quite busy for the time being. However I am alive and well with a blood pressure of 156 over 88.

Let us sing diatribes of MySpace

// August 4th, 2006 // No Comments » // Web

You know, I’m really glad my new blog is going to be ready for mass enjoyment soon.  I don’t know about the rest of you, but I am quickly becoming disenchanted with MySpace and its oft fuckedupedness.  Example:  my friends list says I have 142 friends.  I don’t, I have either 132 or 133 depending how and when you count.  Also, my view counter for my blog hasn’t reset the "Today" reading all week.  And let us not discuss how many times mail has been down, or I’ve been kicked to the generic error page this week.  Let’s face it, these guys suck at their job.  I’ll be glad to put my reliance on something I have more control over.

All that’s left for my new blog really is to design a layout that is actually mine.  Right now the one that’s there is a canned theme, and though nice, isn’t actually something I see reflecting any me-ness.  I have, however, been stealing MySpace’s emoticon graphics when it suits me.  Anyway, I think layout will be priority one this weekend. 

I get to go to the eye doctor Monday…scary!