<?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>Tutorialzine &#187; Specials</title>
	<atom:link href="http://tutorialzine.com/category/bloggybits/feed/" rel="self" type="application/rss+xml" />
	<link>http://tutorialzine.com</link>
	<description>PHP MySQL jQuery CSS Tutorials, Resources and Freebies</description>
	<lastBuildDate>Wed, 28 Jul 2010 17:33:42 +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>Explaining jQuery sortable</title>
		<link>http://tutorialzine.com/2009/08/explaining-jquery-sortables/</link>
		<comments>http://tutorialzine.com/2009/08/explaining-jquery-sortables/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 23:31:07 +0000</pubDate>
		<dc:creator>Martin Angelov</dc:creator>
				<category><![CDATA[Specials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.stepinto.net/?p=166</guid>
		<description><![CDATA[We use jQuery, CSS and XHTML to build a horizontal sortable list which will let users reorder their selected services in the previous step.]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>This time we are working on presenting the users of <a href="http://bloggybits.com" target="_blank">BloggyBits.com</a> with an easy way to change the order of the services that are shown in the widget. The most natural way of doing this is by dragging and dropping using jQuery&#8217;s sortable method &#8211; an easy way to convert a regular &lt;ul&gt; into a sortable list.</p>
<div id="attachment_167" class="wp-caption alignnone" style="width: 610px"><img class="size-full wp-image-167" title="The sortable list" src="http://tutorialzine.com/wp-content/uploads/2009/08/i14.jpg" alt="The sortable list" width="600" height="230" /><p class="wp-caption-text">The sortable list</p></div>
<h3>Step 1 &#8211; the XHTML</h3>
<p>In our <a href="/2009/07/organizing-the-site-structure/#files" target="_blank">index.php</a> file, we have the following code:</p>
<pre class="brush:html">&lt;ul id="sortable"&gt;
&lt;li id="liDef"&gt;&lt;div class="smallTab"&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;</pre>
<p>As we mentioned before, the whole sortable list is basically a unordered list <strong>UL</strong>. All the icons that you can drag around  in the example on <a href="http://bloggybits.com" target="_blank">BloggyBits.com</a> are <strong>LI</strong> elements inside it.</p>
<p>Inside the UL we have inserted a empty LI that is removed as soon as the document loads. This is a hack, that we use to properly size the UL before we create the sortable list with jQuery later.</p>
<h3>Step 2 &#8211; jQuery</h3>
<p>But how do we convert a regular UL into a jQuery sortable? After we include the jQuery library in the page with <strong>&lt;script src=&#8221;"&gt;</strong> we can use the following lines of code, which are positioned inside the <strong>$(document).ready{}</strong> function so they are executed when the page loads:</p>
<pre class="brush:js">$("#sortable").sortable({
	handle : '.handle',
	axis:'x',
	containment: 'document'
});

$('#liDef').remove();</pre>
<p>I believe I have to say a few words about this source. We convert the DIV with <strong>id=&#8221;sortable&#8221;</strong> into a sortable list. The <strong>&#8216;handle&#8217;</strong> property means that you can reorder the services by dragging them for the center image, that is unique to every service and has a CSS class <strong>&#8216;handle&#8217;</strong>.</p>
<p>You can drag the items only horizontally, that is why we specify the <strong>axis</strong> property. And finally the <strong>containment</strong> property limits the drag of the elements to the edges of the browser window.</p>
<p>The bottommost line hides the default LI that we mentioned earlier.</p>
<p>At this point you may wonder how do we add new elements to the list? Remember last time, when we created the <a href="/2009/08/generating-configuration-list-with-php/" target="_blank">configuration list</a>? I showed you a function that handled the click event of the checkboxes:</p>
<pre class="brush:js">function checkIt(id)
{
	var el=$('#check'+id).attr('checked');

	if(!el)
	{
		$('#li'+id).remove();
	}
	else
	{
		$("#sortable").append('&lt;li id="li'+id+'"&gt;&lt;div class="smallTab"&gt;&lt;img src="/images/iconsBig/'+(id+1)+'.gif" class="handle" /&gt;&lt;/div&gt;&lt;/li&gt;');
		$("#sortable").sortable('refresh');
	}

	$('#title'+id).attr('disabled',!el);
	$('#user'+id).attr('disabled',!el);
}</pre>
<p>If the checkbox is checked we append a new element in the sortable list with jQuery&#8217;s <strong>append()</strong> and later <strong>refresh</strong> the sortable so that everything works nicely (lines 11 &amp; 12).</p>
<p>If it is not checked, that means we have unchecked it and the element has to be removed (line 7).</p>
<p>Lets take a look at what we are actually appending on line 11.</p>
<pre class="brush:html">&lt;li id="li'+id+'"&gt;
&lt;div class="smallTab"&gt;
&lt;img src="/images/iconsBig/'+(id+1)+'.gif" class="handle" /&gt;
&lt;/div&gt;
&lt;/li&gt;</pre>
<p>This is a single draggable element in our sortable. It is a LI element that has an id which is assigned by the parameter of the function <strong>checkIt</strong> (which in turn is the unique id of the service, as assigned in the PHP configuration array we created in the <a href="/2009/08/generating-configuration-list-with-php/" target="_blank">last tutoral</a>).</p>
<p>Inside this LI we have a div with a class name <strong>smallTab</strong> and the image we use as a handle for the mouse dragging. The <strong>handle</strong> class here only serves the purpose of being selected by the <strong>handler</strong> property of the sortable() method in jQuery and does not define any CSS styles.</p>
<h3>Step 3 &#8211; the CSS</h3>
<p>Here are the CSS classes, taken from main.css:</p>
<pre class="brush:css">#sortable{
	margin:10px 0px 20px 0px;
	padding:0px;
	width:100%;
	height:80px;
}

#sortable li{
	float:left;
	list-style:none;
}

.smallTab{
	width:64px;
	height:64px;
	padding:5px;
	margin:5px 10px 5px 0px;
	background-color:#2b2b2b;
	border:1px solid #363636;
}</pre>
<p>These style the sortable and its LI elemenets. The important thing to note here is that the Li elements are <strong>floated left</strong> this is so they are positioned next to each other which with conjunction with the <strong>axis</strong> property of the jQuery <strong>sortable()</strong> method above creates a horizontal sortable list.</p>
<h3>Conclusion</h3>
<p>Sortable lists are a flexible way to let your visitors customize a webapp and can be used in numerous ways. They are a design component that should be in your developer&#8217;s toolkit.</p>
<p>Next time we are serializing our sortable list and  sending it over to the PHP back-end using ajax.</p>
<p>If you liked this tutorial you can subscribe to our <a href="http://feeds.feedburner.com/stepinto" target="_blank">RSS feed</a> or <a href="https://twitter.com/SiTutorials" target="_blank">follow us on twitter</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tutorialzine.com/2009/08/explaining-jquery-sortables/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Generating a configuration list with PHP</title>
		<link>http://tutorialzine.com/2009/08/generating-configuration-list-with-php/</link>
		<comments>http://tutorialzine.com/2009/08/generating-configuration-list-with-php/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 17:15:47 +0000</pubDate>
		<dc:creator>Martin Angelov</dc:creator>
				<category><![CDATA[Specials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.stepinto.net/?p=145</guid>
		<description><![CDATA[In this first tutorial about PHP, we will generate the configuration list - the first step of generating a widget. We will build upon our knowledge about PHP, CSS, XHTML and jQuery.]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<div id="attachment_147" class="wp-caption alignnone" style="width: 610px"><img class="size-full wp-image-147" title="The configuration list" src="http://tutorialzine.com/wp-content/uploads/2009/08/i12.jpg" alt="The configuration list" width="600" height="300" /><p class="wp-caption-text">The configuration list</p></div>
<p>This time we are generating the configuration list on the site with PHP, which is used in the <a href="http://bloggybits.com" target="_blank">BloggyBits</a> site. This is the first tutorial about PHP of the series. We are also building upon the jQuery foundations we laid last time, when we created a <a href="/2009/07/creating-the-navigation-menu-with-css-jquery/" target="_blank">jQuery &amp; CSS navigation menu</a>.</p>
<h3>The idea</h3>
<p>The configuration list is the first step of a three step process in which the widget is generated. Here are all the supported services, which you can include in the widget by checking them, and filling in some data. In the case of the custom RSS feed, it is the tab title, the rss address and address of the site, that the feed belongs to. In all the other cases we have just a tab title and your username on the respective social site.</p>
<h3>The implementation</h3>
<p>We will need the PHP back-end to generate all the necessary XHTML code, which will trigger the jQuery functionality we will build on the site.</p>
<h3>The PHP back-end</h3>
<p>Lets take a look at the PHP code we have used in our <a href="/2009/07/organizing-the-site-structure/#files" target="_blank"> index.php</a> file.</p>
<pre class="brush:php">$serv = array();
$serv[]=array('name'=&gt;'twitter','title'=&gt;'Tweets');
$serv[]=array('name'=&gt;'digg','title'=&gt;'Diggs');
$serv[]=array('name'=&gt;'flickr','title'=&gt;'Flickr');
$serv[]=array('name'=&gt;'stumbleupon','title'=&gt;'Stumbles');
$serv[]=array('name'=&gt;'delicious','title'=&gt;'Delicious');
$serv[]=array('name'=&gt;'','title'=&gt;'Custom');</pre>
<p>This is our list represented as a multidimensional array. That is, we have an array composed of other arrays. This is an extremely easy to implement and light solution to the problem of storing all the necessary data. We can easily edit the list or add new services. We just have to follow the same structure for every new service that we add. That would be: &#8216;<strong>title</strong>&#8216; (used to fill the default value of the title text field) and &#8216;<strong>name</strong>&#8216;, used in the label of the text field.<br />
Note that our custom service doesn&#8217;t have a name &#8211; this way we can differentiate it from the other services, as you will see later on.</p>
<p>Another important aspect of this implementation is to remember that every service is assigned an unique key in the <strong>$serv</strong> array automatically &#8211; <strong>$serv[]</strong>=&#8230; ads a new element with a unique key starting from 0.</p>
<p>Now lets see how the list is generated.</p>
<pre class="brush:php">foreach($serv as $k=&gt;$v)
{
	if($v['name'])
	{
		$usernameSm = $v['name'].' username';
	}
	else
	{
		$usernameSm = 'URL of the custom feed (rss only)';
	}

?&gt;

&lt;div class="tabs" align="left"&gt;
&lt;div class="tabsCheck"&gt;&lt;input type="checkbox" title="Use this!" id="check&lt;?=$k?&gt;" onclick="checkIt(&lt;?=$k?&gt;)" checked="false"  /&gt;&lt;/div&gt;
&lt;div class="tabsIcon"&gt;&lt;img src="/images/iconsBig/&lt;?=$k+1?&gt;.gif" /&gt;&lt;/div&gt;
&lt;div class="tabData"&gt;
&lt;small&gt;tab title&lt;/small&gt;
&lt;input type="text" name="title&lt;?=$k?&gt;" value="&lt;?=$v['title']?&gt;" id="title&lt;?=$k?&gt;" disabled /&gt;

&lt;small&gt;&lt;?=$usernameSm?&gt;&lt;/small&gt;

&lt;input type="text" name="user&lt;?=$k?&gt;" value="" id="user&lt;?=$k?&gt;" &lt;?=!$v['name']?'onfocus="$(\'#customURL\').show()"':''?&gt; disabled /&gt;

&lt;?

	if(!$v['name'])
	{
	?&gt;

		&lt;span id="customURL" style="display:none" title="This URL will show up in the widget as a link above the entries of the feed"&gt;
		&lt;small&gt;URL of the site itself&lt;/small&gt;

		&lt;input type="text" name="cUF" value="" id="cUF" /&gt;

		&lt;/span&gt;

	&lt;?
	}

?&gt;

&lt;/div&gt;
&lt;/div&gt;

&lt;?
}</pre>
<p>Here we use a different approach. We rapidly go in and out of PHP when creating the looks of the site. This approach is appropriate for projects like this one, but is not recommended for bigger projects. If your site has a lot more pages you&#8217;d probably split the design into separate template files. However for the needs of BloggyBits such a strategy would be an overkill.</p>
<p>As a web developer you always have to choose a strategy that brings you the best results with the work you put in (you will notice that I am not using object oriented programming as well).</p>
<p>Now lets get back to the code. We start with a <strong>foreach</strong> statement which assigns the unique keys in <strong>$k</strong> and the arrays with each service in <strong>$v</strong>. In the first 10 lines of code we are forming the <strong>$usernameSm</strong>, which is used later. It takes the form of &#8216;twitter username&#8217; if we have a name of the service and &#8216;URL of the custom feed (rss only)&#8217; in the case of it being our custom RSS.</p>
<p>In line 15 we assign <strong>check&lt;?=$k?&gt;</strong> as the id of the checkbox, where $k is a unique key. On line 16 we use an image <strong>/images/iconsBig/&lt;?=$k+1?&gt;.gif</strong> which is an icon of each service (the images start with 1.gif, and so the services keys need to be incremented with 1).</p>
<p>It is basically the same down to line 23 where we have <strong>&lt;?=!$v['name']? &#8216;onfocus=&#8221;$(\&#8217;#customURL\&#8217;).show()&#8221; &#8216; : &#8221; ?&gt;</strong>. This is the triple operand that sets the onfocus event in the case that the current service is the custom one. And what this line does is that when we click on the url of the feed in the custom RSS section, a text box appears beneath  it.</p>
<p>The appearing box itself is created on the following lines.</p>
<h3>The CSS</h3>
<pre class="brush:css">.tabs{
	float:left;
	width:300px;
	background-color:#2b2b2b;
	border:1px solid #363636;
	padding:10px;
	margin:10px 20px 10px 0px;
}

.tabsCheck{
	float:left;
	width:20px;
}

.tabsIcon{
	float:left;
	width:64px;
}

.tabData{
	float:left;
	margin-left:15px;
}

.tabData input, .emailField{
	margin:2px 0px 4px 0px;
	background-color:#333333;
	border:1px solid #666666;
	color:#CCCCCC;
	width:150px;
}</pre>
<p>These are the CSS styles from <a href="/2009/07/organizing-the-site-structure/#files" target="_blank">main.css</a>, that we use in our list. You can see from the PHP/XHTML source code pasted before that every service is wrapped in a DIV with a class name of <strong>tabs</strong>. It is floated left and this way two columns of equal width and height emerge with all the supported services.</p>
<h3>The jQuery source</h3>
<p>Here is the jquery code, taken from <a href="/2009/07/organizing-the-site-structure/#files" target="_blank">main.js</a></p>
<pre class="brush:js">function checkIt(id)
{
	var el=$('#check'+id).attr('checked');

	if(!el)
	{
		$('#li'+id).remove();
	}
	else
	{
		$("#sortable").append('&lt;li id="li'+id+'"&gt;&lt;div class="smallTab"&gt;&lt;img src="/images/iconsBig/'+(id+1)+'.gif" class="handle" /&gt;&lt;/div&gt;&lt;/li&gt;');
		$("#sortable").sortable('refresh');
	}

	$('#title'+id).attr('disabled',!el);
	$('#user'+id).attr('disabled',!el);

}</pre>
<p>This is the function that gets called when you check the checkbox next to one of the services. What this does is get the attribute of the checkbox (either we have checked or unchecked it) and store it in el, and after that in a if construct where we either create or remove a new sortable list object in the sortable container (we&#8217;ll talk more about this next time).</p>
<p>Another peace of javascript code is the one that is executed after the document has loaded.</p>
<pre class="brush:js">$(document).ready(function(){
	var i=0;

	while(document.getElementById('check'+i))
	{
		$('#check'+i).attr('checked',false);

		i++;
	}
});</pre>
<p>What this does is it loops through the checkboxes we use for the services (every checkbox has an id that is formed by <strong>check</strong> and the id of the service, starting from 0).</p>
<p>We could do that alternatively with a jQuery selector. Something like this:</p>
<pre class="brush:js">$(document).ready(function(){
	$('.tabs input[type=checkbox]').attr('checked',false);
});</pre>
<h3>Conclusion</h3>
<p>Today we made the configuration list and opened the door for the next tutorial in which we will use <a href="/2009/08/explaining-jquery-sortables/" target="_blank">jQuery sortable to create a sortable list</a>, which will determine the order of the tabs when they are shown in the widget.</p>
]]></content:encoded>
			<wfw:commentRss>http://tutorialzine.com/2009/08/generating-configuration-list-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a navigation menu with CSS &amp; jQuery</title>
		<link>http://tutorialzine.com/2009/07/creating-the-navigation-menu-with-css-jquery/</link>
		<comments>http://tutorialzine.com/2009/07/creating-the-navigation-menu-with-css-jquery/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 21:42:21 +0000</pubDate>
		<dc:creator>Martin Angelov</dc:creator>
				<category><![CDATA[Specials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.stepinto.net/?p=120</guid>
		<description><![CDATA[We create the CSS navigation menu, using jQuery and the scrollTo plugin, to achieve a smooth scroll effect on the page.]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>As you remember, we already created the <a href="/2009/07/designing-our-site-widget-part-2/" target="_blank">navigation graphics in Photoshop</a> and exported them using the slice tool. Now we use them to create our navigation menu, at the top of the page. You can view a working example at <a href="http://bloggybits.com" target="_blank">BloggyBits.com</a>.</p>
<div id="attachment_123" class="wp-caption alignnone" style="width: 610px"><img class="size-full wp-image-123" title="The nagivation bar" src="http://tutorialzine.com/wp-content/uploads/2009/07/i111.jpg" alt="The navigation bar" width="600" height="150" /><p class="wp-caption-text">The navigation bar</p></div>
<h3>Including the files</h3>
<p>We are using Adobe Dreamweaver as our development  environment. We are also using the <a href="http://jquery.com/" target="_blank">jQuery framework</a> and the <a href="http://flesler.blogspot.com/2007/10/jqueryscrollto.html" target="_blank">scrollTo plugin</a>, which make possible for a smooth page scrolling effect.</p>
<p>The first thing, we need to do is include these into our site&#8217;s index.php. As you may remember, we used this code in the head section:</p>
<pre class="brush:html">&lt;script type="text/javascript" src="/jquery.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"
src="/jquery-ui/jquery.scrollTo-min.js"&gt;&lt;/script&gt;</pre>
<p>We firstly include the jQuery library itself, and later the scrollTo plug-in. Those files are compressed, so they load as fast as possible.</p>
<h3>The XHTML</h3>
<p>Now we have to create the XHTML structure  of the menu. We are using a regular anchor elements, positioned inside a DIV with id=&#8221;<strong>topBar</strong>&#8220;. We are using this id later to add CSS styles to the links.</p>
<pre class="brush:html">&lt;div id="topBar"&gt;
&lt;a href="#choose" class="choose replaceLink"&gt;choose&lt;/a&gt;
&lt;a href="#configure" class="configure replaceLink"&gt;configure&lt;/a&gt;
&lt;a href="#generate" class="generate replaceLink"&gt;generate&lt;/a&gt;

&lt;!-- AddThis Button BEGIN --&gt;
&lt;a href="http://www.addthis.com/bookmark.php?v=250&amp;pub=xa-4a4a1d364dccfa82" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()" class="share"&gt;share&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js?pub=xa-4a4a1d364dccfa82"&gt;&lt;/script&gt;
&lt;!-- AddThis Button END --&gt;

&lt;/div&gt;</pre>
<p>Below our three links, there is the AddThis button, but with changed default image, as you can see below.</p>
<h3>The CSS</h3>
<p>The anchor elements share the replaceLink class, which is only used to be select with jQuery, which I will demonstrate later. They also each have a respective class, that contains unique style properties, as shown below.</p>
<pre class="brush:css">.choose{
	width:100px;
	height:22px;
	background-image:url(/images/steps/1.gif);
}

.configure{
	width:114px;
	height:22px;
	background-image:url(/images/steps/2.gif);
}

.generate{
	width:110px;
	height:22px;
	background-image:url(/images/steps/3.gif);
}

.share{
	margin-left:288px;
	width:155px;
	height:22px;
	background-image:url(/images/steps/share.gif);
}

#topBar{
	margin:25px 0px 30px 0px;
	width:100%;
	height:22px;
	background-color:#2b2b2b;
	border:1px solid #363636;
	overflow:hidden;
}

#topBar a{
	float:left;
	display:block;
	text-indent:-400px;
	overflow:hidden;
	background-position:top;
}

#topBar a:hover{
	background-position:bottom;
}</pre>
<p>As you see, every one of the unique CSS classes has width and height property, as well the images, we created before, as backgrounds. At the bottom are the <strong>#topBar</strong> styles. This is where the magic happens. <strong>#topBar a</strong> (line 35) is a CSS selector, that is valid for all the hyperlinks in the DIV with an ID of topBar. That means, that the rules it specifies, affect those same hyperlinks, which we use as navigation.</p>
<p>On line 36 you see that the links get floated to the left and we use the same trick as <a href="/2009/07/creating-our-html-and-css-website/" target="_blank">we used in the heading last time</a> &#8211; using text-indent with a negative value we hide the text and the only thing that is left is the background. That way you have a regular hyperlink for the search engines, and a graphical button for the users with browsers that support CSS.</p>
<p>There is also one important reason to use hyperlinks with text indented to the side &#8211; hyperlinks (anchors) are the only elements that have a hover CSS property that is supported on all used browsers today. This is illustrated on line 43.</p>
<p>As you remember, we created the images for the buttons with their normal state at the top part of the image, and the hover state right below.</p>
<p>So suddenly lines 40 and 44 make sense &#8211; the anchor elements in their normal state show the top part of the image (thanks to the background-position property) and once you move you mouse above them, they show the bottom part.</p>
<h3>The jQuery magic</h3>
<p>But what is looks without functionality? Currently, the links display the same behavior as any other link. We need to make the transition stylish. Here come all the possibilities provided by the jQuery javascript library and it&#8217;s handy plug-ins.</p>
<p>We already included the needed files, but how do we create that smooth scroll effect you can observe on the site?</p>
<p>The scrollTo plugin gives us the ability to call a special javascript method, that scrolls the page we are viewing.</p>
<pre class="brush:js">$(document).ready(function() {
$('#topBar .replaceLink').attr('onclick',
'$.scrollTo(this.hash,800);return false;');
}</pre>
<p>This might look slightly from outer space so I am going to explain it. Line 1 is binding the function we provide, with the onload event of the document. In other words it gets executed only after the page is fully loaded.</p>
<p>Now lets look inside the anonymous function &#8211; <strong>function() {&#8230;.}</strong>. The dollar sign acts as a special function, that calls jQuery methods to extend the specified elements in the brackets. In this case, we have specified a CSS selector &#8211; <strong>&#8216;#topBar .replaceLink&#8217;</strong>,  which practically means &#8220;Select all elements within the one with ID of <strong>topBar</strong> which have been assigned a class name of <strong>replaceLink</strong>&#8220;. Those are actually our three navigation buttons.</p>
<p>For each of those buttons the method &#8216;attr&#8217; is executed, which sets the onclick property to &#8216;<strong>$.scrollTo(this.hash,800); return false;</strong>&#8216;. What this does is scrolls the page after we click the link and later returns false, in order to prevent the default action which would ruin the smooth scroll effect.</p>
<p>An alternative to this would be to bind an Event listener to the click event (should also be put inside the <strong>$(document).ready</strong>):</p>
<pre class="brush:js">$('#topBar .replaceLink').click(function(event){
    event.preventDefault();
    $.scrollTo(this.hash,800);
}</pre>
<p>This second version uses event.preventDefault(); to stop the link from redirecting the page, once clicked.</p>
<p>Now lets say a few words about the scrollTo function. It takes two parameters, the first is where to scroll the page to, and the second is the duration of the scroll in milliseconds.</p>
<p>In the above examples we use <strong>$.scrollTo(this.hash,800);</strong> which takes the hash part of the hyperlink we are currently working with (this.hash corresponds to &#8216;#choose&#8217;,'#configure&#8217; or &#8216;#generate&#8217; respectively) and feeding it to the function as a parameter.</p>
<h3>Conclusion</h3>
<p>Today we built upon the techniques we learned in the previous tutorials and created a CSS and jQuery based smooth scrolling navigation menu. I explained the basics of the jQuery selectors and some of the methods.</p>
<p>Next time we write our first PHP code and use jQuery to <a href="/2009/08/generating-configuration-list-with-php/" target="_blank">create the configuration section</a> that allows you to select services on the BloggyBits website.</p>
]]></content:encoded>
			<wfw:commentRss>http://tutorialzine.com/2009/07/creating-the-navigation-menu-with-css-jquery/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Creating our HTML &amp; CSS website</title>
		<link>http://tutorialzine.com/2009/07/creating-our-html-css-website/</link>
		<comments>http://tutorialzine.com/2009/07/creating-our-html-css-website/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 21:14:59 +0000</pubDate>
		<dc:creator>Martin Angelov</dc:creator>
				<category><![CDATA[Specials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.stepinto.net/?p=102</guid>
		<description><![CDATA[We explain the HTML and CSS that stands behind BloggyBits.com and create the backbone of the site - the main layout including the necessary CSS files.]]></description>
			<content:encoded><![CDATA[<h3>What are we doing today?</h3>
<p>We will create the HTML backbone behind <a href="http://bloggybits.com/" target="_blank">BloggyBits.com</a>, and style it with CSS. I am also going to demonstrate some interesting CSS tricks, that will be of a good use for any developer.</p>
<h3>The layout</h3>
<p>As you can see from the site itself, the layout is clean and simple, and you might guess that so is the code. We start with the &lt;HEAD&gt; section of the page:</p>
<pre class="brush:html">&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;BloggyBits - your social widget&lt;/title&gt;

&lt;link rel="stylesheet" type="text/css" href="/main.css"&gt;
&lt;link rel="stylesheet" type="text/css" href="/jquery-ui/css/vader/jquery-ui-1.7.2.custom.css"&gt;

&lt;script type="text/javascript" src="/jquery.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/jquery-ui/1.7.2.custom.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/jquery-ui/jquery.scrollTo-min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/pp/jQuery.pagePeel.js"&gt;&lt;/script&gt;
&lt;script src="/swfobject_2_2.js" type="text/javascript"&gt;&lt;/script&gt;

&lt;script src="/main.js" type="text/javascript"&gt;&lt;/script&gt;

&lt;/head&gt;</pre>
<p>In the head section we include the CSS and JS files. On line 5 we include our main CSS file, which we will create in a minute. Later we include the jQuery UI styles, the jQuery javascript library &amp; plugins, and our self-prepared js file &#8211; main.js, which we will cover in the next tutorials.</p>
<p>Now let&#8217;s take a look at the layout itself (the BODY section).</p>
<pre class="brush:html">&lt;div class="mainContent"&gt; &lt;!--main container--&gt;

&lt;div id="pageTitle"&gt; &lt;!--page title--&gt;
&lt;h1&gt;BloggyBits&lt;/h1&gt;
&lt;/div&gt;

&lt;div id="topBar"&gt; &lt;!--navigation bar--&gt;&lt;/div&gt;

&lt;div class="topContainer"&gt; &lt;!--top container--&gt;
&lt;div id="mainDescr"&gt; &lt;!--main information block about the widget--&gt;&lt;/div&gt;
&lt;div id="slidesArea"&gt; &lt;!--screenshot of the wigdet with text--&gt;&lt;/div&gt;
&lt;!--closing the top container--&gt;&lt;/div&gt;

&lt;div id="chooseContainer"&gt; &lt;!--block for choosing services--&gt;&lt;/div&gt;

&lt;div&gt; &lt;!--block for rearranging the tabs--&gt;&lt;/div&gt;

&lt;div class="contentBlock"&gt; &lt;!--generation of the widget--&gt;&lt;/div&gt;

&lt;div class="contentBlock marg"&gt; &lt;!--feedback form--&gt;&lt;/div&gt;

&lt;!--closing the main container--&gt;&lt;/div&gt;</pre>
<p>This is the backbone of the site. It is stripped of all unnecessary content so that the example is better illustrated. To make it a little bit easier, here is how it renders in the browser:</p>
<div id="attachment_109" class="wp-caption alignnone" style="width: 610px"><img class="size-full wp-image-109" title="The layout" src="http://tutorialzine.com/wp-content/uploads/2009/07/i101.jpg" alt="The layout" width="600" height="460" /><p class="wp-caption-text">The layout</p></div>
<p>So how do we convert the previous DIVs into a layout like the one above? With the help of the following CSS methods.</p>
<h3>Centering a div with CSS</h3>
<p>As you can see from the code posted above, I have set IDs to some of the DIVs, and the others have class names assigned (with class=&#8221;"). This allows us to specify specific rules for a single page element by id, or to a set of elements that share the same class.</p>
<p>The first rules we should take a look at are those that center the main container on the screen.</p>
<pre class="brush:css">h1, h2, h3, h4, form, blockquote, small, input, body, p, label {
 margin:0px;
 padding:0px;
}/*we reset some of the page elements*/

body {
 background:#282828;
 font-family:Tahoma,Arial,Verdana;
 color:#fcfcfc;
 font-size:12px;
}

.mainContent{
 width:767px;
 margin:0px auto;
 padding-top:20px;
}</pre>
<p>On <strong>line 1</strong> you can see that we specify a series of elements by tag name and we set their margin and padding properties to <strong>0px</strong>. Browsers have different values for these elements, so we reset them. This way our site will look the same at every browser.<br />
There are even separate CSS reset files available on the net, that do this for you and reset absolute every element. However for the purpose of this project that seems like an overkill.</p>
<p>Later we style the body and after that we define a class <strong>mainContent</strong>. This is the class name assigned to the main DIV container. We set up its width, margin and padding.</p>
<p>Line 14 is where the magic happens. We set the element&#8217;s margin 0px for its top and auto for its right, bottom and left parts. It makes the DIV centered on the page, with its upper end touching the top of the inner side of the browser window.</p>
<p>It is important to note, that you need to have specified a <strong>width</strong> in order for the above method to work.</p>
<p>Also a quick tip for you &#8211; always name your styles, so you can, just by looking at them, easily remember what they were about.</p>
<h3>Putting an image in H1</h3>
<p>Now let&#8217;s take a look at another interesting trick in CSS. Remember the following code from the the page layout?</p>
<pre class="brush:html">&lt;div class="mainContent"&gt; &lt;!--main container--&gt;
&lt;div id="pageTitle"&gt; &lt;!--page title--&gt;
&lt;h1&gt;BloggyBits&lt;/h1&gt;
&lt;/div&gt;
................</pre>
<p>What this does is create a text H1 heading with text inside. But you don&#8217;t see such a thing in the site &#8211; there you see an image instead of the text. So why and how is this done?</p>
<p>It was done because as you can remember, we already made a <a href="/2009/07/designing-our-site-widget-part-2/">logo for our site</a>. But if we put a regular &lt;img&gt; in there, it won&#8217;t be search engine friendly &#8211; robots don&#8217;t know what is written in images. That is why a H1 heading is used &#8211; for search bots it has the biggest weight and it is very important for your page rankings. But for human visitors we want a image displayed instead of the pain text.</p>
<p>To answer the second part of the question you need to see some more of our CSS.</p>
<pre class="brush:css">h1{
	background: url(/images/logo.gif) no-repeat;
	width:200px;
	height:41px;
	text-indent:-200px;
	overflow:hidden;
}</pre>
<p>We set the logo as a background and set the width and height. With the text-indent property, the text is positioned 200px to the left and is hidden with the overflow property.<br />
What we are doing is basically placing the text to the left, so that it  disappears while the background image is clearly visible. For search engines it is a regular H1, and for visitors with browsers that support CSS it is an eye-candy graphic.</p>
<h3>Creating the CSS file</h3>
<p>We create a new .css document in Dreamweaver with all the above styles and save it as main.css in the root directory. This way we have a separate file, which improves the speed of the site and aids for clean and understandable code &#8211; something that pays on the long run.</p>
<p>In the following tutorials we are going to build upon this and gradually style the whole site.</p>
<h3>To sum it up</h3>
<p>We followed through the first stages of development behind the BloggyBits homepage and created the main layout of the site. Next time we will improve upon this and <a href="/2009/07/creating-the-navigation-menu-with-css-jquery/" target="_blank">create a CSS navigation menu</a> with the help of the jQuery scrollTo plug in for smooth page scrolling.</p>
]]></content:encoded>
			<wfw:commentRss>http://tutorialzine.com/2009/07/creating-our-html-css-website/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Organizing the site structure</title>
		<link>http://tutorialzine.com/2009/07/organizing-the-site-structure/</link>
		<comments>http://tutorialzine.com/2009/07/organizing-the-site-structure/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 22:56:57 +0000</pubDate>
		<dc:creator>Martin Angelov</dc:creator>
				<category><![CDATA[Specials]]></category>

		<guid isPermaLink="false">http://www.stepinto.net/?p=92</guid>
		<description><![CDATA[Now that we've finished our design, it is time we convert it to a real site. The first step in that direction is to organize our site structure. A task, easily achievable with Adobe Dreamweaver.]]></description>
			<content:encoded><![CDATA[<h3>What does it mean?</h3>
<p>That means to have your folder structure, configuration files and PHP file structure organized, so that your development doesn&#8217;t run into unwanted hold-backs.</p>
<h3>The tools</h3>
<p>In the development of <a href="http://bloggybits.com/" target="_blank">BloggyBits</a> I used primarily  Adobe Dreamweaver. It is not only a great tool for coding, but you can successfully manage your whole development process &#8211; from programming to uploading via FTP. So let&#8217;s take a look.</p>
<div id="attachment_93" class="wp-caption alignnone" style="width: 610px"><img class="size-full wp-image-93 " title="Creating a new Site" src="http://tutorialzine.com/wp-content/uploads/2009/07/i8.jpg" alt="We create a new Site" width="600" height="460" /><p class="wp-caption-text">Creating a new Site</p></div>
<p>We fill in <strong>Local Info</strong> with all the data needed, after that we must provide data for Remote Info &#8211; you can fill in your FTP credentials and you can even choose to <strong>automatically upload files on save</strong> &#8211; a truly useful feature.</p>
<h3><a name="files"></a>The file structure</h3>
<p>Below you can see how the BloggyBits file structure is organized.</p>
<div id="attachment_94" class="wp-caption alignnone" style="width: 610px"><img class="size-full wp-image-94" title="The file structure" src="http://tutorialzine.com/wp-content/uploads/2009/07/i9.jpg" alt="The file structure" width="600" height="460" /><p class="wp-caption-text">The file structure</p></div>
<p>As you can see, at the root are only the most important files. You could optimize your root folder even further by creating a CSS and a JS folder for the respective file types.</p>
<p>In the fallowing tutorials we are going to gradually create all those files and make it all work.</p>
<p>The most important thing here is to see how the functionality has been divided among the different files. This allows us to reuse code and have globally accessible configuration in every page of our site.</p>
<p>For example here are the first lines of index.php:</p>
<pre class="brush:php">require "connect.inc.php";
require "sess.inc.php";
require "functions.inc.php";</pre>
<p>We include three files &#8211; for the mysql connection, session handling and the functions we have created for the site. The command require behaves exactly like include (includes the code in the files in the current one), but unlike include it throws a Fatal error and exits your script.</p>
<p>You can even further optimize it if you have a single include file, that handles all your includes.</p>
<h3>What are we doing next time?</h3>
<p>We start <a href="/2009/07/creating-our-html-css-website/" target="_blank">building the HTML &amp; CSS design</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tutorialzine.com/2009/07/organizing-the-site-structure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Designing our site &amp; widget, part 2</title>
		<link>http://tutorialzine.com/2009/07/designing-our-site-widget-part-2/</link>
		<comments>http://tutorialzine.com/2009/07/designing-our-site-widget-part-2/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 21:00:32 +0000</pubDate>
		<dc:creator>Martin Angelov</dc:creator>
				<category><![CDATA[Specials]]></category>
		<category><![CDATA[Photoshop]]></category>

		<guid isPermaLink="false">http://www.stepinto.net/?p=83</guid>
		<description><![CDATA[In this tutorial we continue designing BloggyBits.com]]></description>
			<content:encoded><![CDATA[<h3>Web site design</h3>
<p>We continue our step-by-step tutorials about the creation of BloggyBits. Last time, we finished <a href="/2009/07/designing-our-site-widget-part-1/">the design of the BloggyBits widget</a>. Now we have to create the homepage of the service, which shares some of the design ideas that stand behind the widget.</p>
<h3>Needed tools</h3>
<p>As in the first part of the tutorial, our arsenal consists of  Photoshop and all its glory.</p>
<h3>Designing our site</h3>
<p>Designing a site first in Photoshop, and later in a HTML editor gives you the flexibility to rapidly change the looks of the site in the early stages of development, without risking to throw away HTML and CSS code. It is also a lot quicker to build your layout and have an idea of what you are doing early on. Also with the tools that will be demonstrated in the following examples, you will easily export all the graphics and start coding right away.</p>
<p>The first step is to create a blank document with dimensions 1000&#215;1000 pixels. Sometimes, when you design a site, you find the need to use an even bigger canvas, but you can always enlarge it later.</p>
<div id="attachment_85" class="wp-caption alignnone" style="width: 610px"><img class="size-full wp-image-85  " title="Work version of the design" src="http://tutorialzine.com/wp-content/uploads/2009/07/i4.jpg" alt="Work version of the design" width="600" height="460" /><p class="wp-caption-text">Work version of the design</p></div>
<p>As you see from this work draft, we have decided the main layout of the site, where the logo, heading and menu items will go, the look of the site and that is about it.  A lot changed since, as you can see if you visit <a href="http://bloggybits.com" target="_blank">BloggyBits</a> and compare it to this first version.</p>
<p>You may ask  why I have included the navigation buttons twice. The top row is their normal state, and the bottom is the hover state (we will talk more about this in the tutorials later on).</p>
<p>But lets inspect the design in details to see what&#8217;s what.</p>
<div id="attachment_86" class="wp-caption alignleft" style="width: 310px"><img class="size-full wp-image-86" title="Our layers" src="http://tutorialzine.com/wp-content/uploads/2009/07/i5.jpg" alt="Our layers" width="300" height="460" /><p class="wp-caption-text">Our layers</p></div>
<p>On the top of the stack of layers is the logo of the site &#8211; in this case the text  &#8220;BloggyBits&#8221; with a gradient.</p>
<p>Next are some great social icons, found through <a href="http://iconfinder.net" target="_blank">iconfinder</a>. They are used to replace the default graphic of the <a href="http://www.addthis.com" target="_blank">AddThis</a> social bookmarking manager.</p>
<p>Bellow you can see the navigation buttons, which are displayed on the Menu bar.<br />
A few paragraphs to the bottom of this article, you can see a dissection of a navigation button. The interesting part here, is how the &#8220;round_Bg&#8221; layer is clipped by the &#8220;rect_body&#8221;. This shows how, just by using simple shapes, to create a navigation button, that also acts as a progress indicator (it shows the steps needed to complete a certain activity on a site).</p>
<p>Every button has a corresponding hover state. The main difference between them, is that the hover version is a little bit lighter and the text in the button is underlined.<br />
In the final HTML/CSS design, the menu buttons will be positioned as anchor elements inside a unordered list and the transition between the states will be pure CSS.</p>
<p>After those, there is the label for the sharing icons, the Menu bar, where the navigation is positioned, some sample text, the right content area, where a screen shot and some info about the widget will find place and finally the background layer.</p>
<div id="attachment_87" class="wp-caption alignnone" style="width: 295px"><img class="size-full wp-image-87 " title="Dissection of a button" src="http://tutorialzine.com/wp-content/uploads/2009/07/i6.jpg" alt="Disection of a button" width="285" height="250" /><p class="wp-caption-text">Dissection of a button</p></div>
<h3>Exporting the graphics</h3>
<p>Now, that we are done with designing, it is time to export what we&#8217;ve done, so we can continue coding the site in a code editor. Luckily, Photoshop has the tool necessary for the job &#8211; the slice tool.</p>
<div id="attachment_89" class="wp-caption alignnone" style="width: 610px"><img class="size-full wp-image-89" title="Exporting our slices" src="http://tutorialzine.com/wp-content/uploads/2009/07/i7.jpg" alt="Exporting our slices" width="600" height="460" /><p class="wp-caption-text">Exporting our slices</p></div>
<p>We slice &#8216;em up and export them via File → &#8220;Save For Web &amp; Devices&#8221;. After you choose a file type and click &#8220;Save&#8221;, be sure to select &#8220;All User Slices&#8221;, or your slices will be exported along with automatically generated ones.</p>
<h3>Final words</h3>
<p>In this tutorial we completed the design of our site, and exported it, so that we can continue with the real web development. Next time we start using Adobe Dreamweaver to <a href="/2009/07/organizing-the-site-structure/">create a real website from a bunch of images</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tutorialzine.com/2009/07/designing-our-site-widget-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Designing our site &amp; widget, part 1</title>
		<link>http://tutorialzine.com/2009/07/designing-our-site-widget-part-1/</link>
		<comments>http://tutorialzine.com/2009/07/designing-our-site-widget-part-1/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 18:47:57 +0000</pubDate>
		<dc:creator>Martin Angelov</dc:creator>
				<category><![CDATA[Specials]]></category>
		<category><![CDATA[Photoshop]]></category>

		<guid isPermaLink="false">http://www.stepinto.net/?p=73</guid>
		<description><![CDATA[Looks sell. Good looks sell more. That is why design is such an important aspect of the development process of a site. We will start from a blank Photoshop document and create a XHTML &#038; CSS web site in a few easy steps.]]></description>
			<content:encoded><![CDATA[<h3>The tools</h3>
<p>For this tutorial, we will need the fundamental tool for any web designer &#8211; Adobe Photoshop. I am using version CS3, but the process shown here is version independent. So let&#8217;s start where we stopped the last time &#8211; creating our design.</p>
<h3>The colors</h3>
<p>After we have laid <a href="/2009/07/planning-our-new-site/">the basic concepts behind BloggyBits</a>, we should now start creating the front-end. As you know, design is very important for a website.</p>
<p>The first thing we do is choose a color theme, which will be used both in the site and the widget. My tool of choice for the job is adobe&#8217;s <a href="http://kuler.adobe.com" target="_self">kuler</a>. If you haven&#8217;t heard of it, it is a free service, aimed at providing its members with the ability to create great color themes, or download ones already made by others.<br />
You can also take a look at their AIR application too, which makes it even easier.</p>
<div id="attachment_77" class="wp-caption alignnone" style="width: 610px"><img class="size-full wp-image-77" title="Choose color themes with kuler" src="http://tutorialzine.com/wp-content/uploads/2009/07/i2.jpg" alt="Choose color themes with kuler" width="600" height="460" /><p class="wp-caption-text">Choose color themes with kuler</p></div>
<p>After you choose a theme you can either log-in and download it, or you can copy the hash values of the colors for use in Photoshop or other software.</p>
<h3>Designing the widget</h3>
<p>We have to design both a website and a widget. And preferably, they should be uniform &#8211; we are preparing the website as an extension to the widget and it must have the same feel to it.</p>
<p>So lets start designing. First problem we face are the dimensions of the widget (width and height). If they are too small, content won&#8217;t be readable and if they are too big, the widget won&#8217;t fit in blogs.</p>
<p>For now we choose a size that favors the content &#8211; 250 by 350 pixels, but unfortunately, there are some blogs (or blog themes) that do not support that size of widgets on their sidebars.<br />
However, if the need arises, a smaller version of the widget will gladly be developed for those scenarios.<br />
In web development it is a common practice not to start with the fully-fledged service, but rather further-develop it later on. This helps you stay on schedule and not risk bloating your project with features, that may end up unneeded.</p>
<p>Now let&#8217;s create a blank photoshop document with a size of 250 by 350 pixels and start layering on our design.</p>
<div id="attachment_79" class="wp-caption alignnone" style="width: 610px"><img class="size-full wp-image-79" title="Widget design &amp; layers" src="http://tutorialzine.com/wp-content/uploads/2009/07/i3.jpg" alt="Widget design &amp; layers" width="600" height="460" /><p class="wp-caption-text">Widget design &amp; layers</p></div>
<p>This is just a mock-up of the real thing  &#8211; some things were added later in development, but that is pretty much how the final design looked. You see the background as the bottommost layer named &#8220;bg&#8221;. It has a color overlay, set with the background-color.</p>
<p>Next are three sample posts, each of which contain a picture of a tree, a title, date, and a background rectangular shape.</p>
<p>Details make a design good, so we are using some nicely looking icons for the social sites tabs, and the backward/forward arrows. Those icons are free for use for both commercial and non-commercial projects. You can find those and many more on the <a href="http://iconfinder.net" target="_blank">iconfinder</a> website.</p>
<p>A good practice in your design would be to name every layer, so you can easily find your way later on &#8211; it improves your effectiveness and prevents any accidental editing or deletion of a wrong layer.</p>
<p>We are ready with our widget design. The next step in the creation of the widget is to import it in Adobe Flash and start programming.</p>
<h3>What are we doing next time?</h3>
<p>Next time we start <a href="/2009/07/designing-our-site-widget-part-2/" target="_blank">designing the BloggyBits website</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tutorialzine.com/2009/07/designing-our-site-widget-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Planning our new site</title>
		<link>http://tutorialzine.com/2009/07/planning-our-new-site/</link>
		<comments>http://tutorialzine.com/2009/07/planning-our-new-site/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 00:02:51 +0000</pubDate>
		<dc:creator>Martin Angelov</dc:creator>
				<category><![CDATA[Specials]]></category>

		<guid isPermaLink="false">http://www.stepinto.net/?p=57</guid>
		<description><![CDATA[This is the first tutorial of a series following the creation of BloggyBits.com. We are laying the basic concepts that will allow us to create a fully functional and user-friendly site.]]></description>
			<content:encoded><![CDATA[<h3>The steps</h3>
<p>There are a few basic steps, that are common for every new web site before any real development has started. Missing them is like playing a russian roulette with a fully loaded gun &#8211; it will surely come back to you no matter how good you are. The first and most important of them is carefully planning of all the features the site will encompass. This ensures that you don&#8217;t invest any of your precious time into building features, that will get scraped later.</p>
<p>In our case BloggyBits started as an idea for a neat little  Flash widget, that would be a great addition for any blog &#8211; you just put it in your sidebar, and it shows all your latest doings with its flash goodness.</p>
<p>A great thing about such an idea, is that it promotes itself (the second most important thing in web development, apart from building the site itself) &#8211; a lot of people will see the widget somewhere and put it in their own site, thus further promoting it. At least in theory &#8211; lets not forget that they must be really <strong>impressed</strong> with it.</p>
<p>Of course, the widget cannot exist on its own &#8211; we need a way to let people configure and generate the code, read some info, leave us feedback and edit the widget later on. This calls for a site that will be the home of the widget, that must be able to meet all of the above requirements, and share the principles that stand behind the widget itself &#8211; clean design and simplicity.</p>
<h3>Create a mind map</h3>
<p>Now that we have an idea of what lies ahead, we must somehow create a mind map, along with some technical logic, of  our masterpiece to be.</p>
<div id="attachment_64" class="wp-caption alignnone" style="width: 610px"><img class="size-full wp-image-64  " title="Our mind map" src="http://tutorialzine.com/wp-content/uploads/2009/07/chart1.gif" alt="Our mind map" width="600" height="460" /><p class="wp-caption-text">Our mind map of the basic principles behind the site</p></div>
<p>Looks great, but what does it all mean? Well, here we have the basic layout, organized by the PHP back-end. Some of its functions:</p>
<ul>
<li>It updates the local data storage with a user&#8217;s latest activity on the social sites, that he has chosen (by scanning through RSS feeds);</li>
<li>The back-end presents the flash widget with a properly structured (XML) representation of all of your activity, and the widget configuration;</li>
<li>PHP manages the generation of the widget and the changes made to it later by the &#8220;edit&#8221; functionality;</li>
<li>It handles the bloggybits.com website.</li>
</ul>
<p>The flash widget is a front-end that presents the data to the user in a friendly way, and schedules updates to the data in an asynchronous way (we&#8217;ll get back to this in details in the next tutorials).</p>
<h3>What we learned?</h3>
<p>If we can summarize it in a single sentence &#8211; don&#8217;t start programming and designing before you&#8217;ve thought over the main aspects of the site, or you risk wasting your (or your client&#8217;s) time.</p>
<h3>What is next?</h3>
<p>We can continue with the cornerstone of  web design &#8211; the design itself (duh). Both the widget and the site must have a stylish and clean look. No matter how impressive your back-end code is &#8211; if you have a bad design everything is lost.</p>
<p>Here is a quick preview of what we&#8217;re doing <a href="/2009/07/designing-our-site-widget-part-1/">next time</a>.</p>
<div id="attachment_66" class="wp-caption alignnone" style="width: 410px"><a href="http://bloggybits.com" target="_blank"><img class="size-full wp-image-66 " title="The design" src="http://tutorialzine.com/wp-content/uploads/2009/07/i1.jpg" alt="The design" width="400" height="280" /></a><p class="wp-caption-text">The design</p></div>
]]></content:encoded>
			<wfw:commentRss>http://tutorialzine.com/2009/07/planning-our-new-site/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)

Served from: tutorialzine.com @ 2010-08-01 03:00:12 -->