New Recent Comments Hack On Blogspot
Current comments tin ship away endure showed inwards the sidebar of your Blog using the Feed page component. As a Feed-URL you lot tin ship away furnish "http://yourblogname/feeds/comments/full" to discovery the final iii comments, alongside writer in addition to name. That's the typical functionality, in addition to I genuinely didn't similar it at all. The typical comments-feed has a few possessions missing. The outset few words of the comment are displayed every bit a link afterwards clicking the link brings you lot to the locomote on of the post-item page instead of to the comment itself. That is drive of a põrnikas inwards the link that is offered past times Blogger. Then, I require to run into on what postal service a somebody has commented. The feed doesn't acquaint for the postal service title, but nosotros could obtain it from the link - in addition to that is where this hack boots in.
Here is how you lot perform it.
Step 1: At outset backup of your template.
Step 2: Now add together a measure electrical current comments widget to your Blog.
On the dashboard select your Blog in addition to click Layout. Go to the Template tab in addition to click Page Elements. In your sidebar add together a Feed page element.
Now larn into your comment feed URL inwards the blank infinite in addition to Mark Item dates in addition to Item sources on.
After in addition to thence relieve your template in addition to persuasion your Blog. You instantly pick out a measure recent comments widget.
Step 3: In the caput department of your template, add together to a greater extent than or less JavaScript code.
You tin ship away skip this action.If not, larn to the Template tab, click Edit HTML, in addition to add together the next HTML code to your templates caput section, only higher upwards the </head>-tag-
<script src='http://home.planet.nl/ hansoosting/downloads/beautifulbeta.js' type='text/javascript'/>
Now relieve your template.
Step 4: Restore the widget coding:
Go to the Template tab in addition to click Edit HTML. Look at your sidebar for the novel widget you lot shortly created. It volition await something similar this:
<b:widget id='Feed2' locked='false' title='Recent comments' type='Feed'/>
Now click Enlarge Widget Templates in addition to await for the widget. Use Ctrl-F to discovery it, using its ID
Replace the total widget past times the next code:
<b:widget id='Feed2' locked='false' title='Recent comments' type='Feed'>
<b:includable id='main'>
<h2><data:title/></h2>
<div class='widget-content'>
<ul expr:id='data:widget.instanceId + "_feedItemListDisplay"'>
<b:loop values='data:feedData.items' var='i'>
<li>
<b:if cond='data:showItemDate'>
<b:if cond='data:i.str_published != ""'>
<span class='item-date'>
On <data:i.str_published/>
</span>
</b:if>
</b:if>
<b:if cond='data:showItemAuthor'>
<b:if cond='data:i.author != ""'>
<span class='item-author'>
 - <data:i.author/> commented on
</span>
</b:if>
</b:if>
<script type='text/javascript'>getPostTitle (" ;<data:i.alternate.href/>")</script> :
<span class='item-title'>
<data:i.title/> <script type='text/javascript'>getCommentLink("<data:i.alternate.href/>")</script>
</span>
</li>
</b:loop>
</ul>
<b:include name='quickedit'/>
</div>
</b:includable>
</b:widget>
Now relieve your template.
Your hack is applyed now.
Teach substance.
I started alongside the normal -widget. At outset I tainted the guild of the <data>- basics to date, author, comment- outline. The comment-summary is represented past times <data:i.title/>. In the measure widget, the comment outline is entrenched inwards an anchor that links (or must link) to the comment. The structure looks similar this:
<a expr:href='data:i.alternate.href'><data:i.title/></a>
The link-address of the <data:i.alternate.href/>-field has the next plan: "http://yourblogname.blogspot.com/year/month/posttitle.html#number".
We volition apply this link to parse the posttitle from it, in addition to to recall the right comment-permalink. The right permalink to the comment has the folowing plan:
"http://yourblog.blogspot.com/year/month/posttitle.html#comment-number".
I was creating two jobs. The outset job, getPostTitle, is handed the telephone substitution in addition to writes the postal service championship every bit a hyperlink to the post-item-page to the text. The sec job, getCommentLink, is handed the substitute in addition to erects the accurate permalink in addition to displays it every bit a link.
Comments
Post a Comment
Ask me anything here...