Blog reloaded
Warning: This post is full of gory technical details about the changes I have made to the blog. Read this only if you are interested in the internals of this blog. If you are in a hurry you can just read the stuff in strong/bold.
I recently upgraded my blog from Drupal 4.6.2 to Drupal 4.6.5. I have also made a number of small and big changes that I had been planning to implement since some time. Here I am posting various details about my Drupal setup as well as hacks I have implemented.
Since my blog is a single person blog it does not have all the bells and whistles Drupal is capable off. It is relatively simple setup as far as Drupal capabilities go. My goals were to have a simple but feature-rich blog. Please keep this in mind when reading the following stuff.
I am posting all this here for 2 reasons:- Your feedback regarding any aspect of my blog would be appreciated. I want to know what I could have done better or in a different way. Feel free to comment on any aspect of the blog.
- This post might help people who want to use Drupal primarily for blogging. I consider my blog to be a reasonably decent setup for a blog powered by Drupal.
- Version: Drupal 4.6.5
- Theme: Theme is madz. I have designed the theme myself from the ground up. More facts about the theme:
- Engine: phpTemplate
- Markup: XHTML 1.0 Strict. I have endeavoured to use semantic markup.
- Layout: Tableless layout. This is my first significant attempt at tableless layout. The theme breaks in IE when the browser width is low.
- CSS: The theme does not use drupal.css.
- node.tpl.php (display of a single post): This is predictable enough but there are a few non-standard things:
- Received Trackbacks and the trackback URI are not a part of the node body and are displayed separately after the post. More about this below in "Major hacks".
- There are hyperlinks for previous/next navigation. I have posted the code for this as a comment here.
- Comment by the post author is styled differently to make it stand out from the rest.
- The <head> section has things like geolocation info, FeedBurner feeds hardcoded. There should be better way of doing this but for now this will have to do.
- Modules in use:
- Core Modules:
- archive
- block
- comment
- contact
- filter
- help
- menu
- node
- page
- path
- search
- system
- taxonomy
- upload
- user
- watchdog
- Contrib modules
- commentrss. I picked up this (unmaintained?) module from CVS, changed the RSS version from 0.92 to 2.0 and am using it (with minor modifications) to syndicate comments.
- customerror: HTTP 404 and HTTP 403 errors are friendlier.
- dba (database administration)
- feedback
- gsitemap (Google sitemap generator)
- pathauto
- print (print friendly pages)
- similar (Similar Entries)
- static (duplicate of page module)
- trackback. I have coded some new functions for use with this module. This helps me to keep the trackback separate from the node body.
- Core Modules:
- Major patches:
- Morbus's freetagging patch (backported) for 4.6. More specifically I am using syscrusher's modified patch for 4.6.3.
- Major hacks. I have made many significant changes here and there. I am merely listing the changes I have made. If you want the code leave a comment asking for it and I will post it as a comment.
- RSS feeds
- Have complete posts as feed items, not just teasers.
- There is a 'comments' element in the feed for each item that links back to the comments section of the post.
- Feed channel has more elements such as image, managingEditor, webMaster, copyright, categories, generator, ttl and docs. There are (for now) hardcoded.
- Comment module
- Number of comments is displayed before the comments section.
- Links contributed by the comment module uses aliases where available. For e.g. the "add new comment" link for a newly posted node link uses the alias for that node and not 'comment/reply/<nid>'
- Have enclosed the comment form with <div></div> so that the markup validates cleanly.
- Have reduced with of comment textarea from 70 to 50. The larger width causes the theme to break in IE at low resolutions.
- Trackback module. 1 major problem with the trackback module is that received trackbacks as well as trackback URI for a post is made part of the node body. This makes things look ugly and especially causes problems with feeds, since a newly received trackback will update the node (if full posts are syndicated) and the post will be marked as unread in most feed readers. Major changes:
- function display_received_trackbacks($node). Simply returns a themed list of received trackbacks for a node. Theme developer can use this to display received trackbacks separately as well as have more control over their styling.
- function trackback_url($node). Returns the trackback URI for a node. Trackbacks for a node should be sent to this URI. Theme developer can use this to show the trackback URI separate from the node body.
- function trackback_autodetection_text($node). Function that returns text that should be published with a node for autodetection of its trackback details.
- Have disabled the 'view' op in trackback_nodeapi() so that default behaviour of the trackback module is prevented.
- .htaccess has to ensure that all HTTP requests for www.thoughtfulchaos.com/something are redirected to thoughtfulchaos.com/something i.e. the 'www.' part is removed. You can read about how I did this in the comments to this post
- RSS feeds
- Minor changes: These are not so important changes. Am listing them here for completeness.
- function form_textarea in common.inc: 'wrap="virtual" has been removed because it is not a valid XHTML strict attribute.
- taxonomy.module returns links for taxonomy terms with the rel="tag" attribute. All terms for a node automatically become tags.
- function page_block() in page.module: This is a copy of the blog_block() function in blog.module. This block displays recently posted items.
- Stuff still to do:
- Block for displaying taxonomy terms. I previously used taxonomy_dhtml for such a block but this module seems to have some problems with my setup.
- Enable caching and cause the cache to be flushed every hour (or less frequently).
- Want to make the template used by the print module to validate correctly and also be prettier.
- Modules I am considering
- Urlfilter to automatically make hyperlinks and email addresses in comments into clickable links.
- Quicktags to make it easy for commentors to insert markup.
- HTML corrector filter for comments so that incomplete markup by comment posters does not mess up rest of the page.
- Monthly listings module (variant of Weekly listings module)
- Unresolved problems
- Search indexing seems to be broken. When migrating the data from my old setup I had not dumped data from tables such as search_index, search_total, sessions and cache. I expected the search module to recrawl all the nodes and comments and recreate the index. My old index had around 17000 rows whereas currently it has only around 200 rows. Something seems to be broken but I am yet to try and do some troubleshooting.
0 comments