<?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>UnDeprived &#187; wordpress plugins</title>
	<atom:link href="http://www.un-deprived.com/tag/wordpress-plugins/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.un-deprived.com</link>
	<description>A webdev journal of the Moninator</description>
	<lastBuildDate>Fri, 30 Jul 2010 10:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Pods CMS: Magic Tag</title>
		<link>http://www.un-deprived.com/2009/webdev/pods-cms-magic-tag/</link>
		<comments>http://www.un-deprived.com/2009/webdev/pods-cms-magic-tag/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 12:32:48 +0000</pubDate>
		<dc:creator>Mon</dc:creator>
				<category><![CDATA[Pods CMS]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[Magic Tags]]></category>
		<category><![CDATA[PICK column]]></category>
		<category><![CDATA[pods]]></category>
		<category><![CDATA[pods cms]]></category>
		<category><![CDATA[wordpress plugins]]></category>

		<guid isPermaLink="false">http://www.un-deprived.com/?p=357</guid>
		<description><![CDATA[This is going to be a short post. Magic Tags are very awesome, but on the Pods CMS documentation failed to mention something very simple yet useful. Before anything, here’s a quick run down of what Magic Tags are… Software Note: Pods CMS 1.7.3 / WP 2.8.4 Documentation: http://pods.uproot.us/codex/magic_tags What are Magic Tags From Pods [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>This is going to be a short post. Magic Tags are very awesome, but on the Pods CMS documentation failed to mention something very simple yet useful. Before anything, here’s a quick run down of what Magic Tags are…</p>
<p><span id="more-357"></span></p>
<p><strong>Software Note</strong>: <a href='http://pods.uproot.us/' target='_blank'>Pods CMS</a> 1.7.3 / WP 2.8.4</p>
<p><strong>Documentation</strong>: <a href="http://pods.uproot.us/codex/magic_tags">http://pods.uproot.us/codex/magic_tags</a></p>
<p><strong>What are Magic Tags</strong></p>
<p>From Pods CMS’ documentation: Magic Tags are used exclusively within <strong>Pod templates</strong> to dynamically pull in column values.</p>
<p><strong>Usage:</strong> {@column_name} / {@column_name,display_helper}</p>
<p><strong>In addition to the documentation:</strong> {@column_name.another_column_name}</p>
<p>The above method allow you access a different Pod’s columns when it is a PICK column inside a pod.</p>
<p>Let’s say you have to two pods. The <em>Person</em> pod, and<em> Country</em> pod. The <em>Person </em>pod has a PICK column of the <em>Country</em> pod to identify the nationality of that person, and you want to list all the people as: Person’s Name, Country (where you want to access by: <a href="http://domain.com/person">http://domain.com/person</a>). So inside the <strong>Pod Templates</strong> you would have something like this to show:</p>



<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;p&gt;{@name}, {@country}&lt;/p&gt;</pre></div></div>


<p>The above displays something like below on the <em> Person</em> list page (<em><a href="http://domain.com/person">http://domain.com/person</a></em>): </p>



<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">Mon Lu, United States
John Smith, Canada
Ken Yamamoto, Japan</pre></div></div>


<p>Now you want to get a bit sophisticated that you want to link the person’s name to its own detail page, and the country is linked to its own page listing all the people from that country or something like that. Not only that, you want to link the page using its own slugs/permalinks like this: <em><a href="http://domain.com/person/mon_lu">http://domain.com/person/mon_lu</a></em> and <em><a href="http://domain.com/country/usa">http://domain.com/country/usa</a></em> – assuming you have a  column named <em>slug</em> in the <em>Person</em> pod, and or <em> abbrv</em> in the <em>Country</em> pod. Before I figured this out, I used a <a href="/2009/webdev/pods-cms-display-helpers/">Display Helper</a> to grab the <em>abbrv</em> from the <em>Country </em>pod. But the easier way is the following, assuming this is still <em><a href="http://domain.com/person">http://domain.com/person</a></em> listing all the people where the <em>Country</em> pod is a PICK column inside the <em>Person</em> pod:</p>



<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;p&gt;&lt;a href=&quot;/person/{@slug}&quot;&gt;{@name}&lt;/a&gt;&lt;a href=&quot;/country/{@country.abbrv}&quot;&gt;{@country}&lt;/a&gt;&lt;/p&gt;</pre></div></div>


<p>Simple enough, yeah? </p>
<p><!-- PHP 5.x --></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.un-deprived.com/2009/webdev/pods-cms-magic-tag/feed/</wfw:commentRss>
		<slash:comments></slash:comments>
		</item>
		<item>
		<title>Pods CMS — Input Helpers</title>
		<link>http://www.un-deprived.com/2009/webdev/pods-cms-input-helpers/</link>
		<comments>http://www.un-deprived.com/2009/webdev/pods-cms-input-helpers/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 22:31:41 +0000</pubDate>
		<dc:creator>Mon</dc:creator>
				<category><![CDATA[Pods CMS]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[input helper]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PICK column]]></category>
		<category><![CDATA[pods cms]]></category>
		<category><![CDATA[wordpress plugins]]></category>

		<guid isPermaLink="false">http://www.un-deprived.com/?p=339</guid>
		<description><![CDATA[Software note: Pods CMS Version 1.7.3 / WP 2.8.4 Documentation: http://pods.uproot.us/codex/helpers What are Input Helpers An Input Helper lets you completely customize the appearance of any input field… when adding new data contents. In plain n00b English: as an example, the default field “name” I had it to store last names, and a separate column [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p><strong>Software note:</strong> <a href='http://pods.uproot.us/' target='_blank'>Pods CMS</a> Version 1.7.3 / WP 2.8.4</p>
<p><strong>Documentation:</strong> <a href="http://pods.uproot.us/codex/helpers">http://pods.uproot.us/codex/helpers</a></p>
<p><strong>What are Input Helpers</strong></p>
<p>An Input Helper lets you completely customize the appearance of any input field… when adding new data contents. </p>
<p><strong>In plain n00b English:</strong> as an example, the default field “name” I had it to store last names, and a separate column to store first names (fname). The problem of that would be when you’re using Bi-directional relationship PICK column to another Pod (let’s call this: Person) is you can only relate <em>one of the columns</em>, not both First Name and Last Name. So if you use the PICK column the “name”; which stores the Last Names, and with the last name like <em>Johnson</em> – you probably can’t tell which Johnson that is. Input Helpers can grab and display the full names for you when you’re adding data. <span id="more-339"></span>See screenshot:</p>
<p><img src='http://www.un-deprived.com/wp-content/uploads/2009/09/input-helper-fullname.jpg' alt='input-helper-fullname' width="197" height="135" align='none' class='alignnone' /></p>
<p><strong>How to add a new Input Helper</strong></p>
<p><img src='http://www.un-deprived.com/wp-content/uploads/2009/09/add-new-helper.jpg' alt='add-new-helper' width="584" height="201" align='none' class='alignnone' /></p>
<p><strong>Customized Dropdown Input Helper</strong></p>
<p>The following refers back to the example and screenshot above where it pulls full names from the “name” and “fname”columns as a PICK column to display as a drop down menu:</p>



<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;select class=&quot;form pick1 <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$name</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
        &lt;option value=&quot;&quot;&gt;-- Select one --&lt;/option&gt;
<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: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$lastname</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$firstname</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'firstname'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$fullname</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$lastname</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;, &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$firstname</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$selected</span> <span style="color: #339933;">=</span> <span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$val</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'active'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">''</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">' selected'</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
        &lt;option value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$selected</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$fullname</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/option&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;/select&gt;</pre></td></tr></table></div>


<p><strong>The crucial parts: </strong></p>



<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;select class=&quot;form pick1 &lt;?php echo $name; ?&gt;&quot;&gt;</pre></div></div>


<p>The <strong>class</strong> “form pick1″ are required by the default CSS unless you don’t care about the CSS. The $name is just an column’s name to identify the column’s name.  Just like <strong><a href='/2009/webdev/pods-cms-display-helpers/'>Display Helper</a></strong>, it passes the $value array for you to manipulate. The rest of the codes are very straight forward to read through the $value array, make sure that it actually have something in it before reading it. Then split it in parts to display. The $select is simply default select whatever previous selected when you are browsing existing content. If you’re adding new content, it is default to “–Select one–”. The very last part of this script is just simply displaying each option, giving each of them their unique row ID, then finally displaying the full names. </p>
<p>Another one I ran into was when I want to do a Multi PICK column, such as people who belong to a Dojo or Federation. See below:</p>
<p><img src='http://www.un-deprived.com/wp-content/uploads/2009/09/input-helper-fullname2.jpg' alt='input-helper-fullname2' width="273" height="170" align='none' class='alignnone' /><br />
I referenced the code above, with the help of FireBug, this saved the day:</p>
<p><strong>Customized Multi PICK Column Input Helper</strong></p>



<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;div class=&quot;form pick <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$name</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
<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: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$lastname</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$firstname</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'firstname'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$fullname</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$lastname</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;, &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$firstname</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$active</span><span style="color: #339933;">=</span> <span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$val</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'active'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">''</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">' active'</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
       &lt;div class=&quot;option<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$active</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$fullname</span> <span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;</pre>
</td>
</tr>
</table>
</div>
<p>As you’ve noticed, there are only minor differences between the two. The differences are “div” instead of “select”, $active, and the very last line (line 12).  Obviously the very last line is the default CSS that used by Pods CMS for Multi PICK columns, unless you want something different.</p>
<p><strong>Using the helpers</strong></p>
<p>Simply click on the pencil/Edit icon of the column, and choose the helper.  Like this:</p>
<p><img src='http://www.un-deprived.com/wp-content/uploads/using-input-helper.jpg' alt='using-input-helper' width="368" height="417" align='none' class='alignnone' /></p>
<p>Well, that’s it for now. I’ll update this section if I learn more.</p>
<p><!-- PHP 5.x --></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.un-deprived.com/2009/webdev/pods-cms-input-helpers/feed/</wfw:commentRss>
		<slash:comments></slash:comments>
		</item>
		<item>
		<title>Pods CMS — Display Helpers</title>
		<link>http://www.un-deprived.com/2009/webdev/pods-cms-display-helpers/</link>
		<comments>http://www.un-deprived.com/2009/webdev/pods-cms-display-helpers/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 17:31:23 +0000</pubDate>
		<dc:creator>Mon</dc:creator>
				<category><![CDATA[Pods CMS]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[pods cms]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress plugins]]></category>

		<guid isPermaLink="false">http://www.un-deprived.com/?p=291</guid>
		<description><![CDATA[I’ve been very silent on Facebook, Twitter, and this blog lately. That because I can’t constantly access Twitter anymore from work, they blocked me… so no more useful stuff to tweet and brag about excepted one thing: Pods CMS. Pods CMS is a WordPress plugin that pretty much turn your blog into a CMS. You [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I’ve been very silent on Facebook, Twitter, and this blog lately.  That because I can’t constantly access Twitter anymore from work, they blocked me… so no more useful stuff to tweet and brag about excepted one thing: <a title="Pods CMS" href="http://pods.uproot.us/" target="_blank">Pods CMS</a>.  Pods CMS is a WordPress plugin that pretty much turn your blog into a CMS.  You can build a Wiki, Glossary, Recipes, Hotel listing etc… the possibilities are endless.  Although, you will need to know at least some PHP to make this thing tuned to the way you want it to be.  I have been playing with it in the past 2 weeks, I have to say I am very impress of how this plugin works. So I did a test on one of my hobbies: Kendo.  I’ve always wanted to collect data on Kendo Dojo, how many practitioners, and Kendo tournament results in the U.S.  I was able to create this very complex database that it can be listed by Federations, State, Country, Dojo, and down to the individual Kendo-ist data.  The awesome thing is?  Each listing can be linked to one another.  For example, if you viewing by Federations, you can list all the Dojo in that federation, and with links to each Dojo AND the state.  You can add BUILT-IN filters and search on top!  The backend is all done for you, all you have to do is to make things pretty.  Ain’t that grant?</p>
<p><span id="more-291"></span></p>
<p>The problem of this awesome plugin that it is quite new, the documentations, tutorials, and resources are quite limited.  But the developers are extremely helpful on <a href="http://pods.uproot.us/forums/" target="_top">their own forum</a> – so you’ll have to do a lot of digging to find the answers you need… in which I did.  I also found the tutorials were kind of half way done, they stopped at displaying the data, but not showing how to write simple Display Helper and Input Helper.  So I’m going to jog that down here.</p>
<p>If you have not gone through the <a href="http://pods.uproot.us/codex/" target="_blank">documentations</a> and have some basic data to play with, you should get going (thinking putting one simple guide of how to put all the pods together later).</p>
<p><strong>Disclaimer:</strong></p>
<p>The following helpers are very basic ones that I found myself used them a lot and repeatedly, so hopefully these will be useful for someone else also.  On a side note that I am NOT a hardcore PHP coder, I understood enough basic PHP codes to customize them. If you know a better way, feel free.</p>
<p>So let’s get rolling…</p>
<p><strong>Software Note</strong>: Pods CMS 1.7.3 / WP 2.8.4</p>
<p><strong>Documentation</strong>: <a href="http://pods.uproot.us/codex/helpers">http://pods.uproot.us/codex/helpers</a></p>
<p><strong>Display Helpers:</strong> Display Helpers are the codes that help to display your results in a nicer, customized look.  For example, say that you want to show all of your ingredients in a recipe, by default, they’ll be list as such: “Ingredient 1Ingredient 2″ – it is hard to read.  So you can write a Display Helper to show them as “Ingredient 1, Ingredient 2″.  Got it?</p>
<p>By default, the Display Helper passes $value as an array for you to manipulate as such: $value[0][’column_name’].  </p>
<p><strong>Adding a Display Helper</strong></p>
<p>Adding a new Display Helper is very simple, see below:</p>
<div id="attachment_292" class="wp-caption alignnone" style="width: 373px"><a href="http://www.un-deprived.com/wp-content/uploads/2009/09/add-new-helper.jpg" rel="lightbox[291]" title="Pods CMS - Add new Display Helper"><img class="size-medium wp-image-292" title="Pods CMS - Add new Display Helper" src="http://www.un-deprived.com/wp-content/uploads/2009/09/add-new-helper-363x124.jpg" alt="Pods CMS - Add new Display Helper" width="363" height="124" /></a>
<p class="wp-caption-text">Pods CMS – Add new Display Helper</p>
</div>
<p><strong>List Single Result ONLY (No Link)</strong></p>
<p>Add a new <strong>Display Helper</strong> and name this one something like “print_r”:</p>
<div class="wp_syntax">
<div class="code">
<pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</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;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre>
</div>
</div>
<p>I have these two generic Display Helpers displaying a <em>single </em>result only.  By default, if you having something like {@column_name}, it will show column’s name and it is linked to a its own detailed page (if it is bi-directional), something like (<a href="http://domain.com/your_pod/column_name/1">http://domain.com/your_pod/column_name/1</a>).  Where the very last part is actually the row ID.  So what if you want to display your data with a custom permalink/slug?  Such as: (<a href="http://domain.com/your_pod/slug_name">http://domain.com/your_pod/slug_name</a>)  This helper will come in handy in your <strong>Pod Templates</strong> page:</p>
<div class="wp_syntax">
<div class="code">
<pre class="html" style="font-family:monospace;">&lt;a href=&quot;/pod_name/{@slug}&quot;&gt;{@column_name,print_r}&lt;/a&gt;</pre>
</div>
</div>
<p>You probably noticed that I put the helpers right next to the Magic Tags instead of adding the Display Helpers like this:</p>
<div id="attachment_298" class="wp-caption alignnone" style="width: 101px"><a href="http://www.un-deprived.com/wp-content/uploads/2009/09/display-helper-dd.jpg" rel="lightbox[291]" title="display-helper-dropdown"><img class="size-medium wp-image-298" title="display-helper-dropdown" src="http://www.un-deprived.com/wp-content/uploads/2009/09/display-helper-dd-91x125.jpg" alt="Display Helper " width="91" height="125" /></a>
<p class="wp-caption-text">Display Helper </p>
</div>
<p>It’s a matter of personal preference really.  If you want, you can add the helper inside the admin interface.  If you’d rather add the Display Helper through the admin interface, you don’t need to add “print_r” inside {@print_r}.</p>
<p><strong>Displaying Arrays</strong></p>
<p>The following will display “Ingredient 1, Ingredient 2, Ingredient 3″ instead of “Ingredient 1Ingredient 2Ingredient 3″ with links or no link to your liking:</p>
<div class="wp_syntax">
<table>
<tr>
<td class="line_numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre>
</td>
<td class="code">
<pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$pod</span> <span style="color: #339933;">=</span> pods_url_variable<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'first'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #cc66cc;">0</span> <span style="color: #339933;">&lt;</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$output</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;a href='/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$pod</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$val</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'slug'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;' /&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$val</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/a&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">', '</span><span style="color: #339933;">,</span> <span style="color: #000088;">$output</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;No record found&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre>
</td>
</tr>
</table>
</div>
<p>If you just want to display the results without the links, simply remove the “href” on line 8.</p>
<p><strong>Note:</strong> This helper will only link to current pod, what I mean: “/<em>pod1</em>/slugname”, but not able to link “/<em>pod2</em>/slugname”. The reason is that this script will only grab the pod’s name which is “/pod1″ and add itself to the “a href…”.  If you want to link to a different pod, you’ll just have to add a new helper with a minor change of instead of ‘$pod’ (line 8 ) where the “a href…” is to your actual pod’s name, make sense?</p>
<p>Well, that’s it for now… next up, <a href='/2009/webdev/pods-cms-input-helpers/'>Input Helper</a>.<!-- PHP 5.x --></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.un-deprived.com/2009/webdev/pods-cms-display-helpers/feed/</wfw:commentRss>
		<slash:comments></slash:comments>
		</item>
	</channel>
</rss>
