<?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>Mesmer Lab &#187; Tutorials</title>
	<atom:link href="http://www.mesmerlab.com/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mesmerlab.com</link>
	<description>Tech and trends in web design+development.</description>
	<lastBuildDate>Tue, 22 Jun 2010 00:59:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>1 Quick Way to Increase Your Website&#8217;s Visibility</title>
		<link>http://www.mesmerlab.com/quick-way-increase-your-website-visibility/</link>
		<comments>http://www.mesmerlab.com/quick-way-increase-your-website-visibility/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 14:36:31 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.mesmerlab.com/?p=759</guid>
		<description><![CDATA[Write more!
If you want your website to show up on your target audience&#8217;s LCD screens, write articles. Keep writing articles. More articles means more keywords. More keywords means more search engine results. More search engine results means more visitors. I&#8217;ll briefly talk about why this works.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/gerlos/3119891607/"><img title="Binoculars portrait (dscn4659_mod_vign_sm)" src="http://farm4.static.flickr.com/3059/3119891607_5c70175eac.jpg" class="alignnone postimage" height="199px" width="300px"></a>Write more!</p>
<p>If you want your website to show up on your target audience&#8217;s LCD screens, write articles. Keep writing articles. More articles means more keywords. More keywords means more search engine results. More search engine results means more visitors. I&#8217;ll briefly talk about why this works.<span id="more-759"></span></p>
<div style="clear:both;"</div>
<h3><acronym title="Search Engine Result Pages">SERPs</acronym></h3>
<p>Search engines love new content (something I&#8217;ve been sorely lacking here lately). If you want to be found, you need findable content, duh! The current rumors I&#8217;m reading say Google doesn&#8217;t like it if you don&#8217;t publish a new article at least weekly. Take that with a grain of salt. Simply put, more articles on more topics will result in more results on search engine result pages thereby increasing your website&#8217;s visibility.</p>
<h3>Viral</h3>
<p>If you write something that sparks an idea in a visitor, that person just might email/tweet/fb/digg/etc your article to a friend. New readers are always a good thing. By definition, more readers equate to a higher visibility of your website.</p>
<h3>Exhibit Credibility</h3>
<p>You want to be known for something? Write a how-to about it. Step-by-step instructions on the best way to season your dirt for a tomato garden are sure to get return visits by potential green-thumbers. For some reason, people think I&#8217;m an authority on <a href="http://www.mesmerlab.com/add-custom-fonts-to-your-wordpress-site/">how to add a custom font to Wordpress</a>. Go figure.</p>
<p>Once you&#8217;re an &#8216;authority&#8217; about a specific task, you&#8217;re website will surely benefit. Another tutorial I developed here was about <a href="http://www.mesmerlab.com/create-new-email-template-magento/">creating email templates in Magento</a>. I took notes while I was learning how to do it. Then I developed my notes into an article, and Bob&#8217;s your uncle.</p>
<p>I have ONE tutorial about Magento on this site. That is by far my most popular post. The custom font one comes in second at about 75% the visits of the email template one. A few of my tutorials have been linked on some pretty obscure websites. Leaving my thanks for the reference and expanding on the specific issues discussed just seems like the right thing to do. And of course this will enforce my credibility and also hopefully lead more visitors to my website.</p>
<h3>Conclusion</h3>
<p>I vow from this day forth to write at least one new article a day. It need not be a well-formed 500 word dissertation worthy of Encyclopaedia Brittanica. It need not be a majestically dissected tutorial worthy of <a href="http://css-tricks.com/">CSS Tricks</a>. By achieving this task I shall gain notoriety on the internet, whether that is a good thing or not.</p>
<p>The internet is a fickle mistress. Keep her interested and she will hopefully return the favor.</p>
<p><i>image by:</i> <a href="http://www.flickr.com/photos/gerlos/3119891607/">gerlos</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mesmerlab.com/quick-way-increase-your-website-visibility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a New Email Template in Magento</title>
		<link>http://www.mesmerlab.com/create-new-email-template-magento/</link>
		<comments>http://www.mesmerlab.com/create-new-email-template-magento/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 21:26:30 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.mesmerlab.com/?p=537</guid>
		<description><![CDATA[Emails are a big part of the online world, so it follows that a professional ecommerce site should have professional email templates. A full-featured ecommerce solution is what you&#8217;ll find with Magento, an open source solution for selling products online. Magento provides a system to keep the more basic contact times with your visitors smooth [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.magentocommerce.com/"><img src="http://www.mesmerlab.com/wp-content/uploads/2009/06/magento-logo.jpg" alt="Magento Open Source eCommerce" title="magento-logo" width="276" height="250" class="size-full wp-image-541 postimage" /></a>Emails are a big part of the online world, so it follows that a professional ecommerce site should have professional email templates. A full-featured ecommerce solution is what you&#8217;ll find with <a href="http://www.magentocommerce.com/" target="_blank">Magento, an open source solution for selling products online</a>. Magento provides a system to keep the more basic contact times with your visitors smooth and carefree. With open source comes great customization (and complexity).</p>
<p>This tutorial will guide you through the steps to create a new email template in Magento. Specifically, you&#8217;ll create the email that your visitors will receive when they sign up for your newsletter. </p>
<p><span id="more-537"></span></p>
<h4>Requirements</h4>
<ul>
<li>Access to your website&#8217;s Magento admin panel</li>
<li>A little knowledge of how HTML emails work</li>
<li>This tutorial</li>
</ul>
<h3>Step One: Create the Template</h3>
<p>I said you need to know a little about how to create an HTML email, but since Magento comes with many templates you can kind of get away without the knowledge at first.</p>
<p><img src="http://www.mesmerlab.com/wp-content/uploads/2009/06/admin-login-300x100.png" alt="Magetno&#039;s admin login screen" title="Magetno&#039;s admin login screen" width="300" height="100" class="alignright size-medium wp-image-546 postimage" /></p>
<ul>
<li>Log into your admin panel and navigate to System > Transactional Emails.</li>
<li>Click the &#8216;Add New Template&#8217; button on the top right.</li>
<li>Choose one of the default templates from the first drop down box.</li>
</ul>
<p><img src="http://www.mesmerlab.com/wp-content/uploads/2009/06/transactional-emails-300x222.png" alt="System &gt; Transactional Emails" title="System &gt; Transactional Emails" width="300" height="222" class="alignnone size-medium wp-image-571 postimage" />In this tutorial we&#8217;ll be using the &#8216;Newsletter subscription confirmation&#8217; template. This would typically be the first email your visitors would receive so I figured it would be a good choice. Choose the locale of course, then click the &#8216;Load Template&#8217; button.</p>
<div class="clear"></div>
<p><img src="http://www.mesmerlab.com/wp-content/uploads/2009/06/template-interface-300x181.png" alt="Template Interface" title="Template Interface" width="300" height="181" class="alignnone size-medium wp-image-554 postimage" />This will load the appropriate template which in this example is located in the /app/code/locale/en_US/template/email/ directory. The filename is &#8216;account_new_confirmation.html&#8217;. As you can see, it is very easy to alter the templates for international support. You can leave most of the template as they have presented it. I&#8217;ve changed the email addresses, the phone number, the store name and the source URL for the logo.</p>
<div class="clear"></div>
<p>Back in the admin panel, give your template a name. To keep things simple, I&#8217;ve used &#8216;Newsletter Subscription Confirmation&#8217; for the name and the subject. Now here&#8217;s where you can modify the template to suit your specific needs. One of the key features of Magento is the ability to have multiple stores within one installation. Therefore you can load the same template in the first half of this step, then modify it for each store in the second half.</p>
<p><img src="http://www.mesmerlab.com/wp-content/uploads/2009/06/save-template-300x63.png" alt="Save Template" title="Save Template" width="300" height="63" class="alignnone size-medium wp-image-556 postimage" /> Click the &#8216;Save Template&#8217; button on the top right and you&#8217;ll see your new template in the list of Transactional Emails. Now lets move on to implementing it into your site.</p>
<h3>Step Two: Using Your Template</h3>
<p><img src="http://www.mesmerlab.com/wp-content/uploads/2009/06/system-configuration-300x273.png" alt="System Configuration" title="System Configuration" width="300" height="273" class="alignnone size-medium wp-image-560 postimage" />From the top horizontal menu, navigate to System > Configuration.</p>
<div class="clear"></div>
<p><img src="http://www.mesmerlab.com/wp-content/uploads/2009/06/customer-newsletter-300x192.png" alt="Customers &gt; Newsletter" title="Customers &gt; Newsletter" width="300" height="192" class="alignnone size-medium wp-image-564 postimage" />Scroll down to the Customers section on the left menu and select Newsletter.</p>
<div class="clear"></div>
<p><img src="http://www.mesmerlab.com/wp-content/uploads/2009/06/select-template-300x243.png" alt="Select your new template" title="Select your new template" width="300" height="243" class="alignnone size-medium wp-image-568 postimage" />In the drop down box for Confirmation Email Template, choose the new template you just created. The option just above it should be set to Customer Support. Click the &#8216;Save Config&#8217; button on the top right and you&#8217;re done.</p>
<div class="clear"></div>
<h3>Step Three: Testing Your Template</h3>
<p>Now navigate to the public version of your site to the Newsletter box.</p>
<p>Type in your email and click &#8216;Subscribe&#8217;. Sync your email client and you should see a new email from &#8216;[Site Name] &#8211; Customer Support&#8217; with the subject of &#8216;Newsletter subscription confirmation&#8217;.</p>
<p>Check all the text, make sure the logo shows up and the email addresses and phone number is correct. Make any changes back in the admin at System > Transactional Emails (second image in step one).</p>
<h3>Conclusion</h3>
<p>Magento Commerce, the open source ecommerce solution, can be very intimidating to those of us coming from Wordpress. Its configuration options are very intricate, allowing you to customize designs, layouts and almost every other piece of the site on a per-page basis. Hopefully I&#8217;ve shared some useful knowledge on how to create a new email template in Magento.</p>
<p>Make sure you test your emails extensively. They are acting as your host/hostess, concierge and valet. You want them to be as professional as possible. No typos, easily readable text, and please, be sure to quadruple check your email address and phone number.</p>
<p>A key nugget to remember about HTML emails is you have to put your CSS styling inline. You can&#8217;t reference an external CSS file or even have it in the HEAD. All HTML emails are contained within the BODY tag. Also, don&#8217;t even try using DIVs for your layout. Go old school. Bring out the TABLE tag and party like its 1999. Just look at the example templates they have to get a feel of what is or isn&#8217;t acceptable. If there&#8217;s enough interest, I&#8217;ll write a post on my experience with HTML emails.</p>
<p>I will be adding more quick tutorials like this for Magento as I wade through their user guide and forum. Please feel free to comment or ask a question in the form below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mesmerlab.com/create-new-email-template-magento/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Here&#8217;s a Quick Way to Add a Custom Date Graphic to your WordPress Blog</title>
		<link>http://www.mesmerlab.com/heres-a-quick-way-to-add-a-custom-date-graphic-to-your-wordpress-blog/</link>
		<comments>http://www.mesmerlab.com/heres-a-quick-way-to-add-a-custom-date-graphic-to-your-wordpress-blog/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 23:28:38 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.mesmerlab.com/?p=396</guid>
		<description><![CDATA[You may have noticed the spiffy new calendar icon here at Mesmer Lab. Well I created the graphic purely in Photoshop and have made it available at Graphic River. A future article will explain how I made it, but this article is about how to implement it into your WordPress blog. 
The goal is to [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.mesmerlab.com/wp-content/uploads/2009/03/max-calendar.jpg" alt="Use this calendar image on your custom WordPress blog." title="Use this calendar image on your custom WordPress blog." width="154" height="150" class="alignright size-full wp-image-399 postimage" />You may have noticed the spiffy new calendar icon here at Mesmer Lab. Well I created the graphic purely in Photoshop and have made it available at Graphic River. A future article will explain how I made it, but this article is about how to implement it into your WordPress blog. </p>
<p>The goal is to get rid of the generic-looking display of each article&#8217;s date. The visitor to most sites would want to know when the article is written to see how relevant the ideas, data or techniques are. A bold display of the date lets the user quickly scan and find the publish date.<span id="more-396"></span></p>
<h3>Step One: The Image</h3>
<p>For quickness, you can download the png file I&#8217;m using here, download the <a href="http://graphicriver.net/item/calendar-icon/32314?ref=Serengeti">full source file at Graphic River</a>, or build your own. Just make note of the dimensions since we&#8217;ll be using it as a background image.</p>
<p>You can use most anything as a date icon.  Common metaphors include a calendar like I&#8217;m using or the piece of paper that <a href="http://www.webdesignerwall.com/">Web Designer Wall</a> uses.</p>
<h3>Step Two: The WordPress Code</h3>
<p>We have to create a few new elements to house the date code. This will take the place of the stock date implementation so we can put or own spin on the look and feel. The following is how I&#8217;ve done it here at Mesmer Lab. I&#8217;ve modified the code in the Main Index Template (index.php).</p>
<blockquote><pre><code>&lt;?php if(have_posts()) : while(have_posts()) : the_post(); ?&gt;

<span style="color:red;">&lt;div class="post"&gt;

&lt;p class="date"&gt;
     &lt;?php the_time('M'); ?&gt;
     &lt;span>&lt;?php the_time('d'); ?&gt;&lt;/span&gt;
&lt;/p&gt;</span>

{your post code goes here}

<span style="color:red;">&lt;/div&gt;</span>

&lt;?php endwhile ?&gt;
</code></pre>
</blockquote>
<p>I&#8217;ve created a DIV with the &#8216;post&#8217; class inside the loop. There&#8217;s a tiny bit of CSS applied to this div and I&#8217;ll explain it in a few minutes. </p>
<p>I&#8217;ve used a paragraph element for the main container. The paragraph seemed to work better than a typical DIV, in regards to ease of modification and cross-browser compatibility. This is where I put the month for the article.</p>
<p>The span element works perfectly inside the paragraph tag, simply because I added the &#8216;display:block&#8217; designation. It seemed to play along better instead of a DIV. The numerical date (with leading zero) resides here.</p>
<h3>Step Three: The WordPress CSS</h3>
<blockquote><pre><code>.post {
position:relative;
}</code></pre>
</blockquote>
<p>The wrapping DIV is set to position relatively. This allows absolute positioning inside for the paragraph element. If you don&#8217;t do this, all the dates on the home page will be on top of each other. Don&#8217;t just copy and paste this code into your theme files. If you&#8217;re not using my specific image, your results will not look right.</p>
<blockquote><pre><code>.date {
background:transparent url(<span style="color:red;">'your-image.png'</span>);
position:absolute;
left:-80px;
top:8px;
color:#fff;
width:56px;
height:61px;
padding:14px 0 0 18px;
font:bold 12px Arial;
}</code></pre>
</blockquote>
<p>Next you&#8217;ll need to link the image to the paragraph and position it absolutely inside the div.post element. The padding and width/height are tied together in the box model. You&#8217;ll have to adjust the width and height depending on how much padding you need for the text to show up properly. Typical font styling is present.</p>
<blockquote><pre><code>.date span {
display:block;
width:100%;
text-align:center;
margin-left:-7px;
margin-top:1px;
line-height:26px;
color:#000;
font: italic bold 24px Georgia,"Times New Roman",Times,serif;
}</code></pre>
</blockquote>
<p>To push the numerical date on a second line, I&#8217;ve employed &#8216;display:block&#8217;. Span by nature displays its contents inline. The margin code is for simple positioning. The line-height is so IE will display the whole number. And we round it out with typical font styling.</p>
<h3>Step Four: Adding to Single Posts</h3>
<p>The next step is relatively easy. Open the Single Post (single.php) file and repeat the code you used in Step Two. This goes in the same place, so it should be easy for you to find.</p>
<h3>Conclusion</h3>
<p>Customization will make your Wordpress site unique. You can add a sense of branding by efficient use of colors, icons or other visual elements. By adding a custom date graphic to your Wordpress site, you are on your way to standing out in the crowd. </p>
<p>I hope you enjoyed this tutorial. Comments, suggestions and how you&#8217;ve implemented this on your site are welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mesmerlab.com/heres-a-quick-way-to-add-a-custom-date-graphic-to-your-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Create a Menu Tree with CSS</title>
		<link>http://www.mesmerlab.com/create-a-graphic-menu-tree-with-css/</link>
		<comments>http://www.mesmerlab.com/create-a-graphic-menu-tree-with-css/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 00:30:34 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[unordered list]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.mesmerlab.com/?p=232</guid>
		<description><![CDATA[In this article I&#8217;ll show you how to get rid of the stock disc that is on the typical unordered list &#60;UL&#62;. This solution will work no matter how many characters are in your list item &#60;LI&#62;. 
You&#8217;ll create two images, throw a little CSS code in the mix, and end up with a very [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.mesmerlab.com/wp-content/uploads/2009/02/feature-image.png" alt="Create a Visual Submenu Tree with Pure CSS" title="Create a Visual Submenu Tree with Pure CSS" width="203" height="226" class="alignright size-full wp-image-314 postimage" />In this article I&#8217;ll show you how to get rid of the stock disc that is on the typical unordered list &lt;UL&gt;. This solution will work no matter how many characters are in your list item &lt;LI&gt;. </p>
<p>You&#8217;ll create two images, throw a little CSS code in the mix, and end up with a very flexible system that will grow with almost anything you throw at it. You can use the already present colors to help your lists tie in with the design. I&#8217;ve used this on a project and the client really liked how it turned out. So continue reading and I&#8217;ll guide you step by step on how to add this customization to your toolbelt. Your clients will love you for it.<span id="more-232"></span></p>
<p><a href="http://www.mesmerlab.com/demo/ul-tree.html" target="_blank">View the demo</a>.</p>
<h3>Step One: Create Two Images</h3>
<p><img src="http://www.mesmerlab.com/wp-content/uploads/2009/02/ul-many-closeup.png" alt="LI background image, long" title="LI background image, long" width="96" height="187" class="alignright size-full wp-image-303 postimage" />Open up your image editor of choice and create a new file 16px wide by 100px tall, or however tall you think a single list item will be in your situation. </p>
<p><img src="http://www.mesmerlab.com/wp-content/uploads/2009/02/ul-end-closeup.png" alt="LI background image, end" title="LI background image, end" width="96" height="90" class="alignright size-full wp-image-304 postimageleft" />You can get a little creative with it, but I drew a simple 1px line. Setting the background transparent will keep your images future-proof if you ever want to change the background color of the site. </p>
<p>So you will end up with two images, one relatively tall with the horizontal bar at the top and another relatively square with the horizontal part ending where it meets the vertical.</p>
<h3>Step Two: Write the CSS Code</h3>
<p>Now open up your code editor of choice. I&#8217;ve used Dreamweaver forever, but I&#8217;m starting to use Notepad++ more often.</p>
<h5>Clear All Inherent Styling</h5>
<p>The first part of the CSS code is extremely important because Internet Explorer still has the majority of the browser share. It is good practice to have a reset file like <a href="http://meyerweb.com/eric/tools/css/reset/index.html">this one</a>. If you&#8217;re not going to use a reset.css file, you must clear the layout of your list.</p>
<blockquote><pre><code>ul {margin:0;padding:0;}</code></pre>
</blockquote>
<h5>Create The Menu Container</h5>
<p>This is optional, in case you already have a home for your menu. But all subsequent code assumes that the &#8217;submenu&#8217; class is applied to your list&#8217;s parent.</p>
<blockquote><pre><code>.submenu {
	width: 200px;
	border: 1px solid #555;
	font: normal bold 12px Verdana, Arial, sans-serif;
	padding:10px;
	color: #3877C4;
	}</code></pre>
</blockquote>
<h5>UL Code</h5>
<p><img src="http://www.mesmerlab.com/wp-content/uploads/2009/02/ul-code.png" alt="Top and bottom padding for spacing, left padding to offset from header text." title="Top and bottom padding for spacing, left padding to offset from header text." width="200" height="185" class="alignright size-full wp-image-346 postimage" />This code will format the unordered list. Add a little top and bottom padding for spacing. The left padding offsets the list from the header text.</p>
<blockquote style="float:left;width:320px;"><pre><code>.submenu ul {
	padding:10px 0 10px 20px;
	}</code></pre>
</blockquote>
<h5>LI Code</h5>
<p><img src="http://www.mesmerlab.com/wp-content/uploads/2009/02/li-code.png" alt="Puts in some breathing room in case there are multiple lines. Gets rid of the stock icon. Adds some bottom padding for spacing." title="Puts in some breathing room in case there are multiple lines. Gets rid of the stock icon. Adds some bottom padding for spacing." width="180" height="157" class="alignright size-full wp-image-350 postimage" />The first line puts in a little breathing room if/when your text expands into multiple lines. Setting the &#8216;list-style-type&#8217; to none gets rid of the stock icon. To end up, we apply a little bottom padding for visual goodness.</p>
<blockquote style="float:left;width:340px;"><pre><code>.submenu li {
	line-height:15px;
	list-style-type:none;
	padding:0 0 8px 0;
	}</code></pre>
</blockquote>
<h5>Second Tier UL Code</h5>
<p><img src="http://www.mesmerlab.com/wp-content/uploads/2009/02/2ndul-code.png" alt="Top padding to push down from the LI parent. Left padding to indent." title="Top padding to push down from the LI parent. Left padding to indent." width="180" height="107" class="alignright size-full wp-image-354 postimage" />We are now into the second level of the menu. A little top padding pushes this UL down from its LI parent. The left padding indents the UL and can be modified to your taste.</p>
<blockquote style="float:left;width:340px;"><pre><code>.submenu li ul {
	padding: 5px 0 0 18px;
	}</code></pre>
</blockquote>
<h5>Second Tier LI Code</h5>
<p><img src="http://www.mesmerlab.com/wp-content/uploads/2009/02/2ndli-code1.png" alt="Left padding to push text off of the image." title="Left padding to push text off of the image." width="179" height="54" class="alignright size-full wp-image-358 postimage" />Now we&#8217;re into the good stuff. Most of your second tier list items will use this piece of code. Make sure you use the correct path to your image file. This is the tall graphic I had you create earlier. Of course we don&#8217;t want it to repeat. And the left padding pushes your LI text over so we can see your shiny new image.</p>
<blockquote style="float:left;width:563px;"><pre><code>.submenu li ul li {
	background-image:url(ul-long.gif);
	background-repeat:no-repeat;
	padding-left:18px;
	}</code></pre>
</blockquote>
<h5>Second Tier LI Code &#8211; Last LI</h5>
<p><img src="http://www.mesmerlab.com/wp-content/uploads/2009/02/2ndli-code-end.png" alt="Zero padding. The 18px from .submenu li ul takes care of this. We&#039;re also swapping the background image." title="Zero padding. The 18px from .submenu li ul takes care of this. We&#039;re also swapping the background image." width="162" height="15" class="alignright size-full wp-image-361 postimage" />So up until this point we have only used a single class, the one applied to the container. To be compatible with all browsers we must employ a class to put the endcap on the list. Now we use the smaller graphic of course. We reset the bottom padding to zero because the second tier UL code does this already.</p>
<blockquote style="float:left;width:563px;"><pre><code>.submenu li ul li.end {
	background-image:url(ul-end.gif);
	padding-bottom:0;
	}</code></pre>
</blockquote>
<h5>Second Tier LI Code &#8211; :last-child</h5>
<p><img src="http://www.mesmerlab.com/wp-content/uploads/2009/02/last-child.png" alt="Internet Explorer doesn&#039;t recognize the :last-child pseudo-class." title="Internet Explorer doesn&#039;t recognize the :last-child pseudo-class." width="176" height="206" class="alignright size-full wp-image-362 postimage" /><span style="color:red;">This code is not suggested for deployment. This is only for demonstration purposes.</span></p>
<p>So as you might know, Internet Explorer likes to employ its own dialect of CSS. One piece of very useful code that is missing in all IE flavors is the :last-child pseudo class. To be fair, :first-child works fine. When not in demonstration mode with three different menus you&#8217;ll want to use the code below. To facilitate the demo of :last-child alongside two other menus I have dropped a &#8216;lastchild&#8217; class on the second tier UL on the demo page, third box.</p>
<p>Open the page in Firefox, Chrome and Safari. You&#8217;ll see no difference in the far right menu. Open in IE and you&#8217;ll get the standard LI code with the tall graphic on the last LI. Maybe they&#8217;ll add it in IE 8.1?</p>
<blockquote><pre><code>.submenu li ul li:last-child {
	background-image:url(ul-end.gif);
	padding-bottom:0;
	}</code></pre>
</blockquote>
<div class="clear"></div>
<p><a href="http://www.mesmerlab.com/demo/ul-tree.html" target="_blank">View the demo</a>.</p>
<h3>Final Thoughts</h3>
<p>Try out some of these ideas to spruce up my simple design.</p>
<ul>
<li>Arrow on the right side of the images</li>
<li>Curve the vertical line into the horizontal line</li>
<li>Use an animated gif to make your list more dynamic</li>
<li>Use a single sprite instead of two images.</li>
</ul>
<p>If you&#8217;re going to use alpha transparency in your image, you&#8217;ll want to save as a PNG-24. Doing this will skew your colors slightly in Internet Explorer. This is because of the gamma correction saved in the image. Every browser except IE disregards the gamma value. I&#8217;ll show you how to correct this in an upcoming article.</p>
<p>Let me know how you liked this tutorial. Any comments and suggestions are welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mesmerlab.com/create-a-graphic-menu-tree-with-css/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Add Custom Fonts to your WordPress Site</title>
		<link>http://www.mesmerlab.com/add-custom-fonts-to-your-wordpress-site/</link>
		<comments>http://www.mesmerlab.com/add-custom-fonts-to-your-wordpress-site/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 23:57:31 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.mesmerlab.com/?p=247</guid>
		<description><![CDATA[In the old days if you wanted to have a non-standard font on your site that was viewable by your visitors, you would need to provide a download link so they could add the custom font onto their computer. This was a little clunky, but it allowed a better user experience and would help mesh [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.mesmerlab.com/wp-content/uploads/2009/01/main-image.png" alt="main-image" title="main-image" width="282" height="182" class="alignright size-full wp-image-262" style="float:right;margin:0 0 20px 20px;border:1px solid #333;padding:10px;" />In the old days if you wanted to have a non-standard font on your site that was viewable by your visitors, you would need to provide a download link so they could add the custom font onto their computer. This was a little clunky, but it allowed a better user experience and would help mesh your design together. One can only handle so much Verdana and Arial each day.</p>
<p>Fast-forward about 10 years. There have been great strides in font technology on the web.<span id="more-247"></span> The first well-known solution was <a href="http://en.wikipedia.org/wiki/Scalable_Inman_Flash_Replacement">sIFR</a>, a Flash-based solution that converted your text into a .swf file which is viewable by most modern browsers. Adding a custom font became a little easier. However, the coding required made these sites a little sluggish and needed javascript and Flash to be enabled.</p>
<p>Of course most of the good stuff on the web these days requires javascript, but that still meant sIFR needed Flash. An alternative that uses pure code and no proprietary filetypes came along, called <a href="http://facelift.mawhorter.net/">FLIR</a>. Now this solution lets your site break free of the Flash requirement. It does however require PHP to be installed on your web host. This isn&#8217;t a huge obstacle since most commercial host companies offer PHP scripting.</p>
<p>Now to the good stuff concerning WordPress users. The guys over at HostScope.com have developed a <a href="http://www.hostscope.com/wordpress-plugins/ttftitles-wordpress-plugin/">plugin that achieves FLIR goodness</a> in an easy admin interface. I use this plugin to carry over the custom font in my logo to the sidebar headings on the right.</p>
<h3>Step 1: Installation</h3>
<p><a href="http://wordpress.org/extend/plugins/ttftitles/">Download</a>, install and activate TTFTitles.</p>
<h3>Step 2: Uploading Fonts</h3>
<p>Navigate to the Appearance section of your WordPress admin. You&#8217;ll find the TTF Titles section under this heading. Go to the Fonts link and upload your custom font. </p>
<h3>Step 3: Creating Styles</h3>
<p><img src="http://www.mesmerlab.com/wp-content/uploads/2009/01/styles-300x195.png" alt="styles" title="styles" width="300" height="195" class="alignright size-medium wp-image-264" style="float:right;margin:0 0 20px 20px;border:1px solid #333;padding:10px;" />Navigate to the Styles section of the TTF Titles admin. You can adjust how your custom font will be viewed from here. I have a specific style for my sidebar and one for the &#8216;Leave a Comment&#8217; element that is in the content section. I believe the plugin uses PNG-8 because you must designate a background color. The green background of the sidebar style did not look appealing on the white of the content section. I&#8217;d love for the author to update the plugin to use PNG-24, allowing for a style to be used anywhere.</p>
<h3>Step 4: The Code</h3>
<p>Applying the styles to your site is relatively easy, even for those who don&#8217;t know PHP. For instance, in the second sidebar on the right, the title code used to be&#8230;</p>
<blockquote><pre><code>&lt;h3&gt;Recent Articles&lt;/h3&gt;</code></pre>
</blockquote>
<p>To render the title with my font I simply wrap the text with a little PHP like this&#8230;</p>
<blockquote><pre><code>&lt;h3&gt;<span style="color:red;"><strong>&lt;?php the_ttftext("</strong></span>Recent Articles<span style="color:red;"><strong>"); ?&gt;</strong></span>&lt;/h3&gt;</code></pre>
</blockquote>
<p>Use the following code when adding the functionality to a WordPress variable.</p>
<blockquote><pre><code>&lt;?php get_bloginfo('name'); ?&gt;
... turns into ...
 &lt;?php <span style="color:red;"><strong>the_ttftext(</strong></span>get_bloginfo('name')<span style="color:red;"><strong>)</strong></span>; ?&gt;</code></pre>
</blockquote>
<p>The previous implementations assume you&#8217;re using the style set as default. To use a different style like I have for my comment section you would code as follows.</p>
<blockquote><pre><code>&lt;?php the_ttftext("Leave a Comment"<span style="color:red;"><strong>, true, "Opus on white", ""</strong></span>); ?&gt;</code></pre>
</blockquote>
<p>This pulls in the name of your custom style in the third parameter. The last parameter is for alterations to the style, similar to inline styles in CSS. I can designate a different color, font size, or any other available attributes.</p>
<p>So now you can have more control over the user experience by adding custom fonts. Let me know how you&#8217;ve implemented this on your site.<!-- pingbacker_start --><br />
<h4>Related Blogs</h4>
<ul class='pc_pingback'></ul>
<p><!-- pingbacker_end --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mesmerlab.com/add-custom-fonts-to-your-wordpress-site/feed/</wfw:commentRss>
		<slash:comments>50</slash:comments>
		</item>
	</channel>
</rss>
