<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Albert Sun</title>
	
	<link>http://albertsun.info</link>
	<description>Journalist &lt;em&gt;slash&lt;/em&gt; web geek</description>
	<pubDate>Tue, 18 Nov 2008 17:15:14 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/albertgate" type="application/rss+xml" /><item>
		<title>34th Street Launches! And, how we did it in Drupal, Pt. 2 of X - Theming with Zen</title>
		<link>http://feeds.feedburner.com/~r/albertgate/~3/457168722/</link>
		<comments>http://albertsun.info/2008/11/34th-street-launches-and-how-we-did-it-in-drupal-pt-2-of-x-theming-with-zen/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 13:04:36 +0000</pubDate>
		<dc:creator>albert</dc:creator>
		
		<category><![CDATA[Journalism]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[cms]]></category>

		<category><![CDATA[daily pennsylvanian]]></category>

		<category><![CDATA[design]]></category>

		<category><![CDATA[drupal]]></category>

		<category><![CDATA[street]]></category>

		<category><![CDATA[theming]]></category>

		<guid isPermaLink="false">http://albertsun.info/?p=406</guid>
		<description><![CDATA[Big news! At long last, the DP has launched it&#8217;s first public web site on Drupal at http://34st.com for our weekly arts and entertainment magazine, 34th Street. We&#8217;ve been working on developing an alternative to College Publisher since I started my term as Web Editor-in-Chief at The Daily Pennsylvanian in January. After months of waffling [...]]]></description>
			<content:encoded><![CDATA[<p>Big news! At long last, the <a href="http://dailypennsylvanian.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/dailypennsylvanian.com');"><acronym title="Daily Pennsylvanian">DP</acronym></a> has launched it&#8217;s first public web site on Drupal at <a href="http://34st.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/34st.com');">http://34st.com</a> for our weekly arts and entertainment magazine, 34th Street. We&#8217;ve been <a href="http://albertsun.info/2008/10/alpha-of-new-dp-website-on-drupal/" >working</a> on developing an alternative to College Publisher since I started my term as Web Editor-in-Chief at The Daily Pennsylvanian in January. After months of waffling and pressure we decided to move ahead with development and committed to launching a new website. And finally, we&#8217;re here.</p>
<h5>Theming with Zen</h5>
<p>Last time, I wrote about the <a href="http://albertsun.info/2008/10/how-we-did-it-in-drupal-pt-1-of-x/" >data structure</a> underlying our website running on Drupal and promised that I would write again about theming.</p>
<p>The Drupal theming layer is quite powerful, but can also quickly become incredibly complex. It also depends on module developers to play nicely and make all their code easily themable. It also requires a designer to learn how to work with Drupal and all it&#8217;s eccentricities.</p>
<p>Drupal themes depend on layers of overrides and hooks. Drupal core provides a default layout, which can then be modified by modules, then the template engine, then the theme and finally an optional subtheme. At each layer the previous output can be modified or overridden. That way, if someone were designing a set of themes or wanted to present options for a user to customize the site&#8217;s look and feel it could degrade gracefully.</p>
<p>Since we weren&#8217;t worrying about any of those things, we did nearly everything in the top-most sub-theme layer.</p>
<p><a href="http://albertsun.info/blog/wp-content/uploads/2008/11/screenshot.png" ><img class="alignright size-medium wp-image-426" title="screenshot" src="http://albertsun.info/blog/wp-content/uploads/2008/11/screenshot.png" alt="" width="150" height="32" /></a><br />
Luckily for us the Zen starter theme makes much of this easier.</p>
<p>To develop our theme, we were lucky enough to have a great starting point in the amazing <a href="http://drupal.org/project/zen" onclick="javascript:pageTracker._trackPageview('/outbound/article/drupal.org');">Zen</a> starter template and it&#8217;s great <a href="http://drupal.org/node/193318" onclick="javascript:pageTracker._trackPageview('/outbound/article/drupal.org');">documentation</a>. We made a Zen subtheme as a folder within Zen with their Starter Kit.</p>
<p><strong>Note:</strong> One big mistake I made when we started working on our subtheme was naming it &#8220;34st&#8221;. As it turns out, many of the theme override functions require you to name them THEMENAME_functionname. Unfortunately, PHP variables can&#8217;t start with numbers so after some frustration and griping I had to rename the subtheme.</p>
<h5>node-type.tpl.php</h5>
<div id="attachment_423" class="wp-caption alignright" style="width: 310px"><a href="http://albertsun.info/blog/wp-content/uploads/2008/11/picture-7.png" ><img class="size-medium wp-image-423" title="Node Variables" src="http://albertsun.info/blog/wp-content/uploads/2008/11/picture-7-300x133.png" alt="" width="300" height="133" /></a><p class="wp-caption-text">Content Templates provides a view of all available variables and example values.</p></div>
<p>Many places advise themers to use the Content Templates module to theme different content types. With Zen however, I found it much easier to just create files in the sub-template directory with certain naming conventions. For our article content type, a file named node-article.tpl.php themes it. For an issue, node-issue.tpl.php contains the theme. Since these files are theming a node, it&#8217;s possible to see all the variables in the array by simply doing a <code>&lt;?php print_r($node); ?&gt;</code> in a human-readable format. Content Templates, however can do the same thing, and with a much nicer interface.</p>
<p>For the most part, after finding all the appropriate variables, we simply plopped them into the appropriate places in the template. But, within these template files, we still have complete access to PHP and the entire Drupal API. Which of course means that I get lazy.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p406code4'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p4064"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code" id="p406code4"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
<span style="color: #666666; font-style: italic;">//Covering all the different numbers of bylines</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_byline</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_byline</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;article-byline&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;author-teaser-name-nodelink&quot;</span><span style="color: #339933;">&gt;</span>By <span style="color: #000000; font-weight: bold;">&lt;?php</span> <a href="http://www.php.net/print"><span style="color: #990000;">print</span></a> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_byline</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#93;</span> ?<span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_byline</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_byline</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_byline</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;article-byline&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;author-teaser-name-nodelink&quot;</span><span style="color: #339933;">&gt;</span>By <span style="color: #000000; font-weight: bold;">&lt;?php</span> <a href="http://www.php.net/print"><span style="color: #990000;">print</span></a> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_byline</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' and '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_byline</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> ?<span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_byline</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_byline</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_byline</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;article-byline&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;author-teaser-name-nodelink&quot;</span><span style="color: #339933;">&gt;</span>By <span style="color: #000000; font-weight: bold;">&lt;?php</span> 
	<span style="color: #000088;">$numauthors</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_byline</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<a href="http://www.php.net/print"><span style="color: #990000;">print</span></a> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_byline</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$numauthors</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<a href="http://www.php.net/print"><span style="color: #990000;">print</span></a> <span style="color: #0000ff;">', '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_byline</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> 
	<span style="color: #009900;">&#125;</span>
	<a href="http://www.php.net/print"><span style="color: #990000;">print</span></a> <span style="color: #0000ff;">' and '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_byline</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$numauthors</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">?&gt;</span>
	<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>That&#8217;s my code for handling all the different possibilities for multiple authors on a single article. For more elegant code, this should be higher up in the templating than the .tpl.php file, but it&#8217;s much easier this way.</p>
<h5>Teaser versus Full views</h5>
<div id="attachment_432" class="wp-caption aligncenter" style="width: 310px"><a href="http://albertsun.info/blog/wp-content/uploads/2008/11/picture-8.png" ><img class="size-medium wp-image-432" title="Content Type Field Display" src="http://albertsun.info/blog/wp-content/uploads/2008/11/picture-8-300x68.png" alt="For each field, one chooses how it will be displayed in the teaser, and in the full node." width="300" height="68" /></a><p class="wp-caption-text">For each field, one chooses how it will be displayed in the teaser, and in the full node.</p></div>
<p>For each field in a content type, you can choose two ways of displaying it. The Teaser is used when the node is being viewed on the front page, or in a section listing, and Full is the whole article is being read. Pretty self-explanatory. But it does mean that in each .tpl.php file you have to theme both. Here&#8217;s a sample.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p406code5'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p4065"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code" id="p406code5"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$teaser</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> 
	<span style="color: #666666; font-style: italic;">/*
	 * This case governs how articles show up in section page views, in the nodereferrer on authors,
	 * and everywhere else an article teaser (not on the front) is shown.
	 *
	 */</span>
<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$teaser</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>
	<span style="color: #666666; font-style: italic;">/*
	 * This case is for displaying the whole article on its own page.
	 *
	 */</span>
<span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>We also get other fun template variables like <code>$is_front</code> so we can do things like so.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p406code6'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p4066"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p406code6"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$teaser</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$is_front</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$teaser</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>
	<span style="color: #666666; font-style: italic;">/*
	 * This first case is for articles that are on the front page or in the sidebar.
	 * articles in the current issue. The second half of the OR only happens when node_view is
	 * manually called like node_view($node_object,$page=TRUE,$teaser=TRUE);
	 *
	 */</span></pre></td></tr></table></div>

<p>For reference, here&#8217;s the three different views of a single article.</p>
<div id="attachment_437" class="wp-caption alignnone" style="width: 132px"><a href="http://albertsun.info/blog/wp-content/uploads/2008/11/picture-91.png" ><img src="http://albertsun.info/blog/wp-content/uploads/2008/11/picture-91-122x300.png" alt="if ((($teaser) &#038;&#038; (!$page) &#038;&#038; ($is_front)) || (($page) &#038;&#038; ($teaser))):" title="Front Page" width="122" height="300" class="size-medium wp-image-437" /></a><p class="wp-caption-text">if ((($teaser) &#038;&#038; (!$page) &#038;&#038; ($is_front)) || (($page) &#038;&#038; ($teaser))):</p></div>
<div id="attachment_438" class="wp-caption alignnone" style="width: 310px"><a href="http://albertsun.info/blog/wp-content/uploads/2008/11/picture-10.png" ><img src="http://albertsun.info/blog/wp-content/uploads/2008/11/picture-10-300x107.png" alt="if (($teaser) &#038;&#038; (!$page)):" title="Section Page" width="300" height="107" class="size-medium wp-image-438" /></a><p class="wp-caption-text">if (($teaser) &#038;&#038; (!$page)):</p></div>
<div id="attachment_439" class="wp-caption alignnone" style="width: 310px"><a href="http://albertsun.info/blog/wp-content/uploads/2008/11/picture-11.png" ><img src="http://albertsun.info/blog/wp-content/uploads/2008/11/picture-11-300x217.png" alt="if (($page) &#038;&#038; (!$teaser)):" title="Full Page" width="300" height="217" class="size-medium wp-image-439" /></a><p class="wp-caption-text">if (($page) &#038;&#038; (!$teaser)):</p></div>
<h5>Importing Data</h5>
<p>We received our archives from College Publisher as a set of CSV files. My next post will address how we imported those archives.</p>
<p><em>What did you think of this post? Got more questions about our Drupal install? Leave a comment. The new website is <a href="http://34st.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/34st.com');">34th Street Magazine</a>, poke around and leave us some feedback!</em></p>
<h6>How we did it in Drupal, Part 2 of X</h6>
<ol>
<li><a href="http://albertsun.info/2008/10/how-we-did-it-in-drupal-pt-1-of-x/" >How we did it in Drupal, Pt. 1 of X - The Data Structure</a></li>
<li><a href="http://albertsun.info/2008/11/34th-street-launches-and-how-we-did-it-in-drupal-pt-2-of-x-theming-with-zen/" >How we did it in Drupal, Pt. 2 of X - Theming with Zen</a></li>
</ol>
<img src="http://feeds.feedburner.com/~r/albertgate/~4/457168722" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://albertsun.info/2008/11/34th-street-launches-and-how-we-did-it-in-drupal-pt-2-of-x-theming-with-zen/feed/</wfw:commentRss>
		<feedburner:origLink>http://albertsun.info/2008/11/34th-street-launches-and-how-we-did-it-in-drupal-pt-2-of-x-theming-with-zen/</feedburner:origLink></item>
		<item>
		<title>Holovaty’s Law of Online News</title>
		<link>http://feeds.feedburner.com/~r/albertgate/~3/432451975/</link>
		<comments>http://albertsun.info/2008/10/holovatys-law-of-online-news/#comments</comments>
		<pubDate>Sun, 26 Oct 2008 09:19:03 +0000</pubDate>
		<dc:creator>albert</dc:creator>
		
		<category><![CDATA[Journalism]]></category>

		<category><![CDATA[holovaty]]></category>

		<category><![CDATA[math]]></category>

		<category><![CDATA[online news]]></category>

		<category><![CDATA[structured information]]></category>

		<guid isPermaLink="false">http://albertsun.info/?p=397</guid>
		<description><![CDATA[Joshua Benton of the Nieman Journalism Lab at Harvard just coined a new term, &#8220;&#8220;Holovaty&#8217;s Law&#8221;, that I really like. Well, I believe he coined it because Google turns up no results for &#8220;Holovaty&#8217;s Law&#8221;.
The post linked as Holovaty&#8217;s Law, by the way, is a classic. If you haven&#8217;t read it and you&#8217;re interested in [...]]]></description>
			<content:encoded><![CDATA[<p>Joshua Benton of the Nieman Journalism Lab at Harvard just <a href="http://www.crabwalk.com/archive/2008/10/23/structure_might.php" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.crabwalk.com');">coined a new term</a>, &#8220;<a href="http://holovaty.com/blog/archive/2006/09/06/0307/" onclick="javascript:pageTracker._trackPageview('/outbound/article/holovaty.com');">&#8220;Holovaty&#8217;s Law&#8221;</a>, that I really like. Well, I believe he coined it because <a href="http://www.google.com/search?hl=en&#038;q=%22holovaty%27s+law%22&#038;btnG=Google+Search&#038;aq=f&#038;oq=" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.google.com');">Google turns up no results</a> for &#8220;Holovaty&#8217;s Law&#8221;.</p>
<p>The post linked as Holovaty&#8217;s Law, by the way, is a classic. If you haven&#8217;t read it and you&#8217;re interested in news and journalism at all, you need to.</p>
<p>Let me take the concept and run a little further with it. And thanks to Benton, the law already has it&#8217;s first corollary!</p>
<dl>
<dt>Theorem: Holovaty&#8217;s (First) Law of Online News</dt>
<dd>Adding structure to information makes it more valuable</dd>
<dt>1st Corollary</dt>
<dd>Adding structure to comments generates interesting data</dd>
</dl>
<p>Thoughts? Refinements? Other corollaries?</p>
<p><em>It seems like there&#8217;s a dearth of math geeks interested in journalism. Searches for <a href="http://www.google.com/search?hl=en&#038;safe=off&#038;q=%22law+of+online+news%22&#038;btnG=Search" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.google.com');">&#8220;law of online news&#8221;</a>, <a href="http://www.google.com/search?hl=en&#038;safe=off&#038;q=%22fundamental+theorem+of+online+news%22&#038;btnG=Search" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.google.com');">&#8220;fundamental theorem of online news&#8221;</a>, <a href="http://www.google.com/search?hl=en&#038;safe=off&#038;q=%22fundamental+theorem+of+online+journalism%22&#038;btnG=Search" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.google.com');">&#8220;fundamental theorem of online journalism&#8221;</a>, and <a href="http://www.google.com/search?hl=en&#038;safe=off&#038;q=%22law+of+online+journalism%22&#038;btnG=Search" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.google.com');">&#8220;law of online journalism&#8221;</a> all turn up nothing.</em></p>
<img src="http://feeds.feedburner.com/~r/albertgate/~4/432451975" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://albertsun.info/2008/10/holovatys-law-of-online-news/feed/</wfw:commentRss>
		<feedburner:origLink>http://albertsun.info/2008/10/holovatys-law-of-online-news/</feedburner:origLink></item>
		<item>
		<title>How we did it in Drupal, Pt. 1 of X - The Data Structure</title>
		<link>http://feeds.feedburner.com/~r/albertgate/~3/428096017/</link>
		<comments>http://albertsun.info/2008/10/how-we-did-it-in-drupal-pt-1-of-x/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 02:22:25 +0000</pubDate>
		<dc:creator>albert</dc:creator>
		
		<category><![CDATA[Journalism]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[cms]]></category>

		<category><![CDATA[daily pennsylvanian]]></category>

		<category><![CDATA[drupal]]></category>

		<category><![CDATA[street]]></category>

		<guid isPermaLink="false">http://albertsun.info/?p=382</guid>
		<description><![CDATA[I wrote before about the new 34th Street Magazine website being in Alpha.
This is the first post of a series on what we did to Drupal to make it behave the way we want it to, how we implemented different features and to ask for feedback and advice on how to do future features.
To start [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote <a href="http://albertsun.info/2008/10/alpha-of-new-dp-website-on-drupal/" >before</a> about the new 34th Street Magazine website being in Alpha.</p>
<p>This is the first post of a series on what we did to Drupal to make it behave the way we want it to, how we implemented different features and to ask for feedback and advice on how to do future features.</p>
<p>To start out understanding Drupal, it&#8217;s important to understand that Drupal was designed and the developer&#8217;s focus is largely on creating flexible websites for communities, NOT for publishing or blogging. For instance, there isn&#8217;t a natural distinction between readers and administrators among the user roles. (Adding content is at node/add/* not admin/*) A lot of the work involved in setting up a site on Drupal is to work around the default values and settings and make it behave the way you want to.</p>
<p>Part of the joy of using Wordpress is that it&#8217;s defined for a very specific purpose and all the development work that goes into it is designed to make it easier to blog. With Wordpress, it takes very little work to go from a default install to writing your first post.</p>
<p>That&#8217;s not true for Drupal. No one would use Drupal with only its core functionality and the default settings. But with a little work, it becomes much, much more powerful and better suited for publishing a news website than Wordpress.</p>
<p>The problem I&#8217;m still struggling with now is how to import data into Drupal&#8217;s database. The database structure is quite complex compared to our current site, or a Wordpress site, but luckily the Content Construction Kit abstracts all of that when the site is being built. And that&#8217;s the topic of today&#8217;s post.</p>
<h5>Nodes, Users and Custom Content Types!</h5>
<p>Everything in our system is a node. Stories. Slideshows. Sections. Authors. Issues.</p>
<div id="attachment_384" class="wp-caption aligncenter" style="width: 310px"><a href="http://albertsun.info/blog/wp-content/uploads/2008/10/picture-4.png" ><img class="size-medium wp-image-384" title="Content types" src="http://albertsun.info/blog/wp-content/uploads/2008/10/picture-4-300x154.png" alt="Content types" width="300" height="154" /></a><p class="wp-caption-text">Content types</p></div>
<p>The <acronym title="Content Construction Kit">CCK</acronym> module lets us define all the different information each node needs and tie authors to articles and articles to sections and issues with node reference fields. Each content type is themed separately with a different template and the different ways that piece of content can be viewed are defined by a set of boolean PHP variables.</p>
<p>Our site uses the following CCK content types.</p>
<div id="attachment_385" class="wp-caption alignright" style="width: 310px"><a href="http://albertsun.info/blog/wp-content/uploads/2008/10/picture-5.png" ><img class="size-medium wp-image-385" title="Article submission" src="http://albertsun.info/blog/wp-content/uploads/2008/10/picture-5-300x123.png" alt="Article submission" width="300" height="123" /></a><p class="wp-caption-text">Article submission</p></div>
<li><strong>Article</strong> - One article of the magazine. Articles have headlines, sub-headlines, date, image, related file and other fields defined in CCK. Articles also have node reference fields to identify who the authors of the article and what section the article is in.</li>
<li><strong>Issue</strong> - One issue of the magazine, corresponds to the print issue. An issue is a collection of node reference fields that point to different articles. Certain fields of the issue are mapped to different slots on the front page of the site.</li>
<li><strong>Photo Gallery</strong> - For photo essays or instances in which the image is the primary focus of the story. Behaves like an article in every other way.</li>
<li><strong>Author</strong> - Everybody who writes a story is an author node. These are not related to users in the system at all, as not every writer will have an account on the website and not every one with an account on the website will be a writer. It also means that we don&#8217;t have to worry about deleting user accounts after writers graduate or leave. And while we haven&#8217;t done it yet, it would let us create author profiles so our writers can each have a portfolio page that&#8217;s more than just a listing of articles.</li>
<li><strong>Section</strong> - A section of the website, these are done as nodes instead of as a taxonomy term for largely the same reasons as authors are.</li>
<li><strong>Overheard at Penn</strong> - Overheard at Penn is a series of short snippets of overheard conversation. This is a very basic content type with just a single text field.</li>
<li><strong>PDF Version</strong> - A PDF of the print edition of the website. Created using the File Field module.</li>
<li><strong>Page</strong> - A simple static page.</li>
<li><strong>Newsletter Issue</strong> - The Simplenews module allows for the creation of newsletters. This content type creates a newsletter with a node reference to the issue to be sent, and generates e-mails. It&#8217;s also integrated into the user accounts system, so everyone who is registered to receive the newsletter also has an account on the website to comment or for any user generated content areas we might decide to create in the future. Theming newsletters and HTML emails was an incredible pain in the butt, but that&#8217;s the subject of another post.</li>
<h5>At the database level</h5>
<div id="attachment_386" class="wp-caption alignright" style="width: 261px"><a href="http://albertsun.info/blog/wp-content/uploads/2008/10/picture-31.png" ><img src="http://albertsun.info/blog/wp-content/uploads/2008/10/picture-31-251x300.png" alt="Creating a new field" title="Creating a new field" width="251" height="300" class="size-medium wp-image-386" /></a><p class="wp-caption-text">Creating a new field</p></div>
<p>When creating fields and content types, this is all you see. Pick data types and title them. For the most part, the rest of the process is completely opaque. To learn more about the database structure of CCK, there&#8217;s documentation in greater detail <a href="http://drupal.org/node/82661" onclick="javascript:pageTracker._trackPageview('/outbound/article/drupal.org');">here</a>.</p>
<p>There are several tables that store data for CCK fields.</p>
<ul>
<li><strong>node</strong> - This table stores the unique nid of the node, and what type it is.</li>
<li><strong>node_revisions</strong> - This table stores the body content of the node, as well as data about which user created it, when it was revised and what&#8217;s in the teaser.</li>
<li><strong>content_type_[type]</strong> - If a content type has fields that are only used by that content type, this table contains the values of that field.</li>
<li><strong>content_field_[field]</strong> - Contains the values of that field.</li>
</ul>
<h5>Theming</h5>
<p>A lot of the heavy lifting in Drupal is done at the theming layer. Luckily <a href="http://drupal.org/project/zen" onclick="javascript:pageTracker._trackPageview('/outbound/article/drupal.org');">Zen</a> makes it all much easier. That&#8217;s what I&#8217;ll be writing about next time. Some of the other upcoming posts will address how we handle images (Imagecache and CCK), how we theme our newsletters and how we handle multimedia.</p>
<p><em>What did you think of this post? Got more questions about our Drupal install? Leave a comment. The new website is at http://beta.34st.com, poke around and leave us some feedback!</em></p>
<h6>How we did it in Drupal, Part 1 of X</h6>
<ol>
<li><a href="http://albertsun.info/2008/10/how-we-did-it-in-drupal-pt-1-of-x/" >How we did it in Drupal, Pt. 1 of X - The Data Structure</a></li>
<li><a href="http://albertsun.info/2008/11/34th-street-launches-and-how-we-did-it-in-drupal-pt-2-of-x-theming-with-zen/" >How we did it in Drupal, Pt. 2 of X - Theming with Zen</a></li>
</ol>
<img src="http://feeds.feedburner.com/~r/albertgate/~4/428096017" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://albertsun.info/2008/10/how-we-did-it-in-drupal-pt-1-of-x/feed/</wfw:commentRss>
		<feedburner:origLink>http://albertsun.info/2008/10/how-we-did-it-in-drupal-pt-1-of-x/</feedburner:origLink></item>
		<item>
		<title>Simple, but useful Drupal module</title>
		<link>http://feeds.feedburner.com/~r/albertgate/~3/422286572/</link>
		<comments>http://albertsun.info/2008/10/simple-but-useful-drupal-module/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 04:45:34 +0000</pubDate>
		<dc:creator>albert</dc:creator>
		
		<category><![CDATA[Journalism]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[drupal]]></category>

		<category><![CDATA[indesign]]></category>

		<category><![CDATA[publishing]]></category>

		<guid isPermaLink="false">http://albertsun.info/?p=367</guid>
		<description><![CDATA[In the course of developing Drupal for the DP, we&#8217;ve been fortunate that we&#8217;ve had to write very little (themeing layer excepted) from scratch. Chalk it up to to the strength and robustness of the Drupal community that nearly every function we wanted, there was a module for.
One module that I did have to write [...]]]></description>
			<content:encoded><![CDATA[<p>In the course of developing Drupal for the DP, we&#8217;ve been fortunate that we&#8217;ve had to write very little (themeing layer excepted) from scratch. Chalk it up to to the strength and robustness of the Drupal community that nearly every function we wanted, there was a module for.</p>
<p>One module that I did have to write from scratch was to replicate a function from College Publisher. After copy and pasting a story into CP&#8217;s interface, there was a button run all that doubled the line breaks, among other things.</p>
<p>Drupal wraps text separated by two line breaks with &lt;p&gt; tags and uses the &lt;br /&gt; tag to in-between text separated by one line break. By default, text copied out of InCopy only has one line break between paragraphs.</p>
<p>When <a href="http://seanblanda.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/seanblanda.com');">Sean Blanda</a> posted about the Temple News moving to Wordpress, this was one of the <a href="http://seanblanda.com/blog/temple-news/the-6-problems-im-having-with-our-move-to-wpmu-can-you-help/" onclick="javascript:pageTracker._trackPageview('/outbound/article/seanblanda.com');">6 problems he laid out as having</a>.<br />
<span id="more-367"></span><br />
All this does is convert those single line breaks into two. Not substantial enough to really commit to Drupal.org, but dead useful since we don&#8217;t want to futz around with a WYSIWYG editor.</p>
<p><a href="http://albertsun.info/blog/wp-content/uploads/2008/10/runall.tar.gz" onclick="javascript:pageTracker._trackPageview('/downloads/blog/wp-content/uploads/2008/10/runall.tar.gz');">Download the Run All Module</a></p>
<p>It should be relatively simple to turn into a TinyMCE plug-in for Wordpress too, but that will come after midterms and all the other work facing me.</p>
<img src="http://feeds.feedburner.com/~r/albertgate/~4/422286572" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://albertsun.info/2008/10/simple-but-useful-drupal-module/feed/</wfw:commentRss>
		<feedburner:origLink>http://albertsun.info/2008/10/simple-but-useful-drupal-module/</feedburner:origLink></item>
		<item>
		<title>Alpha of new DP website on Drupal</title>
		<link>http://feeds.feedburner.com/~r/albertgate/~3/418887035/</link>
		<comments>http://albertsun.info/2008/10/alpha-of-new-dp-website-on-drupal/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 21:02:51 +0000</pubDate>
		<dc:creator>albert</dc:creator>
		
		<category><![CDATA[Journalism]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[college publisher]]></category>

		<category><![CDATA[daily pennsylvanian]]></category>

		<category><![CDATA[drupal]]></category>

		<category><![CDATA[street]]></category>

		<guid isPermaLink="false">http://albertsun.info/?p=359</guid>
		<description><![CDATA[Exciting news on the CMS front.
As some may know, The Daily Pennsylvanian web staff and I have been working on using Drupal to run our website and as a replacement for College Publisher on and off since the spring. The first part of that process is now nearly done and we have a nearly complete [...]]]></description>
			<content:encoded><![CDATA[<p>Exciting news on the <acronym title="Content Management System">CMS</acronym> front.</p>
<div id="attachment_363" class="wp-caption alignright" style="width: 310px"><a href="http://albertsun.info/blog/wp-content/uploads/2008/10/picture-11.png" ><img class="size-medium wp-image-363" title="Alpha screenshot" src="http://albertsun.info/blog/wp-content/uploads/2008/10/picture-11-300x203.png" alt="34th Street Alpha" width="300" height="203" /></a><p class="wp-caption-text">34th Street Alpha</p></div>
<p>As some may know, The Daily Pennsylvanian web staff and I have been working on using Drupal to run our website and as a replacement for College Publisher on and off since the spring. The first part of that process is now nearly done and we have a nearly complete website for our magazine 34th Street!</p>
<p>We made the decision to go ahead and develop and launch a site in Drupal a few weeks ago and since then have been in a somewhat hectic mode scrambling to get all the launch features ready. A great deal of thanks goes to the folks who made the New York Observer site happen and <a href="http://drupal.org/nyobserver" onclick="javascript:pageTracker._trackPageview('/outbound/article/drupal.org');">wrote up</a> how they did it.</p>
<p>Now it&#8217;s on to testing and training the other editors on how to use the system and looking for places to make the site work better, and make publishing easier. We also have to write a complete set of documentation for future and current editors on how to use the system, how to modify it, how to deal with Drupal upgrades and what to do in case things go wrong.<br />
<span id="more-359"></span><br />
For college newspapers, a huge issue is continuity and if we were going to run our own site it was decided that we would have to do it right with plans and provisions in place to deal with continuity problems once the current staff and I leave.</p>
<p>This Friday, we received our archive of articles and media files from College Publisher and will be spending time importing them into the new site. It could get a little hairy, as the College Publisher data structure is quite different from Drupal&#8217;s database structure.</p>
<p>At the beginning of the process, there was also a conscious decision that everything we did would be open sourced and given to the community. I spent much of last night trying to bundle up our current install into a Drupal installation profile, but quickly realized that generalizing our work and packaging it is a highly non-trivial task that I don&#8217;t have a whole lot of time for right now.</p>
<p>We&#8217;re still committed to doing it, it&#8217;ll just be a little longer.</p>
<p>If you want to see the new site, are willing to provide feedback and I know who you are or someone who knows who you are, get in touch and I&#8217;ll set up an account for you so you can see the site and the inner workings.</p>
<p>Now, I&#8217;m off to celebrate Canadian Thanksgiving! =)</p>
<img src="http://feeds.feedburner.com/~r/albertgate/~4/418887035" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://albertsun.info/2008/10/alpha-of-new-dp-website-on-drupal/feed/</wfw:commentRss>
		<feedburner:origLink>http://albertsun.info/2008/10/alpha-of-new-dp-website-on-drupal/</feedburner:origLink></item>
		<item>
		<title>Welcome to the new blog!</title>
		<link>http://feeds.feedburner.com/~r/albertgate/~3/418306607/</link>
		<comments>http://albertsun.info/2008/10/welcome-to-the-new-blog/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 03:52:00 +0000</pubDate>
		<dc:creator>albert</dc:creator>
		
		<category><![CDATA[This Blog]]></category>

		<category><![CDATA[archive]]></category>

		<category><![CDATA[blogger]]></category>

		<category><![CDATA[search traffic]]></category>

		<category><![CDATA[webfaction]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://albert.webfactional.com/?p=351</guid>
		<description><![CDATA[Every post you see before this one (one exception) is imported from my old blog at http://albertgate.blogspot.com. This shiny new site is hosted by WebFaction and I&#8217;ve been very happy with them so far even if at $9.50 a month it&#8217;s a tad expensive for hosting a personal site. Their servers will let me play [...]]]></description>
			<content:encoded><![CDATA[<p>Every post you see before this one (one exception) is imported from my old blog at http://albertgate.blogspot.com. This shiny new site is hosted by WebFaction and I&#8217;ve been very happy with them so far even if at $9.50 a month it&#8217;s a tad expensive for hosting a personal site. Their servers will let me play around with things like SVN and Django.<br />
<span id="more-351"></span><br />
That&#8217;ll stick around, I still get a steady stream of search traffic from people looking for <a href="http://albertgate.blogspot.com/2007/06/sundia-basketball-team.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/albertgate.blogspot.com');">basketball jerseys</a>, <a href="http://albertgate.blogspot.com/2006/10/xiao-ding-dang-doraemon.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/albertgate.blogspot.com');">xiao ding dang</a> and <a href="http://albertgate.blogspot.com/2007/08/toilet-to-urinal-ratio-in-mens-and.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/albertgate.blogspot.com');">toilet to people ratios</a>.</p>
<p>It&#8217;s fall break at Penn right now. In the next few days I&#8217;m going to come back and post more. I&#8217;ve been kind of swamped by work (that old excuse) and haven&#8217;t had time.</p>
<p>For now, (until the DNS change is fully propagated) the feed from this blog will not be be burned where the feed from my Blogger site is. After that I&#8217;ll start redirecting them.</p>
<p>Other todos for the blog. Go back and tag/categorize posts.</p>
<img src="http://feeds.feedburner.com/~r/albertgate/~4/418306607" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://albertsun.info/2008/10/welcome-to-the-new-blog/feed/</wfw:commentRss>
		<feedburner:origLink>http://albertsun.info/2008/10/welcome-to-the-new-blog/</feedburner:origLink></item>
		<item>
		<title>Freshly Imported</title>
		<link>http://feeds.feedburner.com/~r/albertgate/~3/418306608/</link>
		<comments>http://albertsun.info/2008/09/freshly-imported/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 06:24:59 +0000</pubDate>
		<dc:creator>albert</dc:creator>
		
		<category><![CDATA[This Blog]]></category>

		<category><![CDATA[blogger]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://albert.webfactional.com/blog/?p=268</guid>
		<description><![CDATA[Posts from my previous blog at albertgate.blogspot.com are freshly imported! Unfortunately though, no comments from about the middle of 2006 until now were imported.
This blog still needs lots of work before I start linking it around though.
]]></description>
			<content:encoded><![CDATA[<p>Posts from my previous blog at albertgate.blogspot.com are freshly imported! Unfortunately though, no comments from about the middle of 2006 until now were imported.</p>
<p>This blog still needs lots of work before I start linking it around though.</p>
<img src="http://feeds.feedburner.com/~r/albertgate/~4/418306608" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://albertsun.info/2008/09/freshly-imported/feed/</wfw:commentRss>
		<feedburner:origLink>http://albertsun.info/2008/09/freshly-imported/</feedburner:origLink></item>
		<item>
		<title>Working Around College Publisher - Making a Related Links block</title>
		<link>http://feeds.feedburner.com/~r/albertgate/~3/418306609/</link>
		<comments>http://albertsun.info/2008/08/working-around-college-publisher-making-a-related-links/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 01:00:59 +0000</pubDate>
		<dc:creator>bloggeralbert</dc:creator>
		
		<category><![CDATA[Journalism]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://albertsun.wordpress.com/?p=348</guid>
		<description><![CDATA[Since College Publisher doesn&#8217;t give its clients access to their own databases or the web server, to do many things (like adding any new feature) requires working around it on auxiliary servers they provide running LAMP.
One feature that CP desperately needs is the ability to create a block of related stories.
So I struggled with the [...]]]></description>
			<content:encoded><![CDATA[<p>Since College Publisher doesn&#8217;t give its clients access to their own databases or the web server, to do many things (like adding any new feature) requires working around it on auxiliary servers they provide running LAMP.</p>
<p>One feature that CP desperately needs is the ability to create a block of related stories.</p>
<p>So I struggled with the problem a little bit and created a little script to let totally non-tech savvy editors create a block of code to paste in.</p>
<p>You can see a demo of it here.</p>
<p><a href="http://lamp.dailypennsylvanian.com/relatedlinks/" onclick="javascript:pageTracker._trackPageview('/outbound/article/lamp.dailypennsylvanian.com');">Related links generator</a></p>
<p>The source code is here. To run it, your server must allow fopen to open url&#8217;s.</p>
<p><a href="http://lamp.dailypennsylvanian.com/relatedlinks/cprelatedlinks.tar.gz" onclick="javascript:pageTracker._trackPageview('/outbound/article/lamp.dailypennsylvanian.com');">Source</a></p>
<p>This is the first time I&#8217;ve released the code of anything I&#8217;ve written, so give me some feedback!</p>
<img src="http://feeds.feedburner.com/~r/albertgate/~4/418306609" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://albertsun.info/2008/08/working-around-college-publisher-making-a-related-links/feed/</wfw:commentRss>
		<feedburner:origLink>http://albertsun.info/2008/08/working-around-college-publisher-making-a-related-links/</feedburner:origLink></item>
		<item>
		<title>The biggest challenge facing a young journalist in today’s meda is the old media isn’t dying fast enough</title>
		<link>http://feeds.feedburner.com/~r/albertgate/~3/418306610/</link>
		<comments>http://albertsun.info/2008/08/the-biggest-challenge-facing-a-young-journalist-in-today%e2%80%99s-meda-is-the-old-media-isnt-dying-fast-enough/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 06:21:00 +0000</pubDate>
		<dc:creator>bloggeralbert</dc:creator>
		
		<category><![CDATA[Journalism]]></category>

		<guid isPermaLink="false">http://albertsun.wordpress.com/2008/08/21/the-biggest-challenge-facing-a-young-journalist-in-today%e2%80%99s-meda-is-the-old-media-isnt-dying-fast-enough/</guid>
		<description><![CDATA[The dream jobs for today&#8217;s journalists are largely the same as they have always been. The rule was, and still is, the larger the circulation and the more often they publish the better.
As long as this is the case, that&#8217;s where all the young talent will go. Unfortunately, right now those are the worst possible [...]]]></description>
			<content:encoded><![CDATA[<p>The dream jobs for today&#8217;s journalists are largely the same as they have always been. The rule was, and still is, the larger the circulation and the more often they publish the better.</p>
<p>As long as this is the case, that&#8217;s where all the young talent will go. Unfortunately, right now those are the worst possible places for them to end up.</p>
<p><strong>An awkward transition</strong></p>
<p>In my last post, I wrote recommended some ideas for <a href="http://albertgate.blogspot.com/2008/08/9-ways-that-newspapers-can-make-money.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/albertgate.blogspot.com');">new revenue</a> to fill the chasm between declining print and rising online ad revenue.</p>
<p>Now I worry that even with as much innovation as they can muster the valiant struggle to save the medium and the famous mastheads will be a fight that is inevitably lost, and the old media dinosaurs will just die by ice age instead of asteroid.</p>
<p>Maybe it would just be best to let them die quickly.</p>
<p><strong>Death of a paper</strong></p>
<p>I link to Mark Potts a lot, but he is amazingly incisive. He&#8217;s written a <a href="http://recoveringjournalist.typepad.com/recovering_journalist/2008/08/what-will-happen-when-the-presses-go-silent.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/recoveringjournalist.typepad.com');">speculative piece</a> about what will happen in the aftermath of a major metro daily&#8217;s bankruptcy.</p>
<p>What will happen is the other news sources will have to step up and be more entrepreneurial. The bloggers and TV news and the alt weekly will all have to do more original reporting. New startups will spring up, run by the laid off staffers to focus on local news. Most importantly, it will give everyone a sense of entrepreneurial drive that a slowly dying organizing can never have.</p>
<p>To fill the gap for readers and advertisers left by a newspaper dying a whole new media ecosystem of content producers and distributors will spring up.</p>
<p>That&#8217;s where young journalists should be. We should be at startups, innovating and experimenting and taking stupid risks. Doing exactly the kinds of things a risk averse newspaper bleeding to death and busy slashing jobs won&#8217;t do.</p>
<p>So the biggest challenge facing young journalists is our own mindset prizing the old media over new.</p>
<img src="http://feeds.feedburner.com/~r/albertgate/~4/418306610" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://albertsun.info/2008/08/the-biggest-challenge-facing-a-young-journalist-in-today%e2%80%99s-meda-is-the-old-media-isnt-dying-fast-enough/feed/</wfw:commentRss>
		<feedburner:origLink>http://albertsun.info/2008/08/the-biggest-challenge-facing-a-young-journalist-in-today%e2%80%99s-meda-is-the-old-media-isnt-dying-fast-enough/</feedburner:origLink></item>
		<item>
		<title>9 ways that newspapers can make money that aren’t advertising</title>
		<link>http://feeds.feedburner.com/~r/albertgate/~3/418306611/</link>
		<comments>http://albertsun.info/2008/08/9-ways-that-newspapers-can-make-money-that-arent-advertising/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 00:58:00 +0000</pubDate>
		<dc:creator>bloggeralbert</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://albertsun.wordpress.com/2008/08/15/9-ways-that-newspapers-can-make-money-that-arent-advertising/</guid>
		<description><![CDATA[The business model is still the elephant model in the room, as Ryan Sholin writes.
All the new media in the world won&#8217;t save the media, if they can&#8217;t figure out how to make money off of it. Will advertising be enough? At the very least there&#8217;s a deep chasm to cross, according to some analysis [...]]]></description>
			<content:encoded><![CDATA[<p>The business model is still the elephant model in the room, as <a href="http://ryansholin.com/2008/07/24/the-business-model-is-still-the-elephant-in-the-room/" onclick="javascript:pageTracker._trackPageview('/outbound/article/ryansholin.com');">Ryan Sholin writes</a>.</p>
<p>All the new media in the world won&#8217;t save the media, if they can&#8217;t figure out how to make money off of it. Will advertising be enough? At the very least there&#8217;s a deep chasm to cross, according to some analysis Mark Potts <a href="http://recoveringjournalist.typepad.com/recovering_journalist/2007/11/the-chasm.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/recoveringjournalist.typepad.com');">did</a>.</p>
<p>And so since social networks and Web 2.0 companies can serve up page views far cheaper than media companies, it&#8217;s time to look at some alternate business models.</p>
<ol>
<li>Merchandising</li>
<p><img style="float:right;margin:0 0 10px 10px;" src="http://2.bp.blogspot.com/_RsXY3edMJyA/SKTWiDTzC7I/AAAAAAAAADY/jylgNj5xBP8/s320/Picture+2.png" border="0" alt="" /><br />
CNN already <a href="http://www.cnn.com/tshirt/archive/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.cnn.com');">does it</a>. Web comics do it. Randall Munroe writer of xkcd and his roommate make a living purely off of merchandising, according to his <a href="http://www.nytimes.com/2008/05/26/business/media/26link.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.nytimes.com');">New York Times profile</a>. xkcd attracts a huge audience but runs no advertising. So sell some t-shirts and sweatshirts with a masthead or a logo on it. Or with headlines. Or let people custom order t-shirts with photos from the paper on it. Or framed copies of stories about them or that they were quoted in. Okay, lots of papers do sell photos, but they&#8217;re mostly impossible to find unless you&#8217;re specifically looking for them so most readers never find it. There should at least be a link by every photo that runs. The Harvard Crimson does <a href="http://www.thecrimson.com/photo_gallery.aspx?section=1" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.thecrimson.com');">this</a>.</p>
<li>Consulting</li>
<p>Among journalists&#8217; skills is the ability to ferret out and synthesize a lot of information and then package it succinctly. Hey, that sounds like exactly the skills needed for a corporate report or to do background research on a new business proposal. Beyond that, they are supposed to be experts in the fields they cover. So let companies or individuals hire journalists as consultants to provide advice or do research for an hourly rate. a HIGH hourly rate.</p>
<li>Briefings</li>
<p>Similar to number two, journalists are supposed to be good at presenting a lot of information in an easy to digest format. How then, did they give up the ENTIRE market analysis field. GigaOm is <a href="http://briefings.gigaom.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/briefings.gigaom.com');">getting into it</a> with a briefing on cloud computing priced at $250 a copy. So is <a href="http://www.paidcontent.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.paidcontent.org');">paidContent.org</a> with reports on <a href="http://www.paidcontent.org/reports/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.paidcontent.org');">Social Media and Online Gaming in China for $399</a>. Look at <a href="http://www.marketresearch.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.marketresearch.com');">MarketResearch.com</a>. They have reports (information) on a huge range of topics that people are buying at prices from several hundred dollars, to several thousand!   Think about all the extra information that&#8217;s routinely gathered in the course of reporting a big story. While it&#8217;s cut to make the final piece easier to read for a mass audience, there&#8217;s also an audience that will pay for a much more in depth look.</p>
<p>Every local newspaper should have a &#8220;How to open a retail franchise in X&#8221; with information on the retail climate, traffic patterns and other local knowledge. There should be an &#8220;Area private schools: where to send your kid&#8221;. And more. Compile that information, make it easy to digest, and sell it. But of course, if you&#8217;re going to charge it better be damn good.</p>
<li>Sell Timeliness</li>
<p>For some people timeliness of information is absolutely crucial. Think professional investors, politicians, corporate executives.<br />
So set up a system to let them see any news that is being broken first. Even just a few hours. Let&#8217;s say some news organization got a scoop that Steve Jobs&#8217; cancer is returning. That information would be priceless to someone investing in Apple stock. Or if a strike is brewing at XYZ company, or congressman is taking bribes. There are all sorts of information where getting it even a tiny margin sooner than others is invaluable. Or just to brag to friends. Of course, this only works if the newspaper is regularly breaking news.</p>
<li>Deeper sponsorships</li>
<p>There are certain kinds of stories that happen regularly. Crime statistics. Holiday shopping numbers. Weather. So sell advertising tied into it. &#8220;This crime report brought to you by Mace&#8221; &#8220;This consumer spending report brought to you by Target&#8221;.</p>
<li>Get serious about local communities</li>
<p>Don&#8217;t just sponsor events, organize them. Conferences for local businesses. Food tastings from local restaurants. Reading in the park with local authors. Meet local sports stars. Reunion concert for musical acts that got their start locally. Movie screenings. Class action lawsuits. Debates and townhall meetings. Then sell sponsorships and tickets.</p>
<p>GigaOm is a great <a href="http://gigaomnimedia.com/events/" onclick="javascript:pageTracker._trackPageview('/outbound/article/gigaomnimedia.com');">example</a> of this again. They sponsor three conferences in the area they cover to which tickets are quite expensive. But they are good, well produced events that not only generate a ton of buzz for them, but serve an important function in the community. The Wall Street Journal is getting into it too with their <a href="http://allthingsd.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/allthingsd.com');">All Things D</a> conference.</p>
<li>Get serious about your online community</li>
<p><img style="float:right;margin:0 0 10px 10px;" src="http://3.bp.blogspot.com/_RsXY3edMJyA/SKTYEnoueeI/AAAAAAAAADg/BXEUKlUX4GA/s320/Picture+5.png" border="0" alt="" /><br />
Look at how <a href="http://arstechnica.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/arstechnica.com');">Ars Technica</a> does it. They have an amazing online <a href="http://episteme.arstechnica.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/episteme.arstechnica.com');">community</a> that has thrived for years and produced millions of posts. The participants on their forums discuss every topic, related to their articles and not. They have classifieds, technical talk, sex, all sorts of random things. People consider the Ars forums their HOME on the internet. That&#8217;s because it&#8217;s community moderated and idiots get thrown out. Those interested in building online communities would do well to look to the online forums that have been around for so long as a good model. With as much good will as they have from their community, Ars can <a href="http://arstechnica.com/site/subscribe.ars" onclick="javascript:pageTracker._trackPageview('/outbound/article/arstechnica.com');">sell subscriptions</a> giving things that cost Ars NOTHING. Like adding &#8220;et Subscriptor&#8221; to the end of a profile name. Or posting privileges in a private forum. Or the ability to post in html. People are paying $50 for status symbols in the community.</p>
<li>Pay what you will model</li>
<p>Like Radiohead famously did for their album In Rainbows. &#8220;Sell&#8221; your subscriptions for online (or Mobile or Kindle or heck, even print) for however much customers decide they want to pay.</p>
<li>Remember customer service</li>
<p>Who are your customers? Advertisers. What service are you providing to them? Reaching their customers. Selling more display ads isn&#8217;t always the best way of doing that. If you can help your advertisers succeed you will too.</ol>
<p>Some of these may be infeasible, or even unethical so tear em apart and come up with better ones.</p>
<img src="http://feeds.feedburner.com/~r/albertgate/~4/418306611" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://albertsun.info/2008/08/9-ways-that-newspapers-can-make-money-that-arent-advertising/feed/</wfw:commentRss>
		<feedburner:origLink>http://albertsun.info/2008/08/9-ways-that-newspapers-can-make-money-that-arent-advertising/</feedburner:origLink></item>
	</channel>
</rss>
