<?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; PICK column</title>
	<atom:link href="http://www.un-deprived.com/tag/pick-column/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.un-deprived.com</link>
	<description>A webdev journal of the Moninator</description>
	<lastBuildDate>Thu, 29 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>
	</channel>
</rss>
