<?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></title> <atom:link href="http://sawred.com/feed/" rel="self" type="application/rss+xml" /><link>http://sawred.com</link> <description></description> <lastBuildDate>Fri, 30 Dec 2011 20:37:00 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>Equality: A jQuery Plugin</title><link>http://sawred.com/equality/</link> <comments>http://sawred.com/equality/#comments</comments> <pubDate>Fri, 04 Nov 2011 22:40:54 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[jQuery]]></category> <category><![CDATA[Downloads]]></category> <category><![CDATA[equal heights]]></category> <category><![CDATA[javascript]]></category> <guid
isPermaLink="false">http://sawred.com/?p=16</guid> <description><![CDATA[Equality was written to fill what I believed to be a gap in the logic of Equal Heights. Like Equal Heights, the purpose of Equality is to set height of multiple elements equal to one another, however, unlike Equal Heights, these elements do not necessarily have to be in the same container. This is a very minimalistic approach to the matter, however it serves its purpose for my projects.]]></description> <content:encoded><![CDATA[<p>Equality was written to fill what I believed to be a gap in the logic of Equal Heights. Like Equal Heights, the purpose of Equality is to set height of multiple elements equal to one another, however, unlike Equal Heights, these elements do not necessarily have to be in the same container. This is a very minimalistic approach to the matter, however it serves its purpose for my projects.</p><p>Equality calculates the height for the selected elements and sets all selected elements to that height with the option to add a specified number of pixels to the end result.</p><p><strong>The Script:</strong></p><pre class="brush: js">(function($) {
	$.fn.equality = function(options){
    	var height,elements;
    	elements = $(this);
    	options = $.extend({},$.equality.defaults, options);
    	height = options.height;
        $(this).each(function() {
            $(this).height() &gt; height &amp;&amp; (height = $(this).height() + options.addOn)
        });
        options.minHeight == true ? elements.css({
            minHeight: height
        }) : elements.css({
            height: height
        });
    	return $(this);
	};
	$.equality = {
		defaults : {
			height: true,
			minHeight : false,
			addOn : 0
		}
	};
})(jQuery);
</pre><p><strong>Usage &amp; Options:</strong></p><pre class="brush: js">$('.myElements, #that, .iWant, #toBeEqual').equality(
height: true, // true/false -- default true -- set the height attribute of selected elements
minHeight: false, // true/false defaults false -- also/alternatively set min-height of selected elements
addOn: 0 // defaults 0 -- numeric value representing the amount of pixels you would like to add onto the final height -- do NOT use 'px'
);
</pre><div
class="plusone"><g:plusone size=standard annotation=bubble align=left href="http://sawred.com/equality/"></g:plusone></div>]]></content:encoded> <wfw:commentRss>http://sawred.com/equality/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Using views_embed_view</title><link>http://sawred.com/using-views_embed_view/</link> <comments>http://sawred.com/using-views_embed_view/#comments</comments> <pubDate>Fri, 24 Jun 2011 16:45:07 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[Drupal]]></category> <guid
isPermaLink="false">http://sawred.com/?p=23</guid> <description><![CDATA[<p>The need arised to display a single content type — which included a conditional field that separated the content into two categories depending on that condition — in a block depending on which category’s landing page a user arrived on. Following? No? Alright….</p><p>Assume you have two factions of one website, for example’s sake, lets say you’re building a summer camp website that has a girls side and a boys side. A cookie is set when a user arrives at domain.org/boyscamp or /girlscamp that simply states which page they landed on. Both sides have campfire nights that they would like to publish on the website using the same form, with a condition boys or girls, but only one of the sides is going to display in a single block. The website is the same for both sides with the exception of ...]]></description> <content:encoded><![CDATA[<p>The need arised to display a single content type — which included a conditional field that separated the content into two categories depending on that condition — in a block depending on which category’s landing page a user arrived on. Following? No? Alright….</p><p>Assume you have two factions of one website, for example’s sake, lets say you’re building a summer camp website that has a girls side and a boys side. A cookie is set when a user arrives at domain.org/boyscamp or /girlscamp that simply states which page they landed on. Both sides have campfire nights that they would like to publish on the website using the same form, with a condition boys or girls, but only one of the sides is going to display in a single block. The website is the same for both sides with the exception of the landing page — both sides access the same nodes, so how do we display this side specific block on all nodes?</p><p>There’s several ways to go about this actually. You could use Context, with Context PHP and pull the cookie value and create 2 Contexts, one with each cookie evaluating true. But perhaps you don’t want to install Context just for a single purpose — it is a lot of module for one block.</p><p>A second method is to create a PHP block and use views_embed_view with an elseif based on the cookie value:</p><pre class="brush:php;">
if ($_COOKIE["cookiename"] == "site1") {
print views_embed_view('Campfire','block_1');
} elseif ($_COOKIE["cookiename"] == "site2")  {
print views_embed_view('Campfire','block_2');
}
</pre><p>Either way, you’ll now have both Views in a single block.</p><div
class="plusone"><g:plusone size=standard annotation=bubble align=left href="http://sawred.com/using-views_embed_view/"></g:plusone></div>]]></content:encoded> <wfw:commentRss>http://sawred.com/using-views_embed_view/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Views 3.x Node Argument</title><link>http://sawred.com/views-3-x-node-argument/</link> <comments>http://sawred.com/views-3-x-node-argument/#comments</comments> <pubDate>Mon, 16 May 2011 19:13:09 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[Drupal]]></category> <category><![CDATA[Views]]></category> <guid
isPermaLink="false">http://sawred.com/?p=19</guid> <description><![CDATA[In using Views 3 recently, I found, as I'm sure most everyone else has, that it has had some significant changes in the new release. The one that got me recently was triggering the display of a Content field with the argument based on the current node ID...]]></description> <content:encoded><![CDATA[<p>In using Views 3 recently, I found, as I&#8217;m sure most everyone else has, that it has had some significant changes in the new release. The one that got me recently was triggering the display of a Content field with the argument based on the current node ID.</p><p>Before, in Views 2, it required a Node: NID argument, with the default argument being a couple lines of PHP:</p><pre class="brush: php">
if (arg(0) == 'node' &#038;&#038; is_numeric(arg(1))) {
    $args[0] = arg(1);
}
return $args;
</pre><p>Now in Views 3, everything is done with &#8220;Contextual Filters&#8221;. To accomplish the same thing in Views 3 add a Contextual Filter under Advanced. &#8220;Provide Default Value&#8221; -> Content ID From URL.</p><p>Done.</p><div
class="plusone"><g:plusone size=standard annotation=bubble align=left href="http://sawred.com/views-3-x-node-argument/"></g:plusone></div>]]></content:encoded> <wfw:commentRss>http://sawred.com/views-3-x-node-argument/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Patch: Ubercart Better Cart Links</title><link>http://sawred.com/fixing-ubercart-better-cart-links/</link> <comments>http://sawred.com/fixing-ubercart-better-cart-links/#comments</comments> <pubDate>Fri, 13 May 2011 07:11:51 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[Drupal]]></category> <category><![CDATA[Ubercart]]></category> <guid
isPermaLink="false">http://sawred.com/?p=25</guid> <description><![CDATA[<p>Development for the module seems to be mostly at a standstill, presumably due to the developer jumping into Drupal Commerce, yet for the Drupal 6.x users still working with Ubercart, Better Cart Links is pretty much unusable.</p><p>Attempting to create a link with Better Cart Links drops the error “Product ID not valid” even when using a valid Node ID.</p><p>Anyway, here’s the patch. The issue was product IDs being called incorrectly in the mysql query. The fix is working well for me, but if you have any issues let me know.</p> ]]></description> <content:encoded><![CDATA[<p>Development for the module seems to be mostly at a standstill, presumably due to the developer jumping into Drupal Commerce, yet for the Drupal 6.x users still working with Ubercart, Better Cart Links is pretty much unusable.</p><p>Attempting to create a link with Better Cart Links drops the error “Product ID not valid” even when using a valid Node ID.</p><p>Anyway, <a
href="http://drupal.org/files/issues/uc-better-links-fix.patch" rel="external">here’s the patch</a>. The issue was product IDs being called incorrectly in the mysql query. The fix is working well for me, but if you have any issues let me know.</p><div
class="plusone"><g:plusone size=standard annotation=bubble align=left href="http://sawred.com/fixing-ubercart-better-cart-links/"></g:plusone></div>]]></content:encoded> <wfw:commentRss>http://sawred.com/fixing-ubercart-better-cart-links/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Fantastic Drupal Modules: Context</title><link>http://sawred.com/fantastic-drupal-modules-context/</link> <comments>http://sawred.com/fantastic-drupal-modules-context/#comments</comments> <pubDate>Mon, 09 May 2011 21:46:43 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[Drupal]]></category> <category><![CDATA[Drupal Modules]]></category> <guid
isPermaLink="false">http://sawred.com/?p=30</guid> <description><![CDATA[<p>I’ve had the pleasure of working with Context on a project this past week — I must say I am impressed. Everything that annoyed me about building a Drupal site has virtually be solved by a single module.</p><p>What it does is actually pretty ingenious — the module basically allows you to set conditions which trigger actions based on those conditions that can be used to modify virtually any node. So you can display particular blocks, themes, custom javascript, insert an HTTP Header, or load css files on a node based on arguments which you define. The arguments can be anything from a node type, cck field, or even custom PHP that evaluates true.</p><p>Context is an amazing module –  also be sure to check out it’s many add-ons on d.o.</p> ]]></description> <content:encoded><![CDATA[<p>I’ve had the pleasure of working with Context on a project this past week — I must say I am impressed. Everything that annoyed me about building a Drupal site has virtually be solved by a single module.</p><p>What it does is actually pretty ingenious — the module basically allows you to set conditions which trigger actions based on those conditions that can be used to modify virtually any node. So you can display particular blocks, themes, custom javascript, insert an HTTP Header, or load css files on a node based on arguments which you define. The arguments can be anything from a node type, cck field, or even custom PHP that evaluates true.</p><p>Context is an amazing module –  also be sure to check out it’s many add-ons on d.o.</p><div
class="plusone"><g:plusone size=standard annotation=bubble align=left href="http://sawred.com/fantastic-drupal-modules-context/"></g:plusone></div>]]></content:encoded> <wfw:commentRss>http://sawred.com/fantastic-drupal-modules-context/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Theme Option Headaches</title><link>http://sawred.com/theme-option-headaches/</link> <comments>http://sawred.com/theme-option-headaches/#comments</comments> <pubDate>Tue, 29 Mar 2011 21:35:32 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[WordPress]]></category> <category><![CDATA[Hax]]></category> <category><![CDATA[Themes]]></category> <guid
isPermaLink="false">http://sawred.com/?p=21</guid> <description><![CDATA[<p>In using a few select templates from GoGoThemes, I’ve developed quite the headache fixing the code that controls the Theme Options menus in the backend of WordPress. If you’re using a GoGoTheme and you’re having issues with Theme Options, then this is for you.</p><p>The first thing you may notice is that your pretty tabs in Theme Options just don’t function — aside from the HTML throwing around 90 validation errors, the main issue is the way that pages are being selected from the database — the current method used either returns –1 for the ID or returns nothing and breaks entirely. To solve this issue, follow the steps below:
Find:</p> foreach(get_pages() as $id) { $page = get_page($id)<p>Replace With:</p> foreach(get_pages() as $id) { $page = get_page($id->ID)<p>Just below that, you’ll see a line looking something like this:</p><p>echo $id; ?>">selected="selected">post_title; ?></p><p>Your objective here is going to ...]]></description> <content:encoded><![CDATA[<p>In using a few select templates from GoGoThemes, I’ve developed quite the headache fixing the code that controls the Theme Options menus in the backend of WordPress. If you’re using a GoGoTheme and you’re having issues with Theme Options, then this is for you.</p><p>The first thing you may notice is that your pretty tabs in Theme Options just don’t function — aside from the HTML throwing around 90 validation errors, the main issue is the way that pages are being selected from the database — the current method used either returns –1 for the ID or returns nothing and breaks entirely. To solve this issue, follow the steps below:<br
/> Find:<br
/></p><pre class="brush:php;">
foreach(get_pages() as $id) { $page = get_page($id)
</pre><p>Replace With:<br
/></p><pre class="brush:php;">
foreach(get_pages() as $id) { $page = get_page($id->ID)
</pre><p>Just below that, you’ll see a line looking something like this:</p><p><code>echo $id; ?>">selected="selected">post_title; ?></code></p><p>Your objective here is going to be to replace</p><pre class="brush:php;">$id</pre><p> With:</p><pre class="brush:php;">$id->ID</pre><p>And fortunately, you’ll have to follow these steps for each tab, replacing, of course, ‘team_page’, with the appropriate title.</p><p>Good stuff.</p><div
class="plusone"><g:plusone size=standard annotation=bubble align=left href="http://sawred.com/theme-option-headaches/"></g:plusone></div>]]></content:encoded> <wfw:commentRss>http://sawred.com/theme-option-headaches/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
