Jun 9, 2006
There is not as much link field use as it should be by Blogger users, but some of us have been using it for category, tagging or label related features.

So if you like to use the link field for your external linking and also would like to try one of the user made categories for Blogger, now you can have both features in your blog at the same time.

So, lets check this out!.

By now you must have the link field activated by the setting in your blog, there you will put two kinds of info. a external link, and/or the category name the post is going be filed in. you must separate them by commas like this:

http://link.com, category-one,.


Everything else will be sorted out by the script, as usual the implementation requires you going to your template and pasting code into it. the code is here:

the this part of the codes goes inside the <head> tags in your template

<script>

function extlink_tags(text, job, title){
text=text.replace(/\s/ig, "");
var part = text.split(',');
var tags = new Array();
var output="";

if(job=='title'){

for(var i=0;i<part.length;i++){
if(part[i].match('http')) {output='<a href=\"'+part[i]+'\">'+title+'<\/a>'; break;}
else {output=title; break;}
}
return document.write(output);
}
else{
for(var i=0;i<part.length;i++){
if(!part[i].match('http')){
output+="<a onclick=\"javascript:tags_s(\'"+part[i]+"\');\" title=\"View posts filed under "+part[i]+"\">"+part[i]+"<\/a> ";
}
}

return document.write('Posted Under: '+output);
}

}

</script>

There is another extension to it, if you are already using The ABC Index
the script will generate links every time you put a category name.

Here is the code for where you want your post title to show:

<BlogItemTitle>
<script>var link<$BlogItemNumber$>="";</script>

<BlogItemURL><script>var link<$BlogItemNumber$>='<$BlogItemURL$>';</script></BlogItemURL>

<script>
if(link<$BlogItemNumber$>=="") document.write(" <script>$BlogItemTitle$>");
else extlink_tags(link<$BlogItemNumber$>, 'title', "<$BlogItemTitle$>");
</script>
</BlogItemTitle>

It is also posible to put this code in div tags to put your own personal adjustments in anyway you want (Css, Classes, Etc)

After placing this script you must go into your dashboard and edit your links in the link field.

And to end this implementation you only need to put in this code for where you want your be linked in:

<BlogItemURL><div class="categ"><script>extlink_tags(link<$BlogItemNumber$>, 'tags', 'tags');</script></div></BlogItemURL>


It is a little extensive but more than worht to have. i hope you like it.


All thanks to Aditya, that you can find the original post for this in here:

Hybrid Link Field

*Updated at 15/06/06 with implentation code



5 comments:

Aditya said...

The script as of now returns the values as links, but I'd be happy to modify it to return an array of the categories specified!

I'm guessing the majority will use it as it is, so I won't change it in the main page!

Manas said...

Open firefox,click on the RSS Icon that appears in the Address Bar,it gives me two options,to add the feed as Atom or Live BookMark.

But,the second option adds another sites feed whose URL is,
http://bloggerato.blogspot.com.

Please correct it.

Avatar said...

Oh my god, thanks for the correction Manas. quite a big mistake.

will be corrected inmediately

Aditya said...

I remember bumping into that site once, and I left a design suggestion comment there. You can still find it in the 'how is blockquote looking' or something, post...! XD

Avatar said...

well i corrected it.

Post a Comment

Welcome To Bloggeratto. In here you can post any kind of comment you want. Seriously, Go ahead.

Lijit Ad Wijit

Categories

Followers

Web Statistics