Tampilkan postingan dengan label Blogger. Tampilkan semua postingan
Tampilkan postingan dengan label Blogger. Tampilkan semua postingan

Minggu, 17 November 2013

Memanfaatkan Halaman Error Page 404 Blog dan Cara Membuat auto Error Page 404

Memanfaatkan Halaman Error Page 404 Blog dan Cara Membuat auto Error Page 404Memanfaatkan Halaman Error Page 404 Blog dan Cara Membuat auto Error Page 404 - Pernakah anda mecari artikel atau tutorial di blog, tapi anda tidak menemukan apa yang anda cari di blog yang anda kunjungi?. Hal ini kemungkinan halaman tersebut sudah terhapus atau URL yang anda masukkan salah. Nah!! disini anda sebagai blogger tentunya tidak mau kehilangan pengunjung, dan ini memungkinkan mempengaruhi jatah Traffic Blog anda :).

Disini, kita akan memanfaatkan Halaman Error page 404 dengan tampilan khusus dan dinamis sebagai penunjuk arah atau direct, untuk mengarahkan pengunjung ke blog anda sekaligus pengunjung bisa melihat-lihat menu-menu dan artikel-artikel yang anda sajikan.

Ada dua metode membuat halaman error page, yaitu :
  1. Halaman ERROR 404 otomatis (redirect error page). Pengunjung akan di redirect secara otomatis ke halaman utama atau halaman lain yang ditentukan.
  2. Halaman ERROR 404 manual (non redirect). Ketika pengunjung menemukan halaman ini, maka dia harus melakukan klik secara manual untuk pindah menuju ke halaman utama (homepage) atau halaman lainnya.

Cara Pertama
Halaman ERROR 404 otomatis (redirect error page)

Silahkan login dulu di blogger anda, terus masuk ke > Template > Edit Template, dan masukkan code meta tag dibawah ini, tepat dibawah code <head> :

<!-- Meta Title Halaman Error/404 -->
<b:if cond='data:blog.pageType == &quot;error_page&quot;'>
<title>404: Maaf halaman yang ada cari tidak ada | <data:blog.title/></title>
</b:if>

Set Meta tag selengkapnya kira-kira seperti ini :

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<HTML>
<head>
<meta charset='utf-8'/>
.
.
.
<!-- Meta Title Halaman Error/404 -->
<b:if cond='data:blog.pageType == &quot;error_page&quot;'>
<title>404: Maaf halaman yang ada cari tidak ada | <data:blog.title/></title>
</b:if>
.
.
.
&lt;style type=&quot;text/css&quot;&gt; &lt;!-- /*<b:skin><![CDATA[*/

Setelah itu, Masuk ke Setelan blogger > Preferensi Penelusuran > Kesalahan dan Pengalihan > Pesan Khusus untuk Laman Tidak Ditemukan > dan Edit. Berikut Screenshotnya :

Memanfaatkan Halaman Error Page 404 Blog dan Cara Membuat auto Error Page 404

Lalu Copy Paste Code HTML dibawah ini di Kotak yang disediakan :

<p align='center'><strong><font color='#ff0000' size='25px'>Opsst!! Error 404 [Page Not Found]</font></strong></p>
<br/>
<br/>
<br/>
<p align='center'><h1><b>Halaman tidak ditemukan</b></h1></p>
<p align='center'>Kemungkinan halaman telah dihapus, atau Anda salah menulis URL</p>
<p align='center'>Kembali ke <a expr:href='data:blog.homepageUrl'>BLOG DAENG KULLE</a></p>

Note :
  • Ganti Deskripsi Pesan Error Page sesuai keinginan anda.
  • Ganti Titel URL diatas, menjadi Page title Blog anda.
  • Lalu Save dan selesai.

Cara Kedua
Halaman ERROR 404 manual (non redirect)

Memanfaatkan Halaman Error Page 404 Blog dan Cara Membuat auto Error Page 404

Demo halaman yang anda lihat diatas, adalah hasil dari tag kondisional untuk halaman kesalahan/error page. Berikut ini, cara sederhana untuk membuat halaman Error Page 404 :

Contoh tag kondisional yang akan digunakan :

</head>
<body>
<b:if cond='data:blog.pageType != &quot;error_page&quot;'>
.
.
Baris/bidang element blog seperti posting, widget, sidebar dan yang lainnya.
Element ini akan di sembunyikan jika tak ditemukan url/link apa pun yang ada dalam directory widget.
.
.
</b:if>

Dibawah ini adalah pesan error yang akan muncul ketika permintaan tidak di temukan :

<b:if cond='data:blog.pageType == &quot;error_page&quot;'>
<div id='error-page'>
<div id='error-inner'>
<div class='box-404'>404</div>
<h1>Halaman tidak ditemukan</h1>
<p>Kemungkinan halaman telah dihapus, atau Anda salah menulis URL</p>
<p>Kembali ke <a expr:href='data:blog.homepageUrl'>BLOG DAENG KULLE</a></p>
<div id='search-box'>
<form action='/search' id='cse-search-box' method='get' target='_top'>
<input id='search-text' name='q' onblur='if (this.value == &quot;&quot;) {this.value = &quot;Cari Artikel di Blog Daeng Kulle&quot;;}' onfocus='if (this.value == &quot;Cari Artikel di Blog Daeng Kulle&quot;) {this.value = &quot;&quot;}' type='text' value='Cari Artikel di Blog Daeng Kulle'/>
<button id='search-button' type='submit'/>
</form>
</div>
</div>
</div>
</b:if>

</body>
</HTML>

Pertama, cari code <body> dan penutup </body> di template anda, lalu sisipkan kode tag conditional berikut di antaranya, lihat cara seperti di bawah ini :

Pastekan kode di bawah ini di bawah kode <body>

<b:if cond='data:blog.pageType != &quot;error_page&quot;'>

Kemudian cari kode </body> dan pastekan kode berikut di atasnya :

</b:if>

Lalu letakkan kode berikut ini di atas kode </body>

<b:if cond='data:blog.pageType == &quot;error_page&quot;'>
<div id='error-page'>
<div id='error-inner'>
<div class='box-404'>404</div>
<h1>Halaman tidak ditemukan</h1>
<p>Kemungkinan halaman telah dihapus, atau Anda salah menulis URL</p>
<p>Kembali ke <a expr:href='data:blog.homepageUrl'>BLOG DAENG KULLE</a></p>
<div id='search-box'>
<form action='/search' id='cse-search-box' method='get' target='_top'>
<input id='search-text' name='q' onblur='if (this.value == &quot;&quot;) {this.value = &quot;Cari Artikel di Blog Daeng Kulle&quot;;}' onfocus='if (this.value == &quot;Cari Artikel di Blog Daeng Kulle&quot;) {this.value = &quot;&quot;}' type='text' value='Cari Artikel di Blog Daeng Kulle'/>
<button id='search-button' type='submit'/>
</form>
</div>
</div>
</div>
</b:if>

</body>
</HTML>

Jika benar penempatan code Tag Error Page, akan tampak seperti dibawah ini :

</head>
<body>
<b:if cond='data:blog.pageType != &quot;error_page&quot;'>
.
.
Baris/bidang element blog seperti posting, widget, sidebar dan yang lainnya.
Element ini akan di sembunyikan jika tak ditemukan url/link apa pun yang ada dalam directory widget.
.
.
</b:if>

<b:if cond='data:blog.pageType == &quot;error_page&quot;'>
<div id='error-page'>
<div id='error-inner'>
<div class='box-404'>404</div>
<h1>Halaman tidak ditemukan</h1>
<p>Kemungkinan halaman telah dihapus, atau Anda salah menulis URL</p>
<p>Kembali ke <a expr:href='data:blog.homepageUrl'>BLOG DAENG KULLE</a></p>
<div id='search-box'>
<form action='/search' id='cse-search-box' method='get' target='_top'>
<input id='search-text' name='q' onblur='if (this.value == &quot;&quot;) {this.value = &quot;Cari Artikel di Blog Daeng Kulle&quot;;}' onfocus='if (this.value == &quot;Cari Artikel di Blog Daeng Kulle&quot;) {this.value = &quot;&quot;}' type='text' value='Cari Artikel di Blog Daeng Kulle'/>
<button id='search-button' type='submit'/>
</form>
</div>
</div>
</div>
</b:if>

</body>
</HTML>

Selanjutnya, sisipkan Meta Tag di bawah ini, tepat di bawah kode <head> :

<!-- Meta Title Halaman Error/404 -->
<b:if cond='data:blog.pageType == &quot;error_page&quot;'>
<title>404: Maaf halaman yang ada cari tidak ada | <data:blog.title/></title>
</b:if>

Set Meta tag selengkapnya kira-kira seperti ini :

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<HTML>
<head>
<meta charset='utf-8'/>
.
.
.
<!-- Meta Title Halaman Error/404 -->
<b:if cond='data:blog.pageType == &quot;error_page&quot;'>
<title>404: Maaf halaman yang ada cari tidak ada | <data:blog.title/></title>
</b:if>
.
.
.
&lt;style type=&quot;text/css&quot;&gt; &lt;!-- /*<b:skin><![CDATA[*/

Setelah semuanya selesai diatas, tambahkan kode CSS berikut dibawah ini, di template anda. Simpan diatas kode ]]></b:skin> :

#error-page {background-color: #e9e9e9;position: fixed !important;position: absolute;text-align: center;top: 0;right: 0;bottom: 0;left: 0;z-index: 99999;}
#error-inner {margin: 11% auto;}
#error-inner .box-404 {width: 200px;height: 200px;background: #21afa4;color: #fff;font-size: 80px;line-height: 200px;border-radius: 10px;margin: 0 auto 50px;position: relative;}
#error-inner .box-404::after {content: " ";width: 0;height: 0;bottom: -8px;border-color: #21afa4 transparent transparent;border-style: solid;border-width: 9px 9px 0;position: absolute;left: 47%;}
#error-inner h1 {text-transform: uppercase;}
#error-inner p {line-height: 1.9em;font-size: 15px;}

Note :
Ganti Deskripsi Error Page Tag <h1> dan <p> dengan Deskripsi Error Page yang anda inginkan.

Selamat Mencoba!!

Rabu, 16 Oktober 2013

Cara Cloning Template Blogger

Cloning TemplateCara Cloning Template - Berawal dari saya mencari di mbah google template Blogger Valid HTML5 + Responsive untuk mengganti template default bawaan dari blogger untuk Blog Sederhana saya ini, namun semuanya tidak sesuai dengan selera/keinginan saya hehehe :D Dalam pencarian Template Valid HTML5, saya di arahkan mbah google ke blog master om Agus Ramadhani dan Kang Ismet

Saya suka Tema Template kedua master Blog ini. Nah di sini muncul ide kreatif saya untuk meng-cloning template master blog ini. (Maaf ya om Agus dan Kang Ismet) hehehe Piss \m/_.._\m/ saya hanya sekedar mengembangkan kreatifitas saya, dan tidak akan share hasil Template clonengan buatan saya :).

Pertama kali saya clonng template Kang Ismet dan berhasil. Berikut screenshoot nya :

Cloning Template

Waktu Pembuatan template clonengan hanya membutuhkan waktu dua jam, termasuk menyusun formulasi template, dan menemukan kode kode yang disembunyikan atau yang tidak ditampilkan, sampai proses upload template di blogger. Dalam pembuatan template, anda tidak perlu repot-repot mencari template yang mirip mirip template bawaan template orang yang anda akan di cloning. cukup copy source code templatenya saja.

Disini saya tidak akan share hasil Template clonengan blog master buatan saya, namun saya akan memberitahukan cara cloning template blog orang lain. Okay !! mari kita langsung aja caranya (simak baik-baik) :

Dalam Bahasan postingan ini, saya kasih contoh cloning template blog saya sendiri, hasil clonengan dari template Blog om master blog Agus Ramadhani atau biasa dikenal di sebut o-om.com

Pertama
Hal pertama yang anda lakukan pilih salah satu postingan template target anda, terserah anda postingan apa aja!!. Setelah memilih salah satu postingan, lalu klik kanan di area bebas. Klik Kanan > Lihat Code Sumber Laman. Jika browser di kommputer anda berbahasa inggris kira-kira seperti ini: Right Click > See Source Code. (saya menggunakan Browser Firefox Berbahasa Indonesia). Lalu buat Notepad, dan copy semua Source code halaman postingan pilihan anda, Paste lalu beri Judul notepad anda "dplkt-halaman-postingan.txt" (tanpa tanda kutip). atau "dplkt-halaman-postingan.xml" (tanpa tanda kutip). Jangan Lupa Buat Folder Baru dan Beri judul "Duplikat Template" (Tanpa Tanda Kutip). Simpan Hasil Copian Sorce Code anda di folder tersebut, biar gampang di ingat.

Kedua
Perlu di ketahui, susunan Template Blog umumnya seperti ini :

  • Header Wrapper terdiri dari Header Left dan Header Right. (pada Template duplikat saya, seperti ini Header Inner dan .blog-desc)
  • Outer Wrapper terdiri dari Main Wrapper dan Sidebar Wrapper.
  • Footer Wrapper terdiri dari Bottom Left, Bottom Center dan Bottom Right
  • Credit Wrapper.

Okay!! anda mulai dari bawah code HTML dulu, hasil dari copian sorce code tadi. Cari dan perhatikan baik-baik code pada bagian Footer Wrapper, misalnya seperti ini: <div id='footer-wrapper'>

Susunan code bagian Footer Wrapper dari template duplikat saya, terdiri dari :

<div id='footer-wrapper'>
<div id='bottom'> ..... susunan dari Bottom terdiri dari :
- left-bottom
- center-bottom
- right-bottom
<div id='upper-footer'> dan
<div class='credits'>

Contoh code pada bagian Footer Wrapper:

<div id='footer-wrapper'>
<div id='bottom'>
<div class='bottom section section' id='left-bottom'><div class='widget HTML' id='HTML4'>
<h2 class='title'>About Me</h2>
<div class='widget-content'>
<div class="profile-textblock">
<!-- isi widget ABOUT ME saya hapus -->
</div>
</div>
</div></div>


Note:
  • Perhatikan code yang berwarna merah. yang berwarna merah, Hapus saja.
  • Perhatikan code yang berwarna Hijau, code div ganti dengan b:section lalu tambahkan preferred='yes' di belakang code id='left-bottom', sehingga hasilnya seperti ini :

<b:section class='bottom section' id='left-bottom' preferred='yes'/>

Lalu lanjut pada bagian center-bottom dan right-bottom. dan hasil lengkap dari b:section widget pada sub bagian bottom seperti ini :

<b:section class='bottom section' id='left-bottom' preferred='yes'/>
<b:section class='bottom section' id='center-bottom' preferred='yes'/>
<b:section class='bottom section' id='right-bottom' preferred='yes'/>

Hasil Selengkapnya pada sub bagian Bottom dari Footer Wrapper seperti ini :

<div id='footer-wrapper'>
<div id='bottom'>
<b:section class='bottom section' id='left-bottom' preferred='yes'/>
<b:section class='bottom section' id='center-bottom' preferred='yes'/>
<b:section class='bottom section' id='right-bottom' preferred='yes'/>
<div id='upper-footer'>
<b:section class='footer section' id='footer' preferred='yes'/>
</div> <!-- end upper footer -->
</div> <!-- end bottom -->
<div class='credits'>
</div> <!-- end credits -->
</div> <!-- end footer wrapper -->

Note:
Perhatikan dan teliti baik-baik code </div> sebagai code penutup. Jangan sampai ada yang salah dalam penempatan code </div> tersebut.

Ketiga
Lanjut pada bagian Outer Wrapper yang terdiri dari Main Wrapper dan Sidebar Wrapper.

Contoh susunan bagian Outer Wrapper :

<div id='main-wrapper'>
<div id='main-wrapper-border'> <-- ini sekedar tambahan style border saja, sebelah kanan body postingan tebalnya 5px
<div id='sidebar-wrapper'>

Pada bagian Outer Wrapper ini, sama seperti cara menyusun bagian Footer Wrapper, namun khusus pada bagian b:section Main, anda sisa meng-copy saja code template yang lama milik anda. Contohnya seperti ini :

<div id='outer-wrapper'>
<div id='main-wrapper'>
<div id='main-wrapper-border'>
<b:section class='main' id='main' showaddelement='no'> <---(star copy) mulai copy semua code b:section Main, dari template blog anda yang lama sampai....
<b:widget id='Blog1' locked='true' title='Posting Blog' type='Blog'>
<b:includable id='main' var='top'>
.
.
.
<!-- bla bla bla bla bla -->
.
.
.
</b:includable>
</b:widget>
</b:section> <-- sampai dengan akhir dari code ini
</div> <!-- end main wrapper border -->
</div> <!-- end main wrapper -->

Note:
  • Yang berwarna biru mulai star peng-copian dari template blog lama anda sampai akhir dari </b:section>.
  • Khusus code </div> penutup untuk Outer Wrapper belum ditambahkan dari keterangan diatas, karena masih ada Sidebar Wrapper. Nantinya code </div> penutup untuk Outer Wrapper akan di sematkan tepat dibawah Sidebar Wrapper.
  • Dalam kasus ini, saya meng-copy isi code Main Wrapper dari template default bawaan blogger. mengingat masih lengkap, masih perawan, Karena belum ada pengurangan atau pengeditan yang saya lakukan dari template default bawaan blogger tersebut. (isi dari code Blog Post dan isi code Comments).

Selanjutnya, anda lanjut pada sub bagian Sidebar Wrapper. Lihat contoh di bawah ini :

<div id='sidebar-wrapper'>
<div class='inner-box section section' id='inner-box'><div class='widget Feed' id='Feed1'>
<h2>New Post</h2>
<div class='widget-content' id='Feed1_feedItemListDisplay'>
<span style='filter: alpha(25); opacity: 0.25;'>
<a href='http://metropersonal.blogspot.com/feeds/posts/default'>Memuat...</a>
</span>
</div>
</div>


Note:
  • Perhatikan code yang berwarna merah. yang berwarna merah, Hapus saja.
  • Perhatikan code yang berwarna Hijau, code div ganti dengan b:section lalu tambahkan preferred='yes' di belakang code id='inner-box', sehingga hasilnya seperti ini :

<b:section class='inner-box section' id='inner-box' preferred='yes'/>

Hasil Selengkapnya pada sub bagian Sidebar Wrapper dari Outer Wrapper seperti ini :

<div id='sidebar-wrapper'>
<b:section class='inner-box section' id='inner-box' preferred='yes'/>
</div> <!-- end sidebar wrapper -->

Dan sebagai penutup bahasan bagian Outer Wrapper, berikut Hasil Selngkap-lengkapnya :

<div id='outer-wrapper'>
<div id='main-wrapper'>
<div id='main-wrapper-border'>
<b:section class='main' id='main' showaddelement='no'> <---(star copy) mulai copy semua code b:section Main, dari template blog anda yang lama sampai....
<b:widget id='Blog1' locked='true' title='Posting Blog' type='Blog'>
<b:includable id='main' var='top'>
.
.
.
<!-- bla bla bla bla bla -->
.
.
.
</b:includable>
</b:widget>
</b:section> <-- sampai dengan akhir dari code ini
</div> <!-- end main wrapper border -->
</div> <!-- end main wrapper -->
<div id='sidebar-wrapper'>
<b:section class='inner-box section' id='inner-box' preferred='yes'/>
</div> <!-- end sidebar wrapper -->
<!-- spacer for skins that want sidebar and main to be the same height-->
<div class='clear'>&#160;</div> <!-- clear fix do not remove -->
<br/>
</div> <!-- end outer-wrapper -->
</div> <!-- end outer wrapper line -->
<div class='clear'/>
<div class='backtotop'><a href='#'>Back to Top</a></div>

Note:
  • Perhatikan dan teliti baik-baik code </div> sebagai code penutup. Jangan sampai ada yang salah dalam penempatan code </div> penutup tersebut.
  • Khusus untuk code penutup </div> <!-- end outer wrapper line --> ini, fungsinya sebagai code </div> penutup dari data vocabulary Review, gunanya untuk merating semua postingan anda, letak tepatnya, anda bisa lihat tepat dibawah code <body>

Keempat
Selanjutnya, anda lanjut pada bagian Header Wrapper, sebagai akhir dari pembahasan code ini. Berikut Susunan code dari Header Wrapper :

<div id='branding'>
<div id='head-inner'>
<div id='header-wrapper'>

Header Wrapper terdiri dari Blog Desc dan Header. Pada bagian Header Wrapper ini, sama seperti cara menyusun bagian Outer Wrapper, namun khusus pada bagian b:section Header, anda sisa meng-copy saja code template yang lama milik anda. Contohnya seperti ini :

<div id='branding'>
<div id='head-inner'>
<div id='header-wrapper'>
<b:section class='blog-desc section' id='blog-desc' preferred='yes' showaddelement='yes'/>
<b:section class='header' id='header' maxwidgets='1' showaddelement='no'> <---(star copy) mulai copy semua code b:section Header, dari template blog anda yang lama sampai....
<b:widget id='Header1' locked='true' title='Metro Personal (Header)' type='Header'>
<b:includable id='main'>
<b:if cond='data:useImage'>
<b:if cond='data:imagePlacement == &quot;BEHIND&quot;'>
.
.
.
<!-- bla bla bla bla bla -->
.
.
.
</b:includable>
</b:widget>
</b:section> <-- sampai dengan akhir dari code ini
</div> <!-- end header wrapper -->
</div> <!-- end head inner -->
</div> <!-- end branding -->

Note:
  • Pada bagian blog-desc section, saya tambahkan showaddelement='yes' yang nantinya anda akan ganti menjadi 'no' setelah anda mengisi deskripsi tambahan agar supaya tidak ada penambahan widget lagi. Khusus deskripsi tambahan saja.
  • Yang berwarna biru mulai star peng-copian dari template blog lama anda sampai akhir dari </b:section>.
  • Perhatikan dan teliti baik-baik code </div> sebagai code penutup. Jangan sampai ada yang salah dalam penempatan code </div> penutup tersebut.

Kelima (penutup)
Rangkuman hasil Duplikat Template dari semua pembahasan code HTML diatas sebagai berikut :

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<HTML>
<head>
<meta charset='utf-8'/>
<!-- Sisipkan Code META TAG disini -->
//////////////////////////////////////////////
<!-- Sisipkan Code CSS disini -->
]]></b:skin>
<!-- Sisipkan Code Javascript RELATED POST disini -->
<!-- Sisipkan Code Javascript AUTO READ MORE disini -->
<!-- Sisipkan Code Javascript MOBILE MENU disini -->
</head>
<body>
<div><div itemscope='' itemtype='http://data-vocabulary.org/Review'>
<div id='branding'>
<!-- Sisipkan Code Social Facebook dll disini -->
<!-- Sisipkan Code Search disini -->
<div id='head-inner'>
<div id='header-wrapper'>
<b:section class='blog-desc section' id='blog-desc' preferred='yes' showaddelement='yes'/>
<b:section class='header' id='header' maxwidgets='1' showaddelement='no'> <---(star copy) mulai copy semua code b:section Header, dari template blog anda yang lama sampai....
<b:widget id='Header1' locked='true' title='Metro Personal (Header)' type='Header'>
<b:includable id='main'>
<b:if cond='data:useImage'>
<b:if cond='data:imagePlacement == &quot;BEHIND&quot;'>
.
.
.
<!-- bla bla bla bla bla -->
.
.
.
</b:includable>
</b:widget>
</b:section> <-- sampai dengan akhir dari code ini.
</div> <!-- end header wrapper -->
</div> <!-- end head inner -->
</div> <!-- end branding -->
//////////////////////////////////////////////
<!-- Sisipkan Code Stripe Style disini -->
<div id='outer-wrapper'>
<!-- Sisipkan Code Javascript MOBILE MENU disini -->
<!-- Sisipkan Code Menu Navigasi disini -->
<div id='main-wrapper'>
<div id='main-wrapper-border'>
<b:section class='main' id='main' showaddelement='no'> <---(star copy) mulai copy semua code b:section Main, dari template blog anda yang lama sampai....
<b:widget id='Blog1' locked='true' title='Posting Blog' type='Blog'>
<b:includable id='main' var='top'>
.
.
.
<!-- bla bla bla bla bla -->
.
.
.
</b:includable>
</b:widget>
</b:section> <-- sampai dengan akhir dari code ini
</div> <!-- end main wrapper border -->
</div> <!-- end main wrapper -->

<div id='sidebar-wrapper'>
<b:section class='inner-box section' id='inner-box' preferred='yes'/>
</div> <!-- end sidebar wrapper -->

<!-- spacer for skins that want sidebar and main to be the same height-->
<div class='clear'>&#160;</div> <!-- clear fix do not remove -->
<br/>
</div> <!-- end outer-wrapper -->
</div> <!-- end outer wrapper line -->

<div class='clear'/>
<div class='backtotop'><a href='#'>Back to Top</a></div>
//////////////////////////////////////////////
<div id='footer-wrapper'>
<div id='bottom'>
<b:section class='bottom section' id='left-bottom' preferred='yes'/>
<b:section class='bottom section' id='center-bottom' preferred='yes'/>
<b:section class='bottom section' id='right-bottom' preferred='yes'/>
<div id='upper-footer'>
<b:section class='footer section' id='footer' preferred='yes'/>
</div> <!-- end upper footer -->
</div> <!-- end bottom -->
<div class='credits'>
</div> <!-- end credits -->
</div> <!-- end footer wrapper -->

</div>
</body>
</HTML>

Note:
Untuk code Meta Tag silahkan kunjungi Blog Kedua Master yang saya sebutkan diatas, disini dan disini

Bila ada yang kurang jelas silahkan tanyakan melalui kotak komentar dibawah. Selamat Mencoba!!
Keep Spirit and Keep Imagination...Enjoy!! :)

Sabtu, 12 Oktober 2013

Automatic Background Color different Every Post Blogger

Background ColorAutomatic Background Color different Every Post Blogger - Easy!! Find the code </head> then put the following Javascript code just above the </head>

Background Color

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js?ver=1.5' type='text/javascript'/>
<script type='text/javascript'>
//<![CDATA[
function get_random_color() {
var letters = '0123456789ABCDEF'.split('');
var color = '#';
for (var i = 0; i < 6; i++ ) {
color += letters[Math.round(Math.random() * 14)];
}
return color;
}
$(function() {
$(".post").each(function() {
$(this).css("background-color", get_random_color());
});
});
//]]>
</script>

If you just want to change the color of posts on the main page alone you stay just use conditional tags like the code below:

<b:if cond='data:blog.url == data:blog.homepageUrl'>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js?ver=1.5' type='text/javascript'/>
<script type='text/javascript'>
//<![CDATA[
function get_random_color() {
var letters = '0123456789ABCDEF'.split('');
var color = '#';
for (var i = 0; i < 6; i++ ) {
color += letters[Math.round(Math.random() * 14)];
}
return color;
}
$(function() {
$(".post").each(function() {
$(this).css("background-color", get_random_color());
});
});
//]]>
</script>
</b:if>

Display different colors on the background of each posting may be ideal only for Templates with Style Gallery. But there is no harm if you want to try.

Creating Mobile First Responsive Design

Creating MobileCreating Mobile First Responsive Design - We're going to walk through how to create an adaptive web experience that's designed mobile-first. This article and demo will go over the following:

  • Why we need to create mobile-first, responsive, adaptive experiences
  • How to structure HTML for an adaptive site in order to optimize performance and prioritize flexibility
  • How to write CSS that defines shared styles first, builds up styles for larger screens with media queries, and uses relative units
  • How to write unobtrusive Javascript to conditionally load in content fragments, take advantage of touch events and geolocation
  • What we could do to further enhance our adaptive experience

The Need for Adaptivity
As the web landscape becomes increasingly complex, it's becoming extremely important to deliver solid web experiences to a growing number of contexts. Thankfully, responsive web design gives web creators some tools for making layouts that respond to any screen size. We'll use fluid grids, flexible images and media queries to get the layout looking great regardless of the size of the device's screen dimensions.

However, mobile context is much more than just screen size. Our mobile devices are with us wherever we go, unlocking entire new use cases. Because we constantly have our mobile devices with us, connectivity can be all over the board, ranging from strong wi-fi signals on the couch to 3G or EDGE when out and about. In addition, touch screens open new opportunities to interact directly with content and mobile ergonomics lead to different considerations when designing layout and functionality.

In order to create a site that's truly designed for mobile context and not just for small screens, we want to ensure that we tackle the many challenges of mobile development upfront. The constraints of the mobile context force us to focus on what content is essential and how to present that content as quickly as possible. Building fast-loading, optimized experiences mobile first has a trickle down (or up, depending on how you look at it) effect for tablet, desktop and other emerging contexts.

What We're Making: The Humble Product Detail Page

View the demo

The demo we're making is a simple e-commerce product detail page for a fictitious t-shirt company. Why choose this? E-commerce sites can have many use cases across contexts. For example, 70% of smartphone owners use their mobile phones to influence in-store purchases. So while we'll make sure that purchasing the product is as easy as possible, we'll also try to make the product reviews accessible and utilize the user's location to enhance the mobile experience.

Structure
Authoring lean, semantic HTML5 markup keeps adaptive experiences manageable and accessible, and also provides opportunities for enhanced experiences (quick example: using proper HTML5 input types brings up the appropriate virtual keyboard on many touch devices). Semantic markup is extremely portable and can be accessed by many mobile devices, tablets, desktop browsers and future web-enabled devices, regardless of feature set or capability.

Setting the viewport
In order to accommodate for sites not optimized for mobile screens, many modern mobile browsers set a larger browser viewport, which allows for better viewing of non-mobile-optimized sites. Users can then pinch-to-zoom in on the content they want. That's fine for non-mobile experiences, but because we're optimizing our experience for mobile browsers, we'll use the viewport meta tag to set the screen width to the device width:

<meta name="viewport" content="width=device-width, initial-scale=1" />

It's important to note that we're not disabling the user's ability to zoom the page (which you could do by adding user-scalable=no to the content attribute), even though we're optimizing the content for small screens. It's recommended to keep user zooming enabled to keep things as accessible as possible. However, there are use cases to disable user-zooming, such as if you're including fixed positioned elements.
Content fragments

In order to keep the experience as lightweight as possible and to improve the perceived loading time, we're creating two additional HTML documents for our auxiliary content, reviews.html andrelated.html. Because this content isn't required for the main use case (buying the product) and includes a number of images, we won't load it by default to keep the initial page size down. By default the content is accessible via links on the page, but if a certain level of javascript support is present, we'll conditionally load the content when the user requests it or when the resolution reaches a certain breakpoint.

HTML Special Characters
A simple technique to reduce the need for background images (thereby saving HTTP requests) is to use HTML special characters for simple shapes. In the case of our rating stars, we're using &#9733; to create a solid star (?) and &#9734; to create empty stars (?) for our ratings. And because it's HTML and not an image, it stays crisp even on high resolution screens.

The tel: URI Scheme
Another simple yet effective technique we're including in our footer is a clickable link to the customer service number. This is accomplished by using the tel URI scheme, which looks like this:

<a href="tel:+18005550199">1-800-555-0199</a>

We sometimes forget that mobile devices can make phone calls, and also that some desktop configurations can launch VoIP applications to initiate a phone call. We're including an easy way for users to facilitate a phone call, which in some cases might make sense (i.e. a mobile user who might prefer finishing the transaction over the phone versus going through a checkout flow on their mobile device). Now that we have a strong, semantic foundation in place, let's move onto adding style enhancements.

Style
When crafting our CSS, we'll do everything in our power to keep things lightweight and as fluid as possible. We understand that all these devices have many different screen sizes, and that tomorrow's devices won't have the same resolutions as today's. Because screen size is an unknown, we'll use the content itself to determine how the layout should adjust to its container.

Separate style sheet for larger screens
We're creating two separate CSS files, style.css and enhanced.css in order to deliver basic styles for screens less than 40.5em and using media queries to serve up enhanced styles for screens larger than 40.5em.

<link rel="stylesheet" type="text/css" href="style.css" media="screen, handheld" />
<link rel="stylesheet" type="text/css" href="enhanced.css" media="screen and (min-width: 40.5em)" />
<!--[if (lt IE 9)&(!IEMobile)]>
<link rel="stylesheet" type="text/css" href="enhanced.css" />
<![endif]-->

We're using the conditional code <!--[if (lt IE 9)&(!IEMobile)]> in order to serve up enhanced.css to non-mobile versions of IE less than version 9, which unfortunately don't support media queries. While this method does indeed add an HTTP request to the mix, it gives us greater flexibility over our styles. Alternately, we could use respond.js to deliver enhanced styles to IE.

We're using the em unit instead of px to maintain consistency with the rest of our relative units and account for user settings like zoom level. Also, the content should determine the breakpoint (we're using 40.5em as a breakpoint) because device dimensions are too varied and are always changing so are therefore unreliable.

Mobile-First Styles
Starting with baseline shared styles and introducing more advanced layout rules when screen size permits keeps code simpler, smaller and more maintainable. Here's just a quick example to demonstrate this point:

/*Large screen styles first - Avoid*/
.product-img {
width: 50%;
float: left;
}
@media screen and (max-width: 40.5em) {
.product-img {
width: auto;
float: none;
}
}

We want to avoid complexity as much as we can, so here's what a mobile-first approach looks like:

@media screen and (min-width: 40.5em) {
.product-img {
width: 50%;
float: left;
}
}

Instead of declaring large screen rules first only to override them for smaller screens, we'll simply define rules as more real estate becomes available. The web by default is a fluid thing so we'll do our best to work with it instead of against it. It's important to note that some mobile browsers (Symbian browsers, Blackberry <OS 6.0, Netfront, WP7 pre-Mango, etc) don't support media queries, so serving base styles by default reaches more devices and browsers. As Bryan Rieger puts it, "the absence of support for @media queries is in fact the first @media query."

Applying Media Queries
We're continuing our mobile-first style when we apply our media queries. Our related product list starts off two to a row, but increases to 3 in a row when the screen size is at least 28.75em wide (roughly the size of mobile phones in landscape mode) and then to 6 to a row when the screen size is at least 40.5em (roughly tablets in portrait mode or small desktop screens).

/*Default styles*/
.related-products li {
float: left;
width: 50%;
}
/*Display 3 per row for medium displays (like mobile phones in landscape or smaller tablets)*/
@media screen and (min-width: 28.75em) {
.related-products li {
width: 33.3333333%;
}
}
/*Display 6 to a row for large displays (like medium tablets and up) */
@media screen and min-width: 40.5em) {
.related-products li {
width: 16.6666667%;
}
}

Assuming small screen by default allows us to support more platforms and also makes it easy add more breakpoints without having to modify existing styles. Defining styles as they're needed also keeps file size down, reduces complexity and keeps code more maintainable.

Using Relative Units We're using percentages and em units in our design in order to keep things as flexible as possible. Relative units are far more compatible with the tremendous variance brought on by screen size, pixel density and zoom level.

While media queries are responsive web design's secret sauce, we want our fluid grids to do most of the work. Maintaining a whole slew of set-width styles across many media queries can become unwieldy, so we'll make sure the stylesheet's foundation is entirely flexible. Ethan Marcotte provides a formula for converting dimensions and font sizes from pixel-based to relative units:

target � context = result

Using CSS to Reduce Requests Too many HTTP requests can be a huge killer for performance, especially on mobile. We're incorporating some CSS techniques to save HTTP requests which will improve the site's performance. Using CSS gradients instead of background images reduces the amount of image requests and gives us more control over the design. We're including the appropriate vendor prefixes to ensure maximum compatibility (there are tools for this) and hoping that one day that these rules will become standardized to save us some time.

/*Using CSS gradients instead of background images*/
header[role="banner"] {
position: relative;
background: #111;
background: +linear-gradient (top, #111 0%, #222 100%);
}

We're also using data URIs instead of background images for some of the smaller icons (for icons like search, social features and location). While data URIs might look a bit ugly and can increase up the stylesheet file size, the reduction of requests results in a faster perceived download time.

/*Using a Data URI for Background Image*/
.find-nearby {
background: url(data:image/png;base64,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) no-repeat 100% 43%;
}

Behavior
Now that we have our structure and style in place, we'll add JavaScript enhancements to add functionality to the navigation, image gallery and auxiliary content.

Navigation
Navigation can be especially tricky for adaptive experiences. Top navigation is common for desktop sites, but top navigation can crowd the screen and push down the primary content on small screens. We want to highlight the product and not the site navigation, so we'll do our best to get the navigation out of the way. in our markup we've created a list called #nav-anchors, which will be used to toggle the visibility of the navigation and search bar for small screens.

<ul id="nav-anchors" class="nav-anchors">
<li><a href="#nav" id="menu-anchor">Menu</a></li>
<li><a href="#search" id="search-anchor">Search</a></li>
</ul>
<form id="search" action="#" method="post" class="search reveal">
<fieldset>
<legend>Search the Site</legend>
<input type="search" placeholder="Search Store" />
<input type="submit" value="Search" />
</fieldset>
</form>
<nav id="nav" class="nav reveal">
<ul role="navigation">
<li><a href="#">T-shirts</a></li>
<li><a href="#">Hoodies</a></li>
<li><a href="#">Pants</a></li>
</ul>
</nav>

We'll add a resize listener which will determine whether there's enough room to show the navigation and search bar.

$(w).resize(function(){ //Update dimensions on resize
sw = document.documentElement.clientWidth;
sh = document.documentElement.clientHeight;
checkMobile();
});

//Check if Mobile
function checkMobile() {
mobile = (sw > breakpoint) ? false : true;

if (!mobile) { //If Not Mobile
$('[role="tabpanel"],#nav,#search').show(); //Show full navigation and search
} else { //Hide
if(!$('#nav-anchors a').hasClass('active')) {
$('#nav,#search').hide(); //Hide full navigation and search
}
}
}

Image Gallery
By default the image gallery is simply a large image with thumbnail images that click through to their larger counterparts. This means that they're accessible to browsers and devices with poor or no JavaScript support.

<div id="product-img" class="product-img">
<figure class="img-container" id="img-container">
<img src="images/product_img_1.jpg" alt="Super Ffly T-shirt" />
</figure>
<nav>
<ul>
<li><a href="images/product_img_1.jpg"><img src="images/product_img_1_thumb.jpg" alt="Super Ffly Men's Shirt" /></a></li>
<li><a href="images/product_img_2.jpg"><img src="images/product_img_2_thumb.jpg" alt="Super Ffly Women's Shirt" /></a></li>
<li><a href="images/product_img_3.png"><img src="images/product_img_3_thumb.jpg" alt="Ffly Logo" /></a></li>
</ul>
</nav>
</div>

We'll build an image carousel from the available thumbnail images:

function buildGallery() {
container.html('<div id="img-list"><ul /></div>');
imgList = $('#img-list');
nav.find('a:first').addClass('active');

//For Each Navigation Link
nav.find('a').each(function() {
var $this = $(this);
var href = $this.attr('href');

//Prepare list item with image source in data attribute
arr += '<li data-imgsrc="'+href+'"></li>';
});

//Append to #img-list
imgList.find('ul').append(arr);

//Nav Thumbnail Click
nav.on('click', 'a', function(e) {
var pos = $(this).parent().index();
e.preventDefault();
loadImg(pos);
if(swipeEnabled) {
mySwipe.slide(index, 300);
}
updateNav(pos);
});
}

To enhance the experience further, we're using Modernizr to detect for the presence of touch events and CSS transitions, and if they are supported, we'll load in a library called SwipeJS to make a touch-friendly image carousel.

Modernizr.load({
test: Modernizr.touch && Modernizr.csstransitions,
yep: 'js/swipe.js',
complete: function() {
if (Modernizr.touch && Modernizr.csstransitions) {
swipeEnabled = true;
buildSwipe();
}
}
});

//Build Swipe Carousel
function buildSwipe() {
//Initialize Swipe.js
w.mySwipe = new Swipe(document.getElementById('img-list'), {
callback: function(event, index, elem) {
updateNav(index);
loadImg(index + 1);
}
});
}

We now have an accessible image gallery with added enhancements for touch-enabled devices.

Related Content In order to keep Initial page size down, we're not loading auxiliary content, namely the related t-shirts and product reviews, by default. Instead, they exist as their own HTML pages, which are accessed by links as a default behavior.

<section class="aux related-products" id="related-products">
<header id="tab-related">
<a href="related.html">
<h2>Similar T-shirts</h2>
</a>
</header>
</section>
<section class="aux reviews" id="reviews">
<header id="tab-reviews">
<a href="reviews.html">
<h2>8 Reviews</h2>
<ol class="star">
<li class="on">&#9733;</li>
<li class="on">&#9733;</li>
<li class="on">&#9733;</li>
<li class="on">&#9733;</li>
<li>&#9734;</li>
</ol>
</a>
</header>
</section>

We'll pull in the related content when one of two conditions are met: When a small-screen user clicks the related shirts or product reviews links When the screen has enough room to load in the auxiliary content.

//Check if Mobile
function checkMobile() {
if(sw > breakpoint) {
mobile = false; //Not Mobile
} else {
mobile = true; //Mobile
}

if (!mobile) { //If Not Mobile
loadAux(); //Load auxiliary content
}
}

//Set up Auxiliary content
function loadAux() {
var $aux = $('.aux');
$aux.each(function(index) {
var $this = $(this);
var auxLink = $this.find('a');
var auxFragment = auxLink.attr('href');
var auxContent = $this.find('[role=tabpanel]');
if (auxContent.size()===0 && $this.hasClass('loaded')===false) {
loadContent(auxFragment,$this);
}
});
}

function loadContent(src,container) { // Load Tab Content
container.addClass('loaded');
$('<div role="tabpanel" />').load(src +' #content > div',function() {
$(this).appendTo(container);
});
}

note: we're using screen size to determine when to load in content, but this is in no way perfect. Keep an eye out for navigator.connection for a better way to determine whether it's worth introducing extra content.

Geolocation
Leveraging user location to deliver enhanced experiences is an important aspect of mobile development. Thankfully geolocation is one of the best supported Features across mobile browsers (as well as most desktop browsers). The fallback functionality could be a simple form where the user simply inputs their ZIP code to find store near them.

Adaptive Images
Our demo isn't incorporating many large images, but it's best practice to load in mobile optimized images by default then conditionally load in larger images only when needed. There are lots of different techniques for responsive images, both client-side and server side. We've done a lot so far to be mindful of performance, and optimizing images is an easy way to optimize performance even further.

Less JS
Keeping pages as lightweight as possible is important for performance, so we should look to optimize scripts as much as possible. We're using the jQuery library for our demo, but we're definitely not using all of it. We could look into using Closure Compiler to strip out unused bits of the library to keep things as lightweight as possible while still taking advantage of what jQuery offers. Alternately, we could look into micro-frameworks like Zepto.js and others, but they typically don't necessarily offer the best cross-browser support. Writing vanilla Javascript could avoid additional heft but can be more difficult to author and harder to maintain. Ultimately, each approach has its pros and cons, just be sure to consider the tradeoffs when making these decisions.

Offline Access
It's increasingly important to make sure web experiences are accessible offline, especially when considering mobile users with variable connectivity. Thankfully, appcache and other offline techniques gives us a way to keep our resources accessible even when the user is offline.

Wrapping Up
We've created an experience that is mindful to user context and adapts both layout and functionality based the browser and device's features. We've also set up a foundation that can adapt to future devices and browsers. Here's some key takeaways:

  • Author semantic HTML5 markup as a foundation for adaptive experiences.
  • Create mobile first CSS to keep things lightweight, simple and maintainable.
  • Use relative units like ems and percentages to keep styles as fluid and flexible as possible.
  • Let content determine the breakpoints for media queries
  • Exploit opportunities to reduce HTTP requests by conditionally-loading content and using HTML characters, CSS gradients, Data URIs and more
  • Author unobtrusive javascript and use tools like Modernizr to detect features
  • Take advantage of mobile-centric features like touch events, telephone links and geolocation to deliver enhanced experiences to mobile users.

Creating adaptive experiences allows your content to go more places, which means more opportunities to reach potential customers wherever they may be. By adhering to the principles of progressive enhancement and addressing constraints first, we're laying a future-friendly foundation that gives our site a better chance of working in future browsers and environments.