شرح تركيب كود خاص بفهرس مواضيع مدونة بلوجر
بسم الله والصلاة والسلام على رسول الله ، أعزائي متتبعي الموقع المحترف في كل مكان.. وبعد،،،
سأشرح في هذا الموضوع طريقة سهلة ورائعة لإضافة فهرس خاص بمواضيع بلوجر بتنسيق متميز ورائع، فإنه من المهم وجود صفحة في الموقع يوجد بها كل روابط الموقع.
هذه الصفحة أو فهرس الموقع تمكن الزائر من تصفح الموقع بشكل سلس واختيار المواضيع التي يقرأها بكل حرية وبطريقة خفيفة للتنقل بين الصفحات.
يتم عمل فهرس الموقع كما قلت بكل سهولة ويسر من خلال إضافة الكود الخاص بالفهرس في أحد الصفحات المخصصة لذلك في بلوجر.
خطوات انشاء فهرس مواضيع بلوجر
- قم بتسجيل الدخول إلى حسابك في بلوجر
- إذهب إلى "الصفحات".
- اضغط زر "صفحة جديدة".
- قم بتغيير "وضع الإنشاء" إلى "عرض Html".
- قم بنسخ الكود التالي ووضعه داخل الصفحة الخاص بك.
- اضغط "نشر الصفحة"
- ثم ضع رابط صفحة الفهرس داخل القائمة الخاصة بموقعك أو في منطقة الفوتر.
<div dir="rtl" style="text-align: right;" trbidi="on"><div id="bp_toc">انتظر قليلا<a></a>....</div><script type="text/javascript">// ---------------------------------------------------// BLOGTOC// ---------------------------------------------------// BlogToc creates a clickable Table Of Contents for// Blogger Blogs.// It uses the JSON post feed, and create a ToC of it.// The ToC can be sorted by title or by date, both// ascending and descending, and can be filtered by// label.// ---------------------------------------------------// Author: Beautiful Beta// Url: http://beautifulbeta.blogspot.com// Version: 2// Date: 2007-04-12// ---------------------------------------------------// Modified by Aneesh// www.bloggerplugins.org// Date : 02-08-2011// global arraysvar postTitle = new Array(); // array of posttitlesvar postUrl = new Array(); // array of posturlsvar postDate = new Array(); // array of post publish datesvar postSum = new Array(); // array of post summariesvar postLabels = new Array(); // array of post labels// global variablesvar sortBy = "datenewest"; // default value for sorting ToCvar tocLoaded = false; // true if feed is read and ToC can be displayedvar numChars = 250; // number of characters in post summaryvar postFilter = ''; // default filter valuevar tocdiv = document.getElementById("bp_toc"); //the toc containervar totalEntires =0; //Entries grabbed till nowvar totalPosts =0; //Total number of posts in the blog.// main callback functionfunction loadtoc(json) {function getPostData() {// this functions reads all postdata from the json-feed and stores it in arraysif ("entry" in json.feed) {var numEntries = json.feed.entry.length;totalEntires = totalEntires + numEntries;totalPosts=json.feed.openSearch$totalResults.$tif(totalPosts>totalEntires){var nextjsoncall = document.createElement('script');nextjsoncall.type = 'text/javascript';startindex=totalEntires+1;nextjsoncall.setAttribute("src", "/feeds/posts/summary?start-index=" + startindex + "&max-results=500&alt=json-in-script&callback=loadtoc");tocdiv.appendChild(nextjsoncall);}// main loop gets all the entries from the feedfor (var i = 0; i < numEntries; i++) {// get the entry from the feedvar entry = json.feed.entry[i];// get the posttitle from the entryvar posttitle = entry.title.$t;// get the post date from the entryvar postdate = entry.published.$t.substring(0,10);// get the post url from the entryvar posturl;for (var k = 0; k < entry.link.length; k++) {if (entry.link[k].rel == 'alternate') {posturl = entry.link[k].href;break;}}// get the post contents from the entry// strip all html-characters, and reduce it to a summaryif ("content" in entry) {var postcontent = entry.content.$t;}elseif ("summary" in entry) {var postcontent = entry.summary.$t;}else var postcontent = "";// strip off all html-tagsvar re = /<\S[^>]*>/g;postcontent = postcontent.replace(re, "");// reduce postcontent to numchar characters, and then cut it off at the last whole wordif (postcontent.length > numChars) {postcontent = postcontent.substring(0,numChars);var quoteEnd = postcontent.lastIndexOf(" ");postcontent = postcontent.substring(0,quoteEnd) + '...';}// get the post labels from the entryvar pll = '';if ("category" in entry) {for (var k = 0; k < entry.category.length; k++) {pll += '<a href="javascript:filterPosts(\'' + entry.category[k].term + '\');" title="Click here to select all posts with label \'' + entry.category[k].term + '\'">' + entry.category[k].term + '</a>, ';}var l = pll.lastIndexOf(',');if (l != -1) { pll = pll.substring(0,l); }}// add the post data to the arrayspostTitle.push(posttitle);postDate.push(postdate);postUrl.push(posturl);postSum.push(postcontent);postLabels.push(pll);}}if(totalEntires==totalPosts) {tocLoaded=true;showToc();}} // end of getPostData// start of showtoc function body// get the number of entries that are in the feed// numEntries = json.feed.entry.length;// get the postdata from the feedgetPostData();// sort the arrayssortPosts(sortBy);tocLoaded = true;}// filter and sort functionsfunction filterPosts(filter) {// This function changes the filter// and displays the filtered list of posts// document.getElementById("bp_toc").scrollTop = document.getElementById("bp_toc").offsetTop;;postFilter = filter;displayToc(postFilter);} // end filterPostsfunction allPosts() {// This function resets the filter// and displays all postspostFilter = '';displayToc(postFilter);} // end allPostsfunction sortPosts(sortBy) {// This function is a simple bubble-sort routine// that sorts the postsfunction swapPosts(x,y) {// Swaps 2 ToC-entries by swapping all array-elementsvar temp = postTitle[x];postTitle[x] = postTitle[y];postTitle[y] = temp;var temp = postDate[x];postDate[x] = postDate[y];postDate[y] = temp;var temp = postUrl[x];postUrl[x] = postUrl[y];postUrl[y] = temp;var temp = postSum[x];postSum[x] = postSum[y];postSum[y] = temp;var temp = postLabels[x];postLabels[x] = postLabels[y];postLabels[y] = temp;} // end swapPostsfor (var i=0; i < postTitle.length-1; i++) {for (var j=i+1; j<postTitle.length; j++) {if (sortBy == "titleasc") { if (postTitle[i] > postTitle[j]) { swapPosts(i,j); } }if (sortBy == "titledesc") { if (postTitle[i] < postTitle[j]) { swapPosts(i,j); } }if (sortBy == "dateoldest") { if (postDate[i] > postDate[j]) { swapPosts(i,j); } }if (sortBy == "datenewest") { if (postDate[i] < postDate[j]) { swapPosts(i,j); } }}}} // end sortPosts// displaying the tocfunction displayToc(filter) {// this function creates a three-column table and adds it to the screenvar numDisplayed = 0;var tocTable = '';var tocHead1 = 'عنوان المقال';var tocTool1 = 'Click to sort by title';var tocHead2 = 'تاريخ النشر';var tocTool2 = 'Click to sort by date';var tocHead3 = 'القسم';var tocTool3 = '';if (sortBy == "titleasc") {tocTool1 += ' (descending)';tocTool2 += ' (newest first)';}if (sortBy == "titledesc") {tocTool1 += ' (ascending)';tocTool2 += ' (newest first)';}if (sortBy == "dateoldest") {tocTool1 += ' (ascending)';tocTool2 += ' (newest first)';}if (sortBy == "datenewest") {tocTool1 += ' (ascending)';tocTool2 += ' (oldest first)';}if (postFilter != '') {tocTool3 = 'Click to show all posts';}tocTable += '<table>';tocTable += '<tr>';tocTable += '<td class="toc-header-col1">';tocTable += '<a href="javascript:toggleTitleSort();" title="' + tocTool1 + '">' + tocHead1 + '</a>';tocTable += '</td>';tocTable += '<td class="toc-header-col2">';tocTable += '<a href="javascript:toggleDateSort();" title="' + tocTool2 + '">' + tocHead2 + '</a>';tocTable += '</td>';tocTable += '<td class="toc-header-col3">';tocTable += '<a href="javascript:allPosts();" title="' + tocTool3 + '">' + tocHead3 + '</a>';tocTable += '</td>';tocTable += '</tr>';for (var i = 0; i < postTitle.length; i++) {if (filter == '') {tocTable += '<tr><td class="toc-entry-col1"><a href="' + postUrl[i] + '" title="' + postSum[i] + '">' + postTitle[i] + '</a></td><td class="toc-entry-col2">' + postDate[i] + '</td><td class="toc-entry-col3">' + postLabels[i] + '</td></tr>';numDisplayed++;} else {z = postLabels[i].lastIndexOf(filter);if ( z!= -1) {tocTable += '<tr><td class="toc-entry-col1"><a href="' + postUrl[i] + '" title="' + postSum[i] + '">' + postTitle[i] + '</a></td><td class="toc-entry-col2">' + postDate[i] + '</td><td class="toc-entry-col3">' + postLabels[i] + '</td></tr>';numDisplayed++;}}}tocTable += '</table>';if (numDisplayed == postTitle.length) {var tocNote = '<span class="toc-note">Displaying all ' + postTitle.length + ' posts<br/></span>'; }else {var tocNote = '<span class="toc-note">Displaying ' + numDisplayed + ' posts labeled \'';tocNote += postFilter + '\' of '+ postTitle.length + ' posts total<br/></span>';}tocdiv.innerHTML = tocNote + tocTable;} // end of displayTocfunction toggleTitleSort() {if (sortBy == "titleasc") { sortBy = "titledesc"; }else { sortBy = "titleasc"; }sortPosts(sortBy);displayToc(postFilter);} // end toggleTitleSortfunction toggleDateSort() {if (sortBy == "datenewest") { sortBy = "dateoldest"; }else { sortBy = "datenewest"; }sortPosts(sortBy);displayToc(postFilter);} // end toggleTitleSortfunction showToc() {if (tocLoaded) {displayToc(postFilter);var toclink = document.getElementById("toclink");}else { alert("Just wait... TOC is loading"); }}function hideToc() {var tocdiv = document.getElementById("toc");tocdiv.innerHTML = '';var toclink = document.getElementById("toclink");toclink.innerHTML = '<a href="#" onclick="scroll(0,0); showToc(); Effect.toggle('+"'toc-result','blind');"+'">» Show Table of Contents</a> <img src="http://chenkaie.blog.googlepages.com/new_1.gif"/>';}</script> <script src="/feeds/posts/summary?alt=json-in-script&max-results=9999&callback=loadtoc" type="text/javascript"></script></div>
إلى هنا أصدقائي الأعزاء نكون قد وصلنا لنهاية هذا الدرس الخاص بإنشاء فهرس احترافي يحتوى كل مواضيع مدونة بلوجر بكل سهولة ويسر.
في أمان الله
#tags
- إضافة صفحة فهرس مدونة بلوجر سريعة وبسيطة بمظهر انيق وجذاب
- طريقة عمل فهرس المواضيع لمدونات بلوجر
- اضافة فهرس بلوجر الأكثر تطورًا - Blogger index
- طريقة اضافه صفحة فهرس الموضوعات لمدونة بلوجر بشكل جديد
- كيفية فهرسة مواضيع المدونة
- إنشاء صفحة الفهرس لمدونة بلوجر بطريقة صحيحة وشكل منسق
لا تنسى أنك قرأت هذا الموضوع
★♥☆ طريقة اضافة فهرس لمواضيع بلوجر بخصائص جمالية وتنسيق احترافي متميز ☆♥★
فقط في الموقع المحترف
نبذة عن الموقع المحترف
موقعنا يعمل على تقديم كل ما هو هادف ومفيد لأصدقائنا المتابعين في كل مكان .
يتنوع محتوى الموقع ما بين المواضيع الخاصة بصناع المحتوى سواء مستخدمي منصة بلوجر المقدمة من جوجل .
أو منصة الوردبريس الغنية عن التعريف كما نقدم في موقعنا موضوع يهم الناشرين في كل مكان ألا وهو الربح من الإنترنت وكسب الأموال الكثيرة عبر التدوين والنشر الإلكتروني، وهو ما سنحاول تغطيته بقدر الإمكان وطوال الوقت .
موضوع آخر نهتم به في موقعنا وهو الإهتمام بمستجدات عالم التقنية، فستجد صديقي القاريء العديد من المقالات في هذا الخصوص وتغطية جيدة لتطبيقات الأندرويد وجديد برامج الويندوز .
لدينا قسم المنوعات وفيه ستجد عزيزي المتابع، العديد من المقالات المتنوعة والتي تهم متابعينا في كل مكان
تعليقات
إرسال تعليق