Do you know Simple Tags plugin in Wordpress ? it will search in your post any words like category name and make it a link to this category .For example ,in your post ,there is a category name "abc" ,Simple Tags will find in your post the word "abc" and make it a link to abc category .
A friend ask me for making something similar to Simple Tags in Blogger . So now I want to introduce Autolink script in Blogger for you .
You can see the demo of this script in SimplexBlognews demo here
you can see in each post ,the word "Morbi" and word "nec" are autolinked to SimplexDesign blog .
Do you interested ?
Here is steps :
1,Open your template in word editor .
2,Add this line before </head>
<script src="http://dinhquanghuy.110mb.com/autotag.js" type="text/javascript"></script>
3,Find this line <b:if cond='data:blog.pageType == "item"'>
and look down ,you will see this code :
<p>
<data:post.body/>
</p>
replace it with
<p>
<div expr:id='"summary" + data:post.id'>
<data:post.body/>
</div>
<script type='text/javascript'>
highlightSearchTerms('nec',true,'http://simplexdesign.blogspot.com','summary<data:post.id/>');
highlightSearchTerms('morbi',true,'http://simplexdesign.blogspot.com','summary<data:post.id/>');
</script>
</p>
take a look at the texts in bold . In this text ,"nec" and "morbi" is the text that script will find to add link , "http://simplexdesign.blogspot.com" is the link .
You can add more anchor text and link with this structure
highlightSearchTerms('text you want to add link',true,'link','summary<data:post.id/>');
The script will find "text you want to add link" in your post and place a link "link" on this text .
This script is not as good as SimpleTags because SimpleTags using PHP and server resource for finding text and make link .Using this script you have to add text and link manually . But I think it's more flexible for you ,because you can use this script for advertising like Textlinkads ,search the text and link to advertiser .
I hope this script helpful to you . Feel free to comment here
Autolink for Blogger
By nhamngahanh
|
posted: 21:21
|
0
comments
0 comments:
Post a Comment