<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Hammock &#187; Drupal</title>
	<atom:link href="http://juanpatten.com/category/drupal/feed/" rel="self" type="application/rss+xml" />
	<link>http://juanpatten.com</link>
	<description>Hey. I&#039;m J.R. and this is...</description>
	<lastBuildDate>Sat, 10 Jul 2010 15:09:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Displaying an Argument in a Drupal View&#8217;s Header</title>
		<link>http://juanpatten.com/2009/displaying-an-argument-in-a-drupal-views-header/</link>
		<comments>http://juanpatten.com/2009/displaying-an-argument-in-a-drupal-views-header/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 02:58:05 +0000</pubDate>
		<dc:creator>JR Patten</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://juanpatten.com/?p=172</guid>
		<description><![CDATA[Let&#8217;s say you have a view in which you take in an argument you use for filtering content. That&#8217;s very easy, but what if you also want to display, say, &#8220;Most Recent {ARGUMENT}&#8221; before the list of content? It&#8217;s not &#8230; <a href="http://juanpatten.com/2009/displaying-an-argument-in-a-drupal-views-header/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you have a view in which you take in an argument you use for filtering content. That&#8217;s very easy, but what if you also want to display, say, &#8220;Most Recent {ARGUMENT}&#8221; before the list of content? It&#8217;s not as easy as it seems like it should be. It would be nice if there were a token-based solution, but the best way I can find is to use PHP in the view header.</p>
<p>You&#8217;ll need to enable the PHP Filter module, which is a core module that comes with Drupal.</p>
<p>I got this method from <a href="http://drupal.org/node/344333#comment-1187695">this comment</a>, but I thought I&#8217;d repeat it here so that it will be easier to find for someone in the future. This takes the argument, turns the &#8216;-&#8217;s into spaces, and capitalizes every word. You may only want to do some of that, or something else, but it demonstrates how to get the argument to do with what you wish.</p>
<pre>$view-&gt;args</pre>
<p>is an array of the arguments in the request.</p>
<p>Here&#8217;s the code:</p>
<pre>&lt;h2&gt;Recent
    &lt;strong&gt;
        &lt;?php
            $view = views_get_current_view();
            print ucwords(str_replace('-', ' ',$view-&gt;args[0]));
        ?&gt;
    &lt;/strong&gt;
&lt;/h2&gt;</pre>
<p><em>Do you know of a better way? Maybe one without having to use raw PHP in your view? That&#8217;s what the comments are for! (and thanks)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://juanpatten.com/2009/displaying-an-argument-in-a-drupal-views-header/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
