<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/language/php/tags/override</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Thu, 20 Jun 2013 06:17:30 GMT</pubDate>
<item>
<title>(PHP) SlideDeck 2 After get hook-in for overriding deck options - Jamie</title>
<link>http://snipplr.com/view/66597/slidedeck-2-after-get-hookin-for-overriding-deck-options/</link>
<description><![CDATA[ <p>Allows a SlideDeck user to hook into the options array after the SlideDeck is fetched from the database. Options can then be modified based on the request.</p> ]]></description>
<pubDate>Thu, 09 Aug 2012 03:13:52 GMT</pubDate>
<guid>http://snipplr.com/view/66597/slidedeck-2-after-get-hookin-for-overriding-deck-options/</guid>
</item>
<item>
<title>(PHP) drupal - find available variable names and content for node - stiobhart</title>
<link>http://snipplr.com/view/22919/drupal--find-available-variable-names-and-content-for-node/</link>
<description><![CDATA[ <p>because i always forget [or sometimes didnae know in the first place], what variables are available, and what values they hold, when overriding a drupal node.tpl file.

since drupal tends to hold all the info for constructing a page inside nested arrays... inside nested arrays... inside nested arrays... etc. etc. you need to dig down quite a few levels before you actually start getting to the meat and potatoes.

stick this code in the top of one of your node_xxxxx.tpl.php files and it will dig four nested arrays  deep and print out what it finds in a logical format:

arrayname["nested arrayname"]["nested arrayname"]["nested arrayname"] = VALUE

any arrays which dinnae go four levels deep will return a "Invalid argument supplied for foreach().." error and you'll have to not dig so deep to find their values. any values hidden deeper than four nested levels will just return as ARRAY and you'll need to dig even deeper!

when you get the value you're after, you generally use it in a node template by using everything after the 'node' bit. so if my value was at:

field_productimage["field"]["#node"]["title"] = some product name

i'd add it into my drupal node template using something like:


&amp;lt;div&amp;gt;
$node->title
&amp;lt;/div&amp;gt;



OK it ain't very elegant and it's a bit of a clunker, as you need to hack the code about for different levels of digging, but it helps me find the crap i'm looking for, so it'll do me 'til i write sommit better.</p> ]]></description>
<pubDate>Wed, 11 Nov 2009 07:35:38 GMT</pubDate>
<guid>http://snipplr.com/view/22919/drupal--find-available-variable-names-and-content-for-node/</guid>
</item>
</channel>
</rss>