How to Make Dropdown - Scroll Down Related Posts in Blogger

Friday, March 23, 20121comments

Blogger မွာ Related Post လုပ္ခ်င္ေသာသူမ်ားအတြက္ေပ့ါေနာ္။ အရင္ကလဲ ဒီRelated Post
ကိုေရးခဲ့ျပီးသားျဖစ္ပါတယ္။ သို႔ေသာ္ အဲဒီကုဒ္နဲ႔အဆင္မေျပေသာေသာပုဂၢိဳလ္မ်ားအတြက္ ဒီတစ္နည္းနဲ႔ထပ္
ျဖည့္လိုက္တာပါ။ တင္ပလိတ္ရဲ႕သေဘာက ဒီဇိုင္းခ်င္းထိုင္တာမတူၾကေတာ့ HTML ကိုမတီးေခါက္ေသးသူမ်ား
အတြက္ အနည္း ငယ္ခက္ခဲႏိုင္ပါ တယ္။ ဘယ္လိုပင္ျဖစ္ေစကာမူ သူ႔ကုဒ္နဲ႔သူအဆင္ေျပေအာင္ကၽြမ္းက်င္တဲ့
ဆရာေတြကိုနည္း ေတြေ၀ငွလွ်က္ပါပဲ။ က်ေနာ္တို႔သာလိုက္ဖတ္ျပီး လက္ေတြ႕စမ္းဖို႔အေရးၾကီးပါတယ္။ စူးစမ္း
ျခင္း၊ ရွာေဖြျခင္း၊ လက္ေတြ႕လုပ္ျခင္းသည္ တကယ့္သုေတသန အစစ္ျဖစ္ပါတယ္။

(၁) Blog ကို Long in> Dashboard> Design> Edit HTML အထိေရာက္ေအာင္သြားလိုက္ပါ။ ျပီးေတာ့ ေအာက္ပါကုဒ္ကိုရွာပါ(Ctrl+f နဲ႔ရွာပါ)။
]]></b:skin>

ေတြ႔ရင္ ေအာက္ပါကုဒ္ ေတြကို copy ယူျပီး ၎]]></b:skin>ရဲ႕ကုဒ္ရဲ႕ အထက္မွာထည့္လိုက္ပါ။

.rbbox{border: 1px solid rgb(192, 192, 192);padding: 5px;

background-color: #f0f0f0;-moz-border-radius:5px; margin:5px;}

.rbbox:hover{background-color: rgb(255, 255, 255);}

ျပီးရင္ Save Template

(၂) expand template ကို အမွန္ျခစ္။ ေအာက္ပါကုဒ္ကိုရွာပါ (Ctrl+f နဲ႔ရွာပါ)။

<data:post.body/>



(ဒီကုဒ္ကို ႏွစ္ခုေတြ႕ရတတ္သည္။ ပမထတစ္ခုရဲ႕ေအာက္မွာထည့္ပါ။ ဒါေပမယ့္ က်ေနာ့္တင္ပလိတ္မွာေတာ့
ဒုတိယတစ္ခုရဲ႕ထည့္ထားသည္)

ေတြ႕ရင္ ေအာက္ပါကုဒ္ေတြကို copy ယူျပီး ၎ကုဒ္ရဲ႕ေအာက္မွာထည့္လုိက္ပါ။

<!-- START Related posts bloggerclick.com-->

<b:if cond='data:blog.pageType == "item"'>

<H2>Artikel Terkait:</H2>

<DIV class='rbbox'>

<DIV style='margin:0; padding:10px;height:200px;overflow:auto;border:1px solid #ccc;'>

<DIV id='albri'/>

<SCRIPT type='text/javascript'>

var homeUrl3 = "<data:blog.homepageUrl/>";

var maxNumberOfPostsPerLabel = 4;

var maxNumberOfLabels = 10;

maxNumberOfPostsPerLabel = 100;

maxNumberOfLabels = 3;

function listEntries10(json) {

var ul = document.createElement('ul');

var maxPosts = (json.feed.entry.length <= maxNumberOfPostsPerLabel) ?

json.feed.entry.length : maxNumberOfPostsPerLabel;

for (var i = 0; i < maxPosts; i++) {

var entry = json.feed.entry[i];

var alturl;

for (var k = 0; k < entry.link.length; k++) {

if (entry.link[k].rel == 'alternate') {

alturl = entry.link[k].href;

break;

}

}

var li = document.createElement('li');

var a = document.createElement('a');

a.href = alturl;

if(a.href!=location.href) {

var txt = document.createTextNode(entry.title.$t);

a.appendChild(txt);

li.appendChild(a);

ul.appendChild(li);

}

}

for (var l = 0; l < json.feed.link.length; l++) {

if (json.feed.link[l].rel == 'alternate') {

var raw = json.feed.link[l].href;

var label = raw.substr(homeUrl3.length+13);

var k;

for (k=0; k<20; k++) label = label.replace("%20", " ");

var txt = document.createTextNode(label);

var h = document.createElement('b');

h.appendChild(txt);

var div1 = document.createElement('div');

div1.appendChild(h);

div1.appendChild(ul);

document.getElementById('albri').appendChild(div1);

}

}

}

function search10(query, label) {

var script = document.createElement('script');

script.setAttribute('src', query + 'feeds/posts/default/-/'

+ label +

'?alt=json-in-script&callback=listEntries10');

script.setAttribute('type', 'text/javascript');

document.documentElement.firstChild.appendChild(script);

}

var labelArray = new Array();

var numLabel = 0;

<b:loop values='data:posts' var='post'>

<b:loop values='data:post.labels' var='label'>

textLabel = "<data:label.name/>";

var test = 0;

for (var i = 0; i < labelArray.length; i++)

if (labelArray[i] == textLabel) test = 1;

if (test == 0) {

labelArray.push(textLabel);

var maxLabels = (labelArray.length <= maxNumberOfLabels) ?

labelArray.length : maxNumberOfLabels;

if (numLabel < maxLabels) {

search10(homeUrl3, textLabel);

numLabel++;

}

}

</b:loop>

</b:loop>

</SCRIPT>

</DIV>

<script type="text/javascript">RelPost();</script>

</DIV>

</b:if>

<!-- END Related posts -->

ျပီးရင္ Save Template

ref : Original Link

ေစာလင္းနက္စ္
Share this article :

+ comments + 1 comments

October 8, 2012 at 6:29 PM

ေစာလင္းနက္ခင္ဗ်ာ..Menu botton လုပ္တာပထမအဆင္ ့ထိရတယ္၊ဒုတိယအဆင္ ့
လုပ္တာမရေတာ ့ဘူး၊ကူပါအံုး။

Post a Comment

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Saw Linux - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger