Geek & Mild by Sean Sperte

Mar 10th, 2007 The Remaking of Version 3

It takes a certain amount of obsessive compulsion, I think, to be good at what you do. This thing called the internets is what I do — and believe you me, I’m obsessed. Not more than a day after I launched Version 3 of this site I began revamping the way the site displays blog entries.

Now, instead of using the direct query method I showed previously, I use an entirely separate blog for links. Not only does this simplify my homepage code and reduce the amount of database queries, it also allows me to more easily manage the entries; where and how they’re displayed.

This is made possible by EE’s support for multiple weblogs inside one exp:weblog:entries tag. So this:

  1. {exp:weblog:entries weblog="blog" limit="20" paginate="bottom"}

Becomes this:

  1. {exp:weblog:entries weblog="blog|quickblog" limit="20" paginate="bottom"}

Another benefit of using this method is that I can now use the auxiliary “quickblog” for more than just links. Every category is now available to me — so if I have a quick thought about, say, design, I can just post it in the design category and not worry that it’s being displayed as a major article.

Additionally, the separation of quick-natured blog posts from those that require more attention (and time to read) creates an opportunity for isolating them in aggregation, for example, in an RSS feed.

For those wondering, yes, this is very much like a tumblelog. In fact, I’m experimenting with Andrew Weaver’s sweet, new FeedGrab plugin in order to pull in my Ma.gnolia links, Twitter statuses, Flickr photos, and Newsvine seeds. We’ll see how that goes.

Howsit done?

So here’s my new homepage code:

  1. {exp:weblog:entries weblog="seanblog|quickblog" limit="20" paginate="bottom"}
  2. {if weblog_id != "8"}
  3. <div class="link">
  4. {exp:markypants}{summary}{/exp:markypants}
  5. <h6><a href="{url_title_path=entry}">&raquo;</a></h6>
  6. {if:else}<div class="post">
  7. <h2><em>{entry_date format="%M %j%S"} </em><a href="{url_title_path=entry}">{title}</a></h2>
  8. {exp:markypants}{summary}{/exp:markypants}
  9. {if body}{exp:markypants}{body}{/exp:markypants}{/if}
  10. <h6 class="post-links"><a href="{url_title_path=entry}#comments">{comment_total} comment{if comment_total != '1'}s{/if}</a><span> | </span><a href="{url_title_path=entry}">permalink</a></h6>
  11. {/if}</div>

You can see I’m able to pull entries from two different weblogs using the same {exp:weblog:entries} tag. I just separate each using the pipe character. Then I use the weblog_id for the conditional and display entries uniquely based on which blog they came from, regardless of category. Again, this allows me to quickly post a thought, image, quote or link in the “quickblog” without it being displayed as a full-fledged post.

Questions, comments, concerns?


Comments

Sean
March 10, 2007

D’oh! Think I’ve found a bug — the {url_title_path} variable is being parsed, but only when the {summary} variable is present in the main conditional (testing for which weblog).

I’m heading to the ExpressionEngine forums with this one.

os
February 19, 2008

ups, whats markypants here?

Sean
February 19, 2008

os, Markypants combines both the Markdown and Smarty Pants plugins into one.

Kevin
May 15, 2008

Thank you, Sean. I’m just learning about EE and used this method on my own site. I also did not know about the Markypants plugin until now.


Comments are closed.