Peek-A-Boo Posts from Labels (from my inbox)
I feel a little guilty trying to take you up on an offer of help you made so long ago, but it seems like Ramani has not answered questions about this in a while and I thought perhaps you would have a sense of what's going on. I really would like to get this hack operational on my blog, but I cannot make it work. I keep getting a message about b:includable elements not being permitted in widget 1. I've checked and rechecked and re-re-checked that I'm putting everything in the correct place. Any other thoughts about what might be wrong here?
Thanks very much,
Emilie
Emilie, I think Ramani probably is busy with his new baby. If I remember right, they had a baby not long ago. So, I took a look at Ramani's post and tried it in a practice blog. I got the same message as you. I played with it a bit and was able to make it work. With only one change. I will outline the steps here.
Open your Dashboard | Template | Edit HTML | and check Expand Widget Templates. After the <head> tag place the following code:
<script type='text/javascript'>That was the change I made from Ramani's code. I don't understand it so much, but it works. The rest is the same. You can read the rest on Hackosphere or expand this post for the second part of the instructions.
function toggleIt(id) {
post = document.getElementById(id);
if (post.style.display != 'none') {
post.style.display = 'none';
} else {
post.style.display = '';
}
}
</script>
<b:includable id='PeekABooPost' var='post'>
<div class='post uncustomized-post-template'>
<table><tr>
<td width='40px'>
<a href='javascript:void(0)' title='Expand/collapse this post' style='text-decoration:none' expr:onclick='"javascript:toggleIt(\"" + data:post.id + "\");"'>[+/-]</a>
</td>
<td>
<h3 class='post-title'><a expr:href='data:post.url'><data:post.title/></a></h3>
</td>
</tr></table>
<div class='post-body' expr:id='data:post.id' style='display:none'>
<p><data:post.body/></p>
<div style='clear: both;'/> <!-- clear for photos floats -->
</div>
</div>
</b:includable>
<b:includable id='main' var='top'>
<!-- posts -->
<div id='blog-posts'>
<b:loop values='data:posts' var='post'>
<b:if cond='data:post.dateHeader'>
<h2 class='date-header'><data:post.dateHeader/></h2>
</b:if>
<b:if cond='data:blog.homepageUrl != data:blog.url'>
<b:if cond='data:blog.pageType != "item"'>
<b:include data='post' name='PeekABooPost'/>
<b:else/>
<b:include data='post' name='post'/>
</b:if>
<b:else/>
<b:include data='post' name='post'/>
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<b:if cond='data:post.allowComments'>
<b:include data='post' name='comments'/>
</b:if>
</b:if>
</b:loop>
</div>
15 Comments:
Thank you so much for looking at this, Annie. It's very kind of you.
I gave this a try, ok, a couple tries, adding in your additional script beneath the header and I'm still getting the following message:
"The widget with id "Blog1" cannot contain element: "script". A widget can only contain b:includable elements."
I notice that I have some extra lines of code in my template that are not accounted for in Ramani's and thought they might be the problem. They appear to be adsense related, but I have not intentionally installed any adsense stuff on my blog. I can't think of why it would be there, so I tried to remove it, but I'm just not skilled enough to manage too much manipulate with this. I thought I had it, but my efforts made all the content on my blog disappear. Whoops.
Do you think these extra lines might be throwing the whole thing off?
I was doing so well muddling through implementing hacks, but this one has thrown me for a loop!
Annie,
Thanks for filling in for me. Yes, I am busy with work and this little brat. It's been a month or more since I wrote anything :(
Emilie, if you send me your template through email, I can try to fix it for you.
@emilie, Ramani has kindly offered to take a look at your template. I would take him up on it. He is a master with hacking blogger beta.
I don't understand why it didn't work for you. Hacking a template can be very tricky. Everything has to be just so or else it could send the whole template in a tail spin. The only thing I can say is very carefully go through the steps from the start. If you still can't get it, send the template to Ramani.
@ramani, thanks for stepping in! How is that baby? Enjoy your children while you can. They are precious.
I tried the code on your post and got the same error message that Emilie did. What I did was remove the script from the widget and put it under the head tag. Then it worked for me. But, Emilie is still having problems. Hope you can fix it.
BTW, love your new blog look!!
test post for comments
another test comment
testy testy
sigh...another test
and again...
Why do you do all those comment tests ?
I'm trying to get a comment feed for my sidebar. And since I want it for this blog, I'm testing it here. I think I have it up and running. I will do a post in the near future about it.
Next I'm wanting to get a 'per post' comment feed. I'm compulsive.
I'd like to help you but I don't know how to do that ! Sorry.
Anyway, I think a "per-post comment feed" is not a really need for a blog.
You rocks...! Thank you very much.. you have no idea how this mean to me. I look for this hack everywhere. Thank again...
Too many tests hehe, but nice share, thanks Annie.
Thanks For Sharing. I Will Try.