<?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>Tetsuro Takara&#039;s Blog</title>
	<atom:link href="http://blog.tetsutakara.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tetsutakara.com</link>
	<description>Tetsuro&#039;s Blog</description>
	<lastBuildDate>Fri, 16 Jul 2010 14:36:50 +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>Creating a Threadless-like Add-to-Cart button using jQuery and AJAX</title>
		<link>http://blog.tetsutakara.com/1156/creating-a-threadless-like-add-to-cart-button-using-jquery-and-ajax/</link>
		<comments>http://blog.tetsutakara.com/1156/creating-a-threadless-like-add-to-cart-button-using-jquery-and-ajax/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 15:18:10 +0000</pubDate>
		<dc:creator>Tetsuro</dc:creator>
				<category><![CDATA[Shopify]]></category>

		<guid isPermaLink="false">http://blog.tetsutakara.com/?p=1156</guid>
		<description><![CDATA[In this tutorial we will be modifying the product page of the Ripen theme to work more like the product page on Threadless. We&#8217;re going to be modifying the Ripen theme, but this tutorial is applicable to any Shopify theme. I would like to thank John Tajima again for teaching me how AJAX and JSON [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorial we will be modifying the product page of the Ripen theme to work more like the product page on <a href="http://www.threadless.com/" target="_blank">Threadless</a>. We&#8217;re going to be modifying the Ripen theme, but this tutorial is applicable to any Shopify theme. I would like to thank <a href="http://www.tajimaphotography.com/" target="_blank">John Tajima</a> again for teaching me how AJAX and JSON objects work with Shopify. We will also make it so that the number of products in the cart displayed automatically updates after you add an item to the cart. </p>
<p><object width="588" height="354"><param name="movie" value="http://www.youtube.com/v/lurhciqVDTQ&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/lurhciqVDTQ&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="588" height="354"></embed></object></p>
<div class="sub">A quick demo of the completed theme in action</div>
<p><span id="more-1156"></span></p>
<h2 class="steps">1. Install jQuery</h2>
<p>If you are unsure of how to do this, please see Steps 1 to 3 from <a href="http://blog.tetsutakara.com/593/shopify-tutorial-making-sure-a-user-agrees-to-the-terms-conditions-using-jquery/">this tutorial.</a></p>
<h2 class="steps">2. Install Colorbox</h2>
<p>Grab the jQuery plugin Colorbox <a href="http://colorpowered.com/colorbox/">here</a>, and upload it to your theme assets. We&#8217;re going to be using Colorbox to get the lightbox popup when a product is added to the cart. I usually use Fancybox for lightboxes, but I decided to go with Colorbox for this tutorial because it <em>&#8220;can be called directly, without assignment to an element&#8221;</em>. This means that I can call a Colorbox method, and create a lightbox on-the-fly when the &#8220;Add to Cart&#8221; button is clicked, but with Fancybox this would be impossible.</p>
<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2010/07/thread1-588x272.png" alt="thread1" title="thread1" width="588" height="272" class="alignnone size-medium wp-image-1175" /></p>
<div class="sub">In your theme assets, you should have &#8220;jquery.colorbox-min.js&#8221; and &#8220;colorbox.css&#8221;. </div>
<p>Be sure to add these two files in the &lt;head&gt; section to your theme.liquid as well.</p>
<pre>
<code>&lt;head&gt;
     <span style="color:blue;">...other assets</span>
     {{ 'colorbox.css' | asset_url  | stylesheet_tag }}
     {{ 'jquery.colorbox-min.js' | asset_url | script_tag }}
&lt;/head&gt;</code>
</pre>
<h2 class="steps">3. Modify the &#8220;Add to Cart&#8221; button</h2>
<p>Open your product.liquid file, and locate the input button for adding to the cart. The input button looks like this:</p>
<pre>
<code> &lt;input type="submit" name="add" value="Add to Cart" id="add" /&gt;</code>
</pre>
<p>We want to do two things to this button: first, we want to make it so that even if the user clicks on it, the user is not taken to the cart page. Second, we want to call a custom function (that we&#8217;re going to be writing shortly) that makes an AJAX call to add the product to the cart. </p>
<pre>
<code> &lt;input type="submit" name="add" value="Add to Cart" id="add" <span style="color:red;">onclick="return false; addItem('add-to-cart');"</span>/&gt;</code>
</pre>
<p>The addItem function takes the form&#8217;s id as a parameter. This is so that when we use jQuery later, we know which form to select. The opening tag for your form should look like this:</p>
<pre>
<code>&lt;form action="/cart/add" method="post" id="add-to-cart"&gt; </code>
</pre>
<h2 class="steps">4. Preparing product.liquid</h2>
<p>Add the following line at the top of product.liquid. </p>
<pre>
<code>&lt;div id="added-box-wrapper" style="display:none;"&gt;
    &lt;div id="added-box"&gt;&lt;/div&gt;
&lt;/div&gt;</code>
</pre>
<p>The added-box is where the content of the lightbox will be inserted. We need to wrap it in another div with a &#8220;display:none;&#8221; so that the content of the lightbox are not displayed on the actual page. </p>
<h2 class="steps">5. Preparing theme.liquid</h2>
<p>Next, we have to modify theme.liquid a little so that the number displayed for the number of items in the cart updates automagically. In theme.liquid, find a place where you want to show a link to the cart. In this tutorial, I&#8217;m going to put it in the right column, under where it says &#8220;Shopping Cart&#8221;. </p>
<pre>
<code>&lt;a href="/cart" id="cart-number"&gt;
    {% if cart.item_count == 0 %}
       Your cart is empty.
    {% endif %}
&lt;/a&gt;    </code>
</pre>
<p>What&#8217;s important here is that the &lt;a&gt; tag has the id &#8220;cart-number&#8221;, so that we can select it with jQuery later to modify its contents.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tetsutakara.com/1156/creating-a-threadless-like-add-to-cart-button-using-jquery-and-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back in Business</title>
		<link>http://blog.tetsutakara.com/1073/back-in-business/</link>
		<comments>http://blog.tetsutakara.com/1073/back-in-business/#comments</comments>
		<pubDate>Sun, 09 May 2010 22:57:47 +0000</pubDate>
		<dc:creator>Tetsuro</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://blog.tetsutakara.com/?p=1073</guid>
		<description><![CDATA[Dazed, tanned, and broke. These three words pretty much sum up my state right now, after spending three weeks in Tokyo, Okinawa, and Taipei. I&#8217;m currently at Narita Airport waiting for my flight to Toronto, where I will catch another plane back to Ottawa. Waiting at Narita Airport in Tokyo &#8211; taken with my webcam&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>Dazed, tanned, and broke. These three words pretty much sum up my state right now, after spending three weeks in Tokyo, Okinawa, and Taipei. I&#8217;m currently at Narita Airport waiting for my flight to Toronto, where I will catch another plane back to Ottawa.</p>
<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2010/04/Photo-on-2010-05-09-at-03.07-588x352.jpg" alt="Photo on 2010-05-09 at 03.07" title="Photo on 2010-05-09 at 03.07" width="588" height="352" class="alignnone size-medium wp-image-1151" /></p>
<div class="sub">Waiting at Narita Airport in Tokyo &#8211; taken with my webcam&#8230; I can&#8217;t find my actual camera</div>
<p>It&#8217;s been a while since my last post, but now that I&#8217;m finally finished my winter semester I can start writing here more often. I will also try my best to catch up on unanswered comments! It&#8217;s starting to sink in that there are only two more semesters of school left&#8230; I can&#8217;t wait to finish completely!</p>
<p>The highlight of this past semester was diving into the world of interactive multimedia. For one of our classes, we were taught an open-source programming language called Processing. My classmates Grant Lucas, Mark Pintar and I built the &#8216;faceTable&#8217;, which was an interactive table display that would display the user&#8217;s Facebook information by using customized <a href="http://reactivision.sourceforge.net/" title="Reactivision">Reactivision</a> markers. Words don&#8217;t do it justice &#8211; we will be posting videos of it in action on Vimeo once we make the demonstration videos. </p>
<h2 class="steps">Plans for the summer</h2>
<p>This summer I&#8217;d like to find and share more hacks and tweaks in Shopify that would allow storeowners to add unique features to their store. I&#8217;d also like to write more tutorials to help storeowners get started with their stores. </p>
<p>In my spare time, I plan on playing around with Processing and OpenFrameworks in an attempt to create some cool visual displays. Particle systems is an example of something I&#8217;d like to create using one of these two languages. I&#8217;ll also be playing shows with the band The Mudplots, as well as work on another band project that I have brewing :)</p>
<p>Anyway, I&#8217;m off to kill some more time &#8211; two more hours until my flight to Toronto! Don&#8217;t fail me, Reddit&#8230;</p>
<p><strong>UPDATE:</strong> A random elderly man from Calgary just approached me with a super-serious look on his face asking if I could check something for him using the wifi on my laptop. Thinking it was an emergency, I opened up my laptop. Turns out he just really needed to know the result of the Pittsburgh vs Montreal game for his hockey pool. Canadians are awesome :D</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tetsutakara.com/1073/back-in-business/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reading Week</title>
		<link>http://blog.tetsutakara.com/981/reading-week/</link>
		<comments>http://blog.tetsutakara.com/981/reading-week/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 22:57:03 +0000</pubDate>
		<dc:creator>Tetsuro</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://blog.tetsutakara.com/?p=981</guid>
		<description><![CDATA[Back in January, I returned to Carleton University to resume my studies after a 1-year work term at Shopify. This week is Reading Week, and I&#8217;m temporarily back at Shopify to do some work. It&#8217;s really nice to be back in the office, although it makes me want to drop out of school and stay [...]]]></description>
			<content:encoded><![CDATA[<p>Back in January, I returned to Carleton University to resume my studies after a 1-year work term at Shopify. This week is Reading Week, and I&#8217;m temporarily back at Shopify to do some work. It&#8217;s really nice to be back in the office, although it makes me want to drop out of school and stay here forever :P</p>
<p>School&#8217;s been pretty hectic. MEL Scripting, marketing, and product design methodology have all been keeping me pretty busy. Because of this, I won&#8217;t be writing any Shopify-related tutorials during the semester, but I hope to get back into it during the summer. </p>
<p>There is one class that I really enjoy at school, taught by an awesome new teacher called James Acres. He introduced us to the world of <a href="http://processing.org/">Processing</a> and <a href="http://www.arduino.cc/">Arduino</a>, and it&#8217;s like discovering Lego again for the first time. It&#8217;s our first time creating interactions between the physical and digital world, and it&#8217;s truly been a fascinating experience. </p>
<p style="text-align:center;"><object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=8612857&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=8612857&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object></p>
<div class="sub">This is an example of the cool things you can do with Processing and the Reactivision framework</div>
<p>March is going to be one tough month with all the assignments and whatnot, but I think it&#8217;ll go by quickly. I can&#8217;t wait for this semester to be over with!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tetsutakara.com/981/reading-week/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shopify Tutorial: Adding a Barchart for Inventory Using jQuery and JSON Objects</title>
		<link>http://blog.tetsutakara.com/652/adding-a-barchart-for-inventory-using-jquery-and-json-objects/</link>
		<comments>http://blog.tetsutakara.com/652/adding-a-barchart-for-inventory-using-jquery-and-json-objects/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 16:12:37 +0000</pubDate>
		<dc:creator>Tetsuro</dc:creator>
				<category><![CDATA[Shopify]]></category>

		<guid isPermaLink="false">http://blog.tetsutakara.com/?p=652</guid>
		<description><![CDATA[I was looking at t-shirts at an online store one day, and it had a nice little bar chart that displayed how much of each size it had left. I thought to myself, &#8220;I wonder if this is doable in Shopify?&#8221;. The answer is yes, thanks to jQuery and JSON Objects. In this tutorial, I&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>I was looking at t-shirts at an online store one day, and it had a nice little bar chart that displayed how much of each size it had left. I thought to myself, &#8220;I wonder if this is doable in Shopify?&#8221;. The answer is yes, thanks to jQuery and JSON Objects. In this tutorial, I&#8217;ll be showing you how to add a bar chart in your product page that shows how much of each variant you have left in a bar chart. A big thank you to Javascript wizard <a href="http://www.tajimaphotography.com" title="John Tajima Photography">John Tajima</a> for introducing me to JSON objects and helping me out with the Javascript portion of this tutorial. </p>
<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/11/Screen-shot-2009-11-22-at-6.13.52-PM.jpg" alt="Screen-shot-2009-11-22-at-6.13.52-PM" title="Screen-shot-2009-11-22-at-6.13.52-PM" width="588" height="359" class="alignnone size-full wp-image-719" /></p>
<div class="sub">The bar chart integrated into the <em>Moderno</em> theme.</div>
<p>Implementing this feature can be done in three easy steps: adding the HTML/Liquid, adding the Javascript, and then adding the CSS. You can also fully customize the look of the bar chart with CSS. This bar chart will work for <em>any</em> theme, as long as you insert the HTML, Liquid, Javascript and CSS properly.<br />
<span id="more-652"></span><br />
Keep in mind that this code will only work if you&#8217;re tracking the inventory levels of your product&#8217;s variant. In order to enable inventory tracking, you must navigate to your Product details page, and scroll down to where it lists the variants. Click the &#8216;edit&#8217; link next to the variants, and in the dropdown menu, select &#8220;Shopify tracks this variant&#8217;s stock level&#8221;. Finally, enter the inventory level for this variant.</p>
<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/11/Screen-shot-2009-12-10-at-12.09.34-AM.png" alt="Screen shot 2009-12-10 at 12.09.34 AM" title="Screen shot 2009-12-10 at 12.09.34 AM" width="588" height="339" class="alignnone size-full wp-image-898" /></p>
<h2 class="steps">The way it works:</h2>
<p>The algorithm is best explained with an example. You have a t-shirt with 3 variants: small, medium, large. Let&#8217;s say you have 2 smalls, 4 mediums, and 4 larges. </p>
<p>The Javascript code will first calculate the total inventory level for ALL variants &#8211; in this example, the total will be 10 (2 smalls + 4 mediums + 4 larges = 10). Then, for each variant, it will calculate the percentage of a single variant&#8217;s inventory level versus. the total inventory level. This percentage is then used to determine the width of each bar. The percentages in our t-shirt example would be 20% for small, 40% for medium, and 40% for large, and the CSS will fill in the black bars accordingly. </p>
<h2 class="steps">1. Download jQuery and put it in the theme.</h2>
<p>If you are unsure of how to do this, please see Steps 1 to 3 from my <a href="http://blog.tetsutakara.com/593/shopify-tutorial-making-sure-a-user-agrees-to-the-terms-conditions-using-jquery/">last tutorial.</a></p>
<h2 class="steps">2. Insert the HTML/Liquid code inside of Product.liquid.</h2>
<p>This is the code that is used to display the bar chart. Paste this code inside product.liquid where you want to output the bar chart. </p>
<pre>
<code>{% if product.variants.size &gt; 1 %}
  &lt;div id="inventory"&gt;
    {% for variant in product.variants %}
      &lt;div class="inventory-item"&gt;
        <span>{{ variant.title }}</span>&lt;br/&gt;
        &lt;div class="inventory-bar"&gt;
          &lt;div class="filler variant_{{forloop.index0}}"&gt;&amp;nbsp;&lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    {% endfor %}
  &lt;/div&gt;
{% endif %}</code>
</pre>
<p>The code above first checks if the product has more than one variant. The bar chart will only show if there is more than one variant, because there is not much point in making a bar chart if there is only one bar to show. </p>
<p>Next, the for-loop creates a div with the class &#8220;inventory-bar&#8221; for each variant. The &#8220;inventory-bar&#8221; div has a gray background has a width of 100% (which means that it will be the width of the &#8220;inventory&#8221; div. The div within &#8220;inventory-bar&#8221; is the black &#8216;filler&#8217; bar that will expand its width depending on how much inventory for the variant is available. The filler bar is assigned a width in percentage by the Javascript in Step 3. </p>
<p>The next function then takes the inventory level of each variant, and assigns the CSS property &#8216;width&#8217; in percentage. The percentage is calculated by dividing the variant&#8217;s inventory level by the total inventory, and then multiplying the result by 100. Using jQuery, the class variant_i (where &#8216;i&#8217; is the index number of the loop) is assigned an inline style with the calculated width. </p>
<h2 class="steps">3. Insert the Javascript/jQuery code.</h2>
<p>Below the code from Step 2, insert the following Javascript/jQuery code. </p>
<pre>
<code>&lt;script type="text/javascript"&gt;
jQuery(document).ready(function($){
  var product_json = {{ product | json }};
  // get total inventory of product
  var total_inventory = 0;
  jQuery.each(product_json.variants, function(i, v) {
    total_inventory += v.inventory_quantity
  });
  // replace inventory bars for variants
  jQuery.each(product_json.variants, function(i, v){
    var count = v.inventory_quantity;
    if (count == 0) {
      $('.variant_'+i).css({'background':'none'}).html('<span class="message">Sold Out</span>');
    } else {
      $('.variant_'+i).css({'width': ((count / total_inventory)*100) + "%"});
    }
  });
});
&lt;/script&gt;</code>
</pre>
<p>The code above  first creates a JSON object of the product that you are currently viewing, using Liquid&#8217;s &#8220;json&#8221; filter. We want to convert the product into a JSON object because it will allow us to use Javascript for calculations (unfortunately, Liquid alone is not sufficient, as it does not have many math functions). </p>
<p>Next, it loops through each of the variants of the product, and calculates the total of all variant inventories and stores them in a variable called total_inventory.</p>
<p>The last function takes the inventory level of each variant, and assigns the CSS property ‘width’ in percentage. The percentage is calculated by dividing the variant’s inventory level by the total inventory, and then multiplying the result by 100. Using jQuery, the class variant_i (where ‘i’ is the index number of the loop) is assigned an inline style with the calculated width. The CSS class variant_i is matched up with the variant_{{forloop.index0}} in the for-loop from the HTML code in Step 2, which ensures that the right width is assigned to the right variant. </p>
<p>However, if the variant&#8217;s inventory level is 0, the bar for the variant will not be given a width, and instead it will display a message that says &#8220;Sold Out&#8221;. </p>
<h2 class="steps">4. Insert the CSS code.</h2>
<p>Inside your CSS file, insert the following selectors for the bar chart.</p>
<pre>
<code>
#inventory{
        /*Give this div a width if you'd like to set the barcharts to a certain width. Otherwise, it will take on the width of its parent div. */
}

.filler{
	background:#000;
}

.inventory-item{
	margin-bottom:15px;
}

.inventory-bar{
	background:#e1e1e1;
	height:20px;
	width:100%;
}</code>
</pre>
<p>The simple CSS above styles the bar chart. By using your own CSS, you can customize the color, margin, width, etc. in any way that you like.</p>
<p>Here are some examples of the bar charts in action, in different themes:</p>
<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/11/dropify2.png" alt="dropify2" title="dropify2" width="588" height="444" class="alignnone size-full wp-image-891" /></p>
<div class="sub">The bar chart in the Dropify theme.</div>
<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/11/minimify.png" alt="minimify" title="minimify" width="588" height="476" class="alignnone size-full wp-image-895" /></p>
<div class="sub">The bar chart in the Minimify theme.</div>
<h2 class="steps">Conclusion:</h2>
<p>Originally, I had wanted to use just Liquid to accomplish this, but in the end I had to use a combination of Liquid and Javascript because Liquid cannot do many math functions. With that said I&#8217;m pretty happy that I used Javascript because I learned a great deal about JSON objects. (thanks again <a href="http://www.tajimaphotography.com" title="John Tajima Photography">John</a>!).  I hope you find this technique useful, and I hope to see this in some themes in the future!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tetsutakara.com/652/adding-a-barchart-for-inventory-using-jquery-and-json-objects/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>New Design!</title>
		<link>http://blog.tetsutakara.com/650/new-design/</link>
		<comments>http://blog.tetsutakara.com/650/new-design/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 17:20:49 +0000</pubDate>
		<dc:creator>Tetsuro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.tetsutakara.com/?p=650</guid>
		<description><![CDATA[Just today I launched the new design of my blog. I had been upset over my old design for a while; I couldn&#8217;t really put my finger on why, but I just felt that the design was really messy and unprofessional. One of things that REALLY bugged me is that the colours looked awful on [...]]]></description>
			<content:encoded><![CDATA[<p>Just today I launched the new design of my blog. I had been upset over my old design for a while; I couldn&#8217;t really put my finger on why, but I just felt that the design was really messy and unprofessional. One of things that REALLY bugged me is that the colours looked awful on Windows machines. For the new design, I decided to play it safe and stick with mostly grayscale colours. </p>

<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/11/old_design.png" alt="old_design" title="old_design" width="588" height="378" class="alignnone size-full wp-image-667" /></p>
<div class="sub">The old design&#8230;ew!!</div>

<p>I grabbed the background pattern that I created last year, and used it as a foundation of the new design. I didn&#8217;t want it to be too distracting so I toned down its opacity quite a bit. I&#8217;d like to work on a new background sometime soon because I feel this one is a bit too disorganized.</p>

<p style="text-align:center;">
<img src="http://blog.tetsutakara.com/wp-content/uploads/2009/11/repeat_Bg.jpg" alt="repeat_Bg" title="repeat_Bg" width="450" height="450" class="alignnone size-full wp-image-681" />
</p>
<div class="sub">My repeatable background pattern</div>

<p>I went through various variations of the design, getting feedback from friends and coworkers. <a href="http://markdunkley.com/">Mark Dunkley</a> gave me a lot of quality feedback, as usual. I really liked the idea of having a 100% width &lt;div&gt;&#8217;s for the headers and footers. Later on I felt that having multiple &lt;div&gt;&#8217;s spanning across the page was a bit overkill, so I decided to keep it for just the footer.</p>

<p>Big props to Steve Hatcher&#8217;s <a href="http://www.cssstickyfooter.com/" title="CSS Sticky Footer" target="_blank">CSS Sticky Footer</a>, which I&#8217;m using using for this site. I can&#8217;t even think of how much time I would have spent if I were to figure out how to make a sticky footer on my own. Thank you, Mr. Hatcher!!</p>

<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/11/old_design2.png" alt="old_design2" title="old_design2" width="588" height="378" class="alignnone size-full wp-image-687" /></p>
<div class="sub">An earlier version of the new design</div>

<p>I think now I can finally say that I&#8217;m content with the design of my blog. Any feedback/comments would be greatly appreciated! I also have a pretty kick-ass Shopify tutorial coming up, so stay tuned!</p>

<p><strong>UPDATE (11/20/2009):</strong> Taking Caroline&#8217;s advice, I decided to make it so that my logo is only present on the index page. This should make it easier for visitors with smaller laptops to browse my site :). Also, created a <a href="http://blog.tetsutakara.com/asdfasfda">404 page.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tetsutakara.com/650/new-design/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Shopify Tutorial: Making Sure a User Agrees to the Terms &amp; Conditions Using jQuery</title>
		<link>http://blog.tetsutakara.com/593/shopify-tutorial-making-sure-a-user-agrees-to-the-terms-conditions-using-jquery/</link>
		<comments>http://blog.tetsutakara.com/593/shopify-tutorial-making-sure-a-user-agrees-to-the-terms-conditions-using-jquery/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 15:02:31 +0000</pubDate>
		<dc:creator>Tetsuro</dc:creator>
				<category><![CDATA[Shopify]]></category>

		<guid isPermaLink="false">http://blog.tetsutakara.com/?p=593</guid>
		<description><![CDATA[In this short tutorial, I will be walking you through how to prevent users from going to the checkout page unless they have agreed to the Terms and Conditions using jQuery. We&#8217;ll be doing this by adding a checkbox to the cart page, which if checked, will allow the user to go the the checkout [...]]]></description>
			<content:encoded><![CDATA[<p>In this short tutorial, I will be walking you through how to prevent users from going to the checkout page unless they have agreed to the Terms and Conditions using jQuery. We&#8217;ll be doing this by adding a checkbox to the cart page, which if checked, will allow the user to go the the checkout page. If it&#8217;s not checked, an alert box will be shown, and the user will be prevented from going to the checkout page. </p>

<h2 class="steps">1. Download jQuery</h2>

<p>You can download jQuery <a href="http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.3.2.min.js&#038;downloadBtn=">here</a>.</p>

<h2 class="steps">2. Add jQuery to your theme assets</h2>

<p>In the Shopify backend, navigate to Assets &gt; Theme Editor. Under Theme Assets, click the Browse button, and navigate to where you saved the jQuery file from Step 1. Double click the file to upload. </p>

<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/11/jquery-upload-612x227.png" alt="jquery-upload" title="jquery-upload" width="588" height="218" class="aligncenter size-medium wp-image-595" /></p>
<span id="more-593"></span>
<h2 class="steps">3. Load up jQuery in theme.liquid</h2>

<p>In Theme Editor, open theme.liquid. In the &lt;head&gt; section, enter the following code.</p>

<pre>
<code>{{ 'jquery-1.3.2.min.js' |asset_url  | script_tag }}</code>
</pre>

<p>This code will load the jQuery script that you uploaded in the &lt;head&gt; section of all of your store&#8217;s pages. </p>

<h2 class="steps">4. Adding the checkbox in cart.liquid</h2>

<p>In Theme Editor, open cart.liquid. Enter the following code &#8211; this will insert a checkbox and a label to your cart page. Please make sure that the ids of the checkbox and the label are the same (I named mine &#8220;agree&#8221;). </p>

<pre>
<code>&lt;input type="checkbox" id="agree"/&gt;
&lt;label for="agree"&gt;I agree with the Terms and Conditions&lt;/label&gt;</code>
</pre>

<p>The location of where the above code goes will depend on how you want to style your cart page, but it can really go anywhere within the cart.liquid template. For this example, I&#8217;m using the Minimify theme, and I&#8217;ve placed the checkbox and its label directly above the checkout button. Here is what my cart page looks like:</p>

<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/11/cart-page-612x390.png" alt="cart-page" title="cart-page" width="588" height="374" class="aligncenter size-medium wp-image-596" /></p>

<p>For the next step, you&#8217;re going to need the id of the checkout button&#8217;s &lt;input&gt;. The id will be used in the jQuery code in step 5. In my example, I gave the input an id named &#8220;checkout&#8221;. </p>

<h2 class="steps">5. Enter the jQuery code</h2>

<p>The last step it to add the jQuery code that checks to see if the checkbox has been checked or not. Open theme.liquid again, and enter the following code in the &lt;head&gt; section. The id of the checkout button is labeled in red. Be sure to add a pound sign (#) before the name of your checkout button&#8217;s id.</p>

<pre>
<code>&lt;script type="text/javascript"&gt;
  $(document).ready(function(){
    $("<span style="color:red;">#checkout</span>").click(function(){
      if($('#agree').is(':checked')){
        $("<span style="color:red;">#checkout</span>").submit();
      }
      else{
        alert("Please agree to the Terms and Conditions");
        return false;
      }
    });
  });
&lt;/script&gt;</code>
</pre>

<p>$(&#8220;#checkout&#8221;).click(function(){}); is a function that runs whenever the input with the id &#8220;checkout&#8221; is clicked. It then checks if the checkbox with id &#8220;agree&#8221; is checked or not. If it is checked, then it will proceed to the checkout page. If not, it will show an alert box with the message &#8220;Please agree to the Terms and Conditions&#8221;, and the user will NOT be taken to the checkout page.</p>

<p>If you are using another Javascript framework such as Prototype in your theme, you may have to use noConflict mode. Shown below is the same code but in noConflict mode.</p>

<pre>
<code>&lt;script type="text/javascript"&gt;
 jQuery.noConflict();    
 jQuery(document).ready(function(){
   jQuery("#checkout").click(function(){
    if(jQuery('#agree').is(':checked')){
      jQuery("#checkout").submit();
    }
    else{
      alert("Please agree to the Terms and Conditions");
      return false;
   }
   });
 });
&lt;/script&gt;</code>
</pre>

<p>Once this code is in place, your customers will not be able to proceed to the checkout without having checked the &#8220;I agree&#8221; checkbox. If they don&#8217;t have it checked, they will be shown a Javascript alert box instead of being taken to the checkout page.</p>

<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/11/Screen-shot-2009-11-09-at-9.59.47-AM-612x485.png" alt="Screen shot 2009-11-09 at 9.59.47 AM" title="Screen shot 2009-11-09 at 9.59.47 AM" width="588" height="465" class="alignnone size-medium wp-image-612" /></p>

 <h2 class="steps">Conclusion</h2>

<p>This may be a bit bothersome from a buyer&#8217;s point-of-view, but from my understanding some places have laws that make it imperative to have an &#8220;I agree&#8221; checkbox when buying products online. You can download my example theme with the code in action <a href="http://blog.tetsutakara.com/wp-content/uploads/2009/11/tetsublog-checkout.zip">here</a>.</p>

<p>Hope that helped, &#8217;til next time!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tetsutakara.com/593/shopify-tutorial-making-sure-a-user-agrees-to-the-terms-conditions-using-jquery/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Happy Thanksgiving!</title>
		<link>http://blog.tetsutakara.com/563/happy-thanksgiving/</link>
		<comments>http://blog.tetsutakara.com/563/happy-thanksgiving/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 23:12:56 +0000</pubDate>
		<dc:creator>Tetsuro</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://blog.tetsutakara.com/?p=563</guid>
		<description><![CDATA[Happy Thanksgiving to all my Canadian peoples! I hope you guys are having an awesome long weekend so far. I apologize for the lack of updates recently, I&#8217;ve been extremely busy with client projects, side projects, and moving. I do have a few Shopify tutorial ideas floating around in my mind, but I haven&#8217;t had [...]]]></description>
			<content:encoded><![CDATA[<p>Happy Thanksgiving to all my Canadian peoples! I hope you guys are having an awesome long weekend so far.</p>

<p>I apologize for the lack of updates recently, I&#8217;ve been extremely busy with client projects, side projects, and moving. I do have a few Shopify tutorial ideas floating around in my mind, but I haven&#8217;t had much time to sit down and write them out. I&#8217;m hoping that in the coming weeks things will start to slow down.</p>

<p>So a couple of weeks ago, a bunch of my friends at Carleton University got together and started a student club called CUJA (Carleton University Japanese Association). I was appointed to be the web master and graphic designer, so I&#8217;ve been working on their branding, their website, and their membership cards. I&#8217;m still working on the mock-up of the site, shown below (a big, big thank you to my chums Mark Dunkley and Daniel Weinand for their tips and advices!).</p>

<p style="text-align:center;"><a href="http://blog.tetsutakara.com/wp-content/uploads/2009/10/cuja_mockup3.jpg"><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/10/cuja_mockup3-300x183.jpg" alt="cuja_mockup3" title="cuja_mockup3" width="300" height="183" class="aligncenter size-medium wp-image-570" /></a></p>

<p>Just yesterday one of the CUJA execs and I went to Staples to order the membership cards that I had designed. They won&#8217;t be ready for another 4-5 days, but I can&#8217;t wait to see how they turn out! </p>

<p style="text-align:center;"><a href="http://blog.tetsutakara.com/wp-content/uploads/2009/10/cards.png"><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/10/cards-300x225.png" alt="cards" title="cards" width="300" height="225" class="aligncenter size-medium wp-image-577" /></a></p>

<p>Another thing that was keeping me busy was moving. A couple of weeks ago I had moved from my former apartment to my parent&#8217;s place so that I can live with them until the new apartment becomes available. It&#8217;s my first time living at home in two years, so it was definitely a heart-warming experience (free food is also a huge plus!). I&#8217;ll be moving to the new place in about a week, and once I settle in I&#8217;ll be working more on the Shopify tutorials.</p>

<p>Well that&#8217;s enough rambling for today! Happy Thanksgiving everyone!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tetsutakara.com/563/happy-thanksgiving/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Shopify Tutorial: Customizing the Settings Form (Part 2 of 2)</title>
		<link>http://blog.tetsutakara.com/530/shopify-tutorial-customizing-the-settings-form-part-2-of-2/</link>
		<comments>http://blog.tetsutakara.com/530/shopify-tutorial-customizing-the-settings-form-part-2-of-2/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 00:05:44 +0000</pubDate>
		<dc:creator>Tetsuro</dc:creator>
				<category><![CDATA[Shopify]]></category>

		<guid isPermaLink="false">http://localhost:8888/?p=530</guid>
		<description><![CDATA[Last week I posted a tutorial on how to make some text customizable using the settings form. In this tutorial, I will be showing you how to customize the font and background using the settings form. I will be continuing to work on the Minimify theme that we modified in the last tutorial: please click [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I posted <a href="http://blog.tetsutakara.com/?p=248">a tutorial</a> on how to make some text customizable using the settings form. In this tutorial, I will be showing you how to customize the font and background using the settings form. I will be continuing to work on the Minimify theme that we modified in the last tutorial: please click <a href="http://blog.tetsutakara.com/wp-content/uploads/2009/09/minimify_mod.zip">here</a> to download the theme if you don&#8217;t have it handy.</p>

<h2 class="steps">1. Create a new fieldset</h2>

<p>Let&#8217;s start off by creating a new fieldset. Fieldsets allow you to group different sets of settings form inputs. For example, you can group all inputs that affect the font colors under a fieldset called &#8220;Font Colors&#8221;. Open the settings form code, add a new fieldset (as shown below in red).</p>

<pre><code>&lt;h3&gt;My very own settings form!&lt;/h3&gt;
&lt;fieldset&gt;
    &lt;legend&gt;Colors&lt;/legend&gt;
    &lt;table&gt;
      &lt;tr&gt;
        &lt;th&gt;&lt;label for="text_color"&gt;Regular text&lt;/label&gt;&lt;/th&gt;
        &lt;td&gt;&lt;input id="text_color" name="text_color" class="color" value="#d60f0f"/&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;&lt;label for="link_color"&gt;Link Color&lt;/label&gt;&lt;/th&gt;
        &lt;td&gt;&lt;input id="link_color" name="link_color" class="color" value="#d60f0f"/&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;&lt;label for="link_hover_color"&gt;Link Color Hover&lt;/label&gt;&lt;/th&gt;
        &lt;td&gt;&lt;input id="link_hover_color" name="link_hover_color" class="color" value="#d60f0f"/&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
&lt;/fieldset&gt;
<span style="color:red;">&lt;fieldset&gt;
    &lt;legend&gt;Font, Logo, Background&lt;/legend&gt;
    &lt;table&gt;
    &lt;/table&gt;
&lt;/fieldset&gt;</span></code></pre>
<span id="more-530"></span>

<p>The &lt;legend&gt; tag works as the title of the fieldset. I named the new fieldset &#8220;Font, Background, Logo&#8221; because I&#8217;ll be adding settings for these elements in this tutorial. Notice how in the screenshot below, the title that I had between the &lt;legend&gt; tag appears as the title of the fieldset on the actual form. Your form should now look like this:</p>

<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/09/forms1a1-588x186.png" alt="forms1a" title="forms1a" width="588" height="186" class="alignnone size-medium wp-image-625" /></p>

<p>Alright! Now that we&#8217;ve got the new fieldset up, let&#8217;s fill&#8217;er up with some new settings!</p>

<h2 class="steps">2. Customizing the Regular Text Font</h2>

<p>To create a dropdown menu that will allow users to change font of the regular text, you must first insert a new &lt;select&gt; tag inside the fieldset. For the remainder of the tutorial, we&#8217;ll be working in this fieldset only. Open the code for settings.html, and enter the code colored in red below in our newly-created fieldset.</p>

<pre><code>&lt;fieldset&gt;
    &lt;legend&gt;Font, Logo, Background&lt;/legend&gt;
    &lt;table&gt;
      <span style="color:red;">&lt;tr&gt;
        &lt;th&gt;&lt;label for="regular_font"&gt;Regular text&lt;/label&gt;&lt;/th&gt;
        &lt;td&gt;
          &lt;select class="font" name="regular_font" id="regular_font"&gt;
               &lt;option value="Helvetica, Arial, sans-serif" selected="selected"&gt;Helvetica, Arial, sans-serif&lt;/option&gt;
          &lt;/select&gt;
        &lt;/td&gt;
      &lt;/tr&gt;</span>
    &lt;/table&gt;
&lt;/fieldset&gt;</code></pre>

<p>This will create a new drop-down with the id &#8220;regular_font&#8221; in your settings form. In my example, I have it so that &#8216;Helvetica, Arial, sans-serif&#8217; is the default font, but you can easily set it so that it&#8217;s another font from the list. For example, if you want Trebuchet MS to be the selected font, you can put the following &lt;option&gt; tag instead:</p>

<pre><code>&lt;option value="Trebuchet MS, sans-serif"&gt;Trebuchet MS, sans-serif&lt;/option&gt;</code></pre>

<p>Click save, and refresh your screen. Your settings form should now look like the screenshot below. </p>

<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/09/forms2a1-588x238.png" alt="forms2a" title="forms2a" width="588" height="238" class="alignnone size-medium wp-image-629" /></p>

<p>The next step is to link font selected in this new dropdown menu with layout.css.liquid. Open layout.css.liquid, and look for the &#8216;font-family&#8217; property for the body selector. The &#8216;body&#8217; selector for layout.css.liquid is shown below.</p>

<pre><code>body {
	background: #fff;
	padding: 0;
	margin: 0;
	font-family: Arial, Helvetica, sans-serif;
	line-height: 1.5em;
	font-size: small;
        color: {{ settings.text_color }};
	}</code></pre>

<p>You want to replace the value of the &#8216;font-family&#8217; property with the Liquid tag that outputs the option selected in the &#8220;regular_font&#8221; dropdown. To do this, simply replace the value for &#8216;font-family&#8217; with the following Liquid tag.</p>

<pre><code>font-family: {{ settings.regular_font }};</code></pre>

<p>Save layout.css.liquid. Now that the &#8220;regular_font&#8221; dropdown is tied in with layout.css.liquid, you can change the font on your site by simply selecting a font from the settings form, and clicking the &#8220;Save Changes&#8221; button!</p>

<h2 class="steps">3. Customizing the Logo</h2>

<p>Being able to swap logos is probably the most sought-after feature by those who do not know HTML/CSS. This can now be done very easily thanks to the settings form.</p>

<p>To start, enter the two new &lt;input&gt; tags (shown below in red and blue) inside the settings.html code.</p>

<pre><code>&lt;fieldset&gt;
    &lt;legend&gt;Font, Logo, Background&lt;/legend&gt;
    &lt;table&gt;
     &lt;tr&gt;
        &lt;th&gt;&lt;label for="regular_font"&gt;Regular text&lt;/label&gt;&lt;/th&gt;
        &lt;td&gt;
          &lt;select class="font" name="regular_font" id="regular_font"&gt;
            &lt;option value="Helvetica, Arial, sans-serif" selected="selected"&gt;Helvetica, Arial, sans-serif&lt;/option&gt;
          &lt;/select&gt;
        &lt;/td&gt;
     &lt;/tr&gt;
     <span style="color:red;">&lt;tr&gt;
       &lt;th&gt;&lt;label for="use_logo_image"&gt;Use a custom site logo?&lt;/label&gt;&lt;/th&gt;
       &lt;td&gt;&lt;input type="checkbox" id="use_logo_image" name="use_logo_image" value="1"/&gt;&lt;/td&gt;
     &lt;/tr&gt;</span>
     <span style="color:blue;">&lt;tr&gt;
      &lt;th&gt;Site logo&lt;/th&gt;
      &lt;td&gt;&lt;input type="file" id="logo_image" name="logo.png" data-max-height="200" data-max-width="800"/&gt;&lt;/td&gt;
     &lt;/tr&gt;</span>
    &lt;/table&gt;
&lt;/fieldset&gt;</code></pre>

<p>What&#8217;s really cool is that you can set the maximum width and maximum height of the logo being uploaded, using the &#8216;data-max-height&#8217; and &#8216;data-max-width&#8217; attributes. This means that you don&#8217;t have to worry about cropping your image to the right size, because the form will do it for you without screwing up the proportions of the image.  In the code above, I have set the maximum width to be 800 pixels because that is the width of the store&#8217;s layout.</p>

<p>Save the settings form, and hit refresh. Your settings form should now look like this:</p> 

<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/09/forms3a1-588x277.png" alt="forms3a" title="forms3a" width="588" height="277" class="alignnone size-medium wp-image-630" /></p>

<p>What we have now is a checkbox that checks to see if the user wants to use his own logo or not, and an input for selecting the image that the user wants to use as the logo. </p>

<p>Unlike the other settings, we need to modify theme.liquid instead of layout.css.liquid. This is because we&#8217;re going to be outputting an image, and not modifying a CSS property. Open up theme.liquid, and look for the div with id &#8220;header&#8221;. In the Minimify theme, this is the div that contains the logo, so we&#8217;re going to be adding some Liquid to link it with our settings form.</p>

<pre><code>&lt;div id="header" class="clearfix"&gt;
  &lt;h1 id="logo"&gt;
    &lt;a href="/" title="Go Home"&gt;{{shop.name}}&lt;/a&gt;
  &lt;/h1&gt;
  &lt;div id="cartlinks"&gt;
    &lt;h2 id="cartcount"&gt;
      &lt;a href="/cart"&gt;Cart&lt;/a&gt;&lt;sup&gt;{{ cart.item_count }}&lt;/sup&gt;
    &lt;/h2&gt;
  &lt;/div&gt;
&lt;/div&gt;</code></pre>

<p>Replace the &#8220;header&#8221; div with the code below.</p>

<pre><code>&lt;div id="header" class="clearfix"&gt;
  <span style="color:red;">{% if settings.use_logo_image %}</span>
    <span style="color:blue;">&lt;a href="/" title="Go Home"&gt;&lt;img src="{{ 'logo.png' | asset_url }}" alt="{{shop.name}}" /&gt;&lt;/a&gt;</span>
  <span style="color:red;">{% else %}</span>
  <span style="color:green;">&lt;h1 id="logo"&gt;
    &lt;a href="/" title="Go Home"&gt;{{shop.name}}&lt;/a&gt;
  &lt;/h1&gt;</span>
  <span style="color:red;">{% endif %}</span>
  &lt;div id="cartlinks"&gt;
    &lt;h2 id="cartcount"&gt;
      &lt;a href="/cart"&gt;Cart&lt;/a&gt;&lt;sup&gt;{{ cart.item_count }}&lt;/sup&gt;
    &lt;/h2&gt;
  &lt;/div&gt;
&lt;/div&gt;</code></pre>

<p>What we did above is we added a conditional statement (labeled above in red) to check to see if the user has the &#8220;use_logo_image&#8221; checkbox checked off. The line {% if settings.use_logo_image %} checks to see if &#8220;use_logo_image&#8221; is checked. If it is, then it will run the code in blue, which outputs &#8216;logo.png&#8217;. If it not checked, it will run the code shown above in green, which simply output the shop name in text.</p>

<p>When you upload an image for the logo, the form will automatically rename the file &#8220;logo.png&#8221;, so you don&#8217;t have to worry about renaming anything in theme.liquid.</p>

<p>
<strong>Before:</strong>
<img src="http://blog.tetsutakara.com/wp-content/uploads/2009/09/forms51-588x548.png" alt="forms5" title="forms5" width="588" height="548" class="alignnone size-medium wp-image-631" />
</p>

<p>
<strong>After:</strong>
<img src="http://blog.tetsutakara.com/wp-content/uploads/2009/09/forms4-588x549.png" alt="forms4" title="forms4" width="588" height="549" class="alignnone size-medium wp-image-634" />
</p>]]></content:encoded>
			<wfw:commentRss>http://blog.tetsutakara.com/530/shopify-tutorial-customizing-the-settings-form-part-2-of-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Birth of Boomi</title>
		<link>http://blog.tetsutakara.com/288/the-birth-of-boomi/</link>
		<comments>http://blog.tetsutakara.com/288/the-birth-of-boomi/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 04:37:41 +0000</pubDate>
		<dc:creator>Tetsuro</dc:creator>
				<category><![CDATA[Art]]></category>

		<guid isPermaLink="false">http://blog.tetsutakara.com/?p=288</guid>
		<description><![CDATA[You may be wondering, "what the hell is that Boombox thing on the top-right corner of your site?". Allow me to introduce you to Boomi. The idea for Boomi spawned from a picture of a boom box that I saw on Flickr. The boom box kind of reminded me of a robot head, so I [...]]]></description>
			<content:encoded><![CDATA[<p>You may be wondering, "what the hell is that Boombox thing on the top-right corner of your site?". Allow me to introduce you to Boomi.</p>

<p>The idea for Boomi spawned from a picture of a boom box that I saw on Flickr. The boom box kind of reminded me of a robot head, so I started doodling on my notepad. After a few sketches, I decided to use him for a music video project that I had to do for Audio/Video class back in 2007. His debut was in the following music video (WARNING: my animation skills are laughable).</p>

<p style="text-align:center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/ttUdiqKk3r8&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/ttUdiqKk3r8&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>

<span id="more-288"></span>

<p>I was pretty satisfied with the music video, but I felt that I could further develop Boomi as a character. In summer 2008, I decided to make Boomi into a physical product, with the magic of papercraft. I felt that papercraft was the perfect medium to turn Boomi into a physical product because A) Boomi has a very 'boxy' shape, which is ideal for papercraft, and B) papercraft is cheap. Another reason why I wanted to make Boomi into a physical was that I wanted to create my own 'designer toy' - kind of like a poor man's Munny doll ;)</p>

<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/09/pic11-588x441.jpg" alt="pic1" title="pic1" width="588" height="441" class="alignnone size-medium wp-image-646" /></p>

<p>I started off by drawing many sketches of what the new-and-improved Boomi might look like. I drew many different versions of Boomi in different angles and shapes, keeping in mind that I have to make him simple to make with paper. Unfortunately I seem to have lost almost all of my sketches - the scan above is one of the few I could find.</p>

<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/09/pic21-588x441.jpg" alt="pic2" title="pic2" width="588" height="441" class="alignnone size-medium wp-image-647" /></p>

<p>I then created blueprints for Boomi and started to build some prototype models. I experimented with different sizes, shapes, and proportions, until I was 100% satisfied. I used scrap paper for all prototypes in order to minimize the waste of paper. The trickiest part was coming up with a way to make the head. I learned that it's not very easy to create a box with paper, because the paper is usually too flimsy to close off the final edge (I'm sorry, it's a little difficult to explain in words, but it's actually pretty tricky building a box out of thin paper). </p>

<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/09/pic41-588x441.jpg" alt="pic4" title="pic4" width="588" height="441" class="alignnone size-medium wp-image-648" /></p>

<p style="text-align:center;"><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/09/pic3.jpg" alt="pic3" title="pic3" width="453" height="604" class="aligncenter size-full wp-image-302" /></p>

<p>Shown above are pictures of the version 1.0 release of Boomi. Although I am very satisfied with the look-and-feel of Boomi, I feel that I can still improve on the blueprint, and make him easier to build. In the upcoming weeks, I plan on creating improved and simpler blueprints for Boomi. </p>

<p>Please click <a href="http://blog.tetsutakara.com/wp-content/uploads/2009/09/Boomi-v.1.0.zip">here</a> to download the blueprints for Boomi v.1.0. Boomi currently comes in 4 flavours: Yellow, Mocha, Pink, and Blank. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tetsutakara.com/288/the-birth-of-boomi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shopify Tutorial: Customizing the Settings Form (Part 1 of 2)</title>
		<link>http://blog.tetsutakara.com/248/shopify-tutorial-customizing-the-settings-form-part-1-of-2/</link>
		<comments>http://blog.tetsutakara.com/248/shopify-tutorial-customizing-the-settings-form-part-1-of-2/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 13:22:40 +0000</pubDate>
		<dc:creator>Tetsuro</dc:creator>
				<category><![CDATA[Shopify]]></category>

		<guid isPermaLink="false">http://blog.tetsutakara.com/?p=232</guid>
		<description><![CDATA[A few weeks back, Shopify released a new feature that allows designers to create a form within the theme editor that allow those without programming knowledge to customize their theme. The default themes already come with a form that allows you to customize certain aspects of the theme, but what if you want to add [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks back, Shopify <a href="http://blog.shopify.com/2009/8/26/theme-customization-for-everyone" target="_blank">released a new feature</a> that allows designers to create a form within the theme editor that allow those without programming knowledge to customize their theme. The default themes already come with a form that allows you to customize certain aspects of the theme, but what if you want to add more customizable elements to the store? Or perhaps you&#8217;ve made a theme from scratch, and want to make your theme customizable so that your client can customize the theme themselves when you hand it over to them.</p>
<p>In this tutorial, I&#8217;m going to be using an older version of the Minimify theme to walk you through how to make the text colors customizable using the settings form. Please click <a href="http://blog.tetsutakara.com/wp-content/uploads/2009/09/minimify.zip">here</a> to download the Minimify theme. With that said, you can still follow this tutorial with a completely different theme.</p>
<h2 class="steps">1. Create the form</h2>
<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/09/settings11-588x125.png" alt="settings1" title="settings1" width="588" height="125" class="alignnone size-medium wp-image-640" /></p>
<p>In the Theme Editor, click the &#8220;Create a settings form&#8221; button.</p>
<p><span id="more-248"></span></p>
<h2 class="steps">2. Rename &#8220;layout.css&#8221; to &#8220;layout.css.liquid&#8221;</h2>
<p>The next thing you want to do is rename your CSS file so that it has a .liquid extension.  This will allow you to have Liquid variables in your CSS file, which is necessary in order to make the settings form affect the values in your CSS file.</p>
<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/09/settings21-588x271.png" alt="settings2" title="settings2" width="588" height="271" class="alignnone size-medium wp-image-641" /></p>
<p>Open layout.css, and click the &#8220;Rename&#8221; link up top. This will open a textbox where you can rename the file. Add &#8216;.liquid&#8217; to the name of the css file, and click the &#8220;Rename&#8221; button to save your changes.</p>
<h2 class="steps">3. Customizing the Regular Text Color</h2>
<p>Let&#8217;s start off by having the form modify the color of the regular text of the theme. By default, the form will have 5 customizable elements, Regular Text, Accents, Background, Headers, and Regular Text. Changing the values in the form won&#8217;t do anything yet, because we haven&#8217;t told  the layout.css.liquid file what to change.</p>
<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/09/settings31-588x221.png" alt="settings3" title="settings3" width="588" height="221" class="alignnone size-medium wp-image-642" /></p>
<p>In the theme editor, click the link that says &#8220;edit this form&#8221;. Doing this will open the code for settings.html.</p>
<p>Delete the entire content of settings.html, and copy/paste the following block of code. This is so that we can start fresh.</p>
<p>
<pre><code>  &lt;h3&gt;My very own settings form!&lt;/h3&gt;

  &lt;fieldset&gt;
    &lt;legend&gt;Colors&lt;/legend&gt;
    &lt;table&gt;
      &lt;tr&gt;
        &lt;th&gt;&lt;label for="text_color"&gt;Regular text&lt;/label&gt;&lt;/th&gt;
        &lt;td&gt;&lt;input id="text_color" name="text_color" class="color" value="#d60f0f"/&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
  &lt;/fieldset&gt;</code></pre>
</p>
<p>Click save, close settings.html, and refresh your page. What you have now is a single color picker with the id &#8220;text_color&#8221;. This id is important to remember, as we need it to match it up with the color value in layout.css.liquid for the magic to happen. Your form should now look like this:</p>
<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/09/settings41-588x163.png" alt="settings4" title="settings4" width="588" height="163" class="alignnone size-medium wp-image-643" /></p>
<p>You can change the default color of the color picker by changing the hex value in the &#8220;value&#8221; attribute of the input. In the example above, it has the color &#8220;#d60f0f&#8221;, but you can change it to any hex color you wish.</p>
<p>Open layout.css.liquid, and look for the selector for the &#8216;body&#8217; attribute. It should look like this:</p>
<p>
<pre><code>  body {
    background: #fff;
    padding: 0;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5em;
    font-size: small;
    <span style="color:red">color: #000;</span>
  }</code></pre>
</p>
<p>Notice the line in red &#8211; this is the CSS property that we want to modify with the form. What we&#8217;re going to do now is put in some Liquid to &#8216;link&#8217; the color value from the color picker to the value of the &#8220;color&#8221; property of the body selector.</p>
<p>Enter {{ settings.text_color }} for the value of the color property. It should look like this:</p>
<p>
<pre><code>  color: {{ settings.text_color }};</code></pre>
</p>
<p>Notice how &#8220;text_color&#8221; in the Liquid tag above matches up with the id of the color picker&#8217;s id. This is how we tell Liquid to take the hex value of the color picker with the id &#8220;text_color&#8221;, and output it in the CSS file. Save layout.css.liquid.</p>
<p>Here comes the exciting part! In your settings form, pick any color that you want to be the color for the regular text. Click the &#8220;Save changes&#8221; button. When you refresh your store, you should see that the regular text is now the color that you just chose in the Settings form!</p>
<h2 class="steps">Customizing the Link Colors</h2>
<p>Link colors are changed much in the same way as the regular text. Let&#8217;s start off by first adding two more color pickers to your form, one for link colors, the other for the hover color for links.</p>
<p>
<pre><code>  &lt;h3&gt;My very own settings form!&lt;/h3&gt;
  &lt;fieldset&gt;
    &lt;legend&gt;Colors&lt;/legend&gt;
    &lt;table&gt;
      &lt;tr&gt;
        &lt;th&gt;&lt;label for="text_color"&gt;Regular text&lt;/label&gt;&lt;/th&gt;
        &lt;td&gt;&lt;input id="text_color" name="text_color" class="color" value="#d60f0f"/&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;&lt;label for="link_color"&gt;Link Color&lt;/label&gt;&lt;/th&gt;
        &lt;td&gt;&lt;input id="link_color" name="link_color" class="color" value="#d60f0f"/&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;&lt;label for="link_hover_color"&gt;Link Hover Color&lt;/label&gt;&lt;/th&gt;
        &lt;td&gt;&lt;input id="link_hover_color" name="link_hover_color" class="color" value="#d60f0f"/&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
  &lt;/fieldset&gt;</code></pre>
</p>
<p>Open the editor for settings.html by clicking &#8220;edit this form&#8221;. Enter in two more &#60;tr&#62; elements, one for each new color picker. Rename the attributes for the labels and inputs accordingly (I named mine &#8216;link_color&#8217; and &#8216;link_hover_color&#8217;). Your settings.html should now look like this:</p>
<p><img src="http://blog.tetsutakara.com/wp-content/uploads/2009/09/settings51-588x181.png" alt="settings5" title="settings5" width="588" height="181" class="alignnone size-medium wp-image-644" /></p>
<p>Open layout.css.liquid. Enter {{ settings.link_color }} and {{ settings.link_color_hover }} for the &#8216;a&#8217; and &#8216;a:hover&#8217; selectors, respectively, as follows:</p>
<p>
<pre><code> a {
	text-decoration: underline;
	<span style="color:red">color: {{ settings.link_color }};</span>
}

a:hover {
	<span style="color:red">color: {{ settings.link_hover_color }};</span>
	text-decoration: none;
}</code></pre>
</p>
<p>Now using your settings form, pick a color for the Link Color and Link Hover Color, and hit save changes. When you refresh your store, the links should be the color that you picked for Link Color, and when you hover over them, they should be the color that you picked for Link Hover Color!</p>
<h2 class="steps">Conclusion</h2>
<p>In this tutorial, I went over how to set up the settings form to change the colors of some of the text in your theme. You can download what we&#8217;ve done so far <a href="http://blog.tetsutakara.com/wp-content/uploads/2009/09/minimify_mod.zip">here</a>.</p>
<p>In part 2 of this tutorial, I will be walking through how to modify fonts and background images using the settings form. Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tetsutakara.com/248/shopify-tutorial-customizing-the-settings-form-part-1-of-2/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
