31 Okt 2011

Home » » Cara Membatasi Halaman Label

Cara Membatasi Halaman Label

Banjarbaru


Label dalam blog adalah sesuatu hal yang wajib. Label bisa juga diartikan sebagai pengkategorian posting. Tujuannya untuk memudahkan pengunjung mencari artikel yang berhubungan. Maka dari itu jangan lupa memberi label sesuai dengan materi posting. Nah label bisa ditaruh di sidebar atau sebagai menu.

Cuma sayangnya ketika label di klik, pastinya halaman akan memuat semua postingan dalam label tersebut. Kalau jumlah posting dalam satu label tersebut banyak tentunya akan membuat loading blog jadi berat. Agar halaman bisa menampilkan posting dengan jumlah tertentu maka kita perlu sedikit menambahkan kode pembatas seperti dibawah ini :

+ "?max-results=5"

Angka 5 adalah banyaknya posting yang muncul pada halaman ketika label di klik. Anda bisa merubahnya sesuai dengan selera.

Bagi Anda yang sudah memasang label pada widget sidebar dalam bentuk list atau  berikut cara menambahkan kode pembatasnya :
1. Masuk ke Akun Blogger Anda
2. Klik Ranncangan / Design > Edit HTML
3. Klik Download Template Lengkap terlebih dahulu untuk antisipasi jika terjadi eror
4. Centang Expand Template Widget
5. Cari kode seperti dibawah ini ( gunakan Ctrl + F atau tekan F3 untuk memudahkan pencarian )

<ul>
      <b:loop values='data:labels' var='label'>
        <li>
          <b:if cond='data:blog.url == data:label.url'>
            <span expr:dir='data:blog.languageDirection'><data:label.name/></span>
          <b:else/>
            <a expr:dir='data:blog.languageDirection' expr:href='data:label.url'><data:label.name/></a>
          </b:if>
          <b:if cond='data:showFreqNumbers'>
            <span dir='ltr'>(<data:label.count/>)</span>
          </b:if>
        </li>
      </b:loop>
      </ul>

6. Tambahkan kode pembatas + &quot;?max-results=5&quot;
7. Sehingga hasilnya akan seperti di bawah ini

<ul>
      <b:loop values='data:labels' var='label'>
        <li>
          <b:if cond='data:blog.url == data:label.url'>
            <span expr:dir='data:blog.languageDirection'><data:label.name/></span>
          <b:else/>
            <a expr:dir='data:blog.languageDirection' expr:href='data:label.url + &quot;?max-results=5&quot;'><data:label.name/></a>
          </b:if>
          <b:if cond='data:showFreqNumbers'>
            <span dir='ltr'>(<data:label.count/>)</span>
          </b:if>
        </li>
      </b:loop>
      </ul>

Untuk yang menggunakan label dalam bentuk cloud silakan cari kode berikut, letaknya dibawah kode label list :

<b:loop values='data:labels' var='label'>
        <span expr:class='&quot;label-size label-size-&quot; + data:label.cssSize'>
          <b:if cond='data:blog.url == data:label.url'>
            <span expr:dir='data:blog.languageDirection'><data:label.name/></span>
          <b:else/>
            <a expr:dir='data:blog.languageDirection' expr:href='data:label.url'><data:label.name/></a>
          </b:if>
          <b:if cond='data:showFreqNumbers'>
            <span class='label-count' dir='ltr'>(<data:label.count/>)</span>
          </b:if>
        </span>
      </b:loop>

Tambahkan kode pembatas + &quot;?max-results=5&quot;
Maka hasilnya akan tampak seperti di bawah ini.

<b:loop values='data:labels' var='label'>
        <span expr:class='&quot;label-size label-size-&quot; + data:label.cssSize'>
          <b:if cond='data:blog.url == data:label.url'>
            <span expr:dir='data:blog.languageDirection'><data:label.name/></span>
          <b:else/>
            <a expr:dir='data:blog.languageDirection' expr:href='data:label.url + &quot;?max-results=5&quot;'><data:label.name/></a>
          </b:if>
          <b:if cond='data:showFreqNumbers'>
            <span class='label-count' dir='ltr'>(<data:label.count/>)</span>
          </b:if>
        </span>
      </b:loop>

Cara diatas untuk label yang dipasang di widget sidebar blog, baik label dalan bentuk list maupun cloud. Untuk label di menu navigasi breadcrumbs dan post footer line jika di klik masih akan menampilkan semua poting. Anda juga bisa membatasi banyaknya posting yang muncul pada kedua link label tersebut. Caranya sama dengan diatas, cari kode seperti dibawah ini :

<div id='breadcrumbs'>
Browse: <a expr:href='data:blog.homepageUrl'>Home</a> &gt; <b:if cond='data:post.labels'><b:loop values='data:post.labels' var='label'>
<a expr:href='data:label.url' rel='tag'><data:label.name/></a><b:if cond='data:label.isLast != &quot;true&quot;'> &gt; </b:if>
</b:loop>
</b:if> &gt; <a expr:href='data:post.link'><data:post.title/></a>
</div>

Tambahkan kode pembatasnya, maka hasilnya seperti di bawah ini.

<div id='breadcrumbs'>
Browse: <a expr:href='data:blog.homepageUrl'>Home</a> &gt; <b:if cond='data:post.labels'><b:loop values='data:post.labels' var='label'>
<a expr:href='data:label.url + &quot;?max-results=5&quot;' rel='tag'><data:label.name/></a><b:if cond='data:label.isLast != &quot;true&quot;'> &gt; </b:if>
</b:loop>
</b:if> &gt; <a expr:href='data:post.link'><data:post.title/></a>
</div>

Cari kode seperti ini di bawah ini atau yang mirip dengan kode tersebut, yaitu kode untuk label pada post footer line.
<div class='post-footer-line post-footer-line-2'><span class='post-labels'>
        <b:if cond='data:post.labels'>
          <data:postLabelsLabel/>
          <b:loop values='data:post.labels' var='label'>
            <a expr:href='data:label.url' rel='tag'><data:label.name/></a><b:if cond='data:label.isLast != &quot;true&quot;'>,</b:if>
          </b:loop>
        </b:if>
      </span> </div>


Kemudian tambahkan kode pembatasnya, maka jadinya akan seperti di bawah ini.
<div class='post-footer-line post-footer-line-2'><span class='post-labels'>
        <b:if cond='data:post.labels'>
          <data:postLabelsLabel/>
          <b:loop values='data:post.labels' var='label'>
           <a expr:href='data:label.url + &quot;?max-results=5&quot;' rel='tag'><data:label.name/></a>
<b:if cond='data:label.isLast != &quot;true&quot;'>,</b:if>
          </b:loop>
        </b:if>
      </span> </div>

Klik tombol SIMPAN TEMPLATE.

Selesai

20 komentar

cara seperti ini kok gagal yah gan?
ada solusi lain?

What's up, I desire to subscribe for this blog to take most up-to-date updates, therefore where can i do it please help out.

Take a look at my web site ... wiki.ilcapoluogo.com
Here is my weblog ...

Ӏ dο nοt еvеn know how
I еnԁеd up herе, but I thought this рost ωas great.

Ι don't know who you are but definitely you're going to a
famous blogger if уou aren't already ;) Cheers!

my web site pikavippis.net
Here is my weblog :

I rarely write гemarks, but i did a feω ѕearсhing and wound up herе "Cara Membatasi Halaman Label".
And I аctually do haνe somе quеstions for you if it's allright. Is it only me or does it look like a few of these comments look like they are left by brain dead people? :-P And, if you are posting at other social sites, I would like to keep up with everything new you have to post. Would you list of the complete urls of your shared sites like your Facebook page, twitter feed, or linkedin profile?

My blog - galaxynote2.Fr
My website :

Rіght heге is the right webѕite for anybody who would like tο fіnd out about thіs topic.
You rеalize a whole lot its almost hard to argue with you (not that I ρerѕonаlly ωill neеd
tо…HaHа). You dеfinitely put a freѕh spin on
a subjеct which hаѕ been disсuѕsed for manу уеаrs.

Greаt ѕtuff, just exсellent!



Аlso visіt my homepage: galaxy s3
Also see my webpage -

maaf, baru aktif, beberapa bulan memang gak aktif, lagi sibuk...

My dеvеloper is trying to persuadе me tο mοvе to .
net from PHΡ. I have always dislikеd the idea becаuѕе
оf the cοstѕ. Вut he's tryiong none the less. I've been uѕing Movable-type on ѕеverаl wеbsites fοr аbout a year аnd am worrieԁ about switching to anοther platform.
I haѵe heard verу gоod
things about blogеngine.net. Iѕ there a way I сan transfer all my woгdpress content іnto іt?
Any hеlp would bе really aρpreciated!


Мy website: vapornine
My weblog : broker forex

Τouсhe. Οutѕtandіng argumentѕ.
Κeеp up the greаt ѕρіrit.
Also see my website > get-plus-followers.com

Tergantung template berbeda ada sedikit editan yg harus dicoba, entah peletakan kodenya

I would like to thank you for the efforts you've put in penning this blog. I am hoping to view the same high-grade content from you in the future as well. In fact, your creative writing abilities has motivated me to get my own, personal blog now ;)

my website aaa fx
my webpage: aaa fx

After going over a number of the blog articles on your site,
I truly like your way of blogging. I book marked
it to my bookmark webpage list and will be checking back soon.

Take a look at my web site as well and let me know what you think.


my blog; optionfair

May I just say what a comfort to uncover someone who truly
understands what they're talking about on the internet. You actually understand how to bring a problem to light and make it important. More and more people really need to check this out and understand this side of the story. I was surprised you are not more popular since you most certainly possess the gift.

Also visit my site: trading in opzioni binarie

Hi! Would you mind if I share your blog with my zynga group?
There's a lot of people that I think would really appreciate your content. Please let me know. Many thanks

Review my website; ava fx
My page :: ava fx

Very nice article. I certainly appreciate this website. Continue the good work!


My web blog ... http://www.greenpeppersoftware.com

I was suggested this web site by my cousin. I'm not sure whether this post is written by him as no one else know such detailed about my trouble. You are wonderful! Thanks!

Here is my web-site: promote tweet

Hello, I enjoy reading all of your post. I like
to write a little comment to support you.

Review my web blog - jkaluski.homeserver.com

Hi to every one, for the reason that I am truly keen of reading this web site's post to be updated daily. It includes nice material.

Also visit my web-site - get followers

We are a gaggle of volunteers and opening a brand new scheme in our community.
Your web site offered us with useful information to work on.
You've performed a formidable activity and our whole community will probably be thankful to you.

My blog post :: publicize

You're so cool! I do not believe I have read something like this before. So wonderful to find someone with unique thoughts on this subject. Seriously.. many thanks for starting this up. This site is one thing that is needed on the internet, someone with some originality!

Here is my blog http://your-task.com/11510-you-need-us-to-write-a-500-word-optimised-article-on-your-nichesubject.html
Also see my web site - your-task.com

Silakan komentar:
- Bila susah boleh pakai anonymous, bila salah bisa dihapus kemudian ulang komentar lagi,
- Dilarang komentar Promosi
Terima kasih kunjungannya.