Blogger Categories with Del.icio.us Part Three
This is the last in the series on using del.icio.us for categories with Blogger. If you are here you should have already implemented part one and part two or this won't be much help. This last post will cover cloaking the category post and the archive it is in so it won't be normally visible. I'll also cover some template tweaks for the category post page itself that I implemented that may or may not be useful to others.
If you have the first two methods implemented and you want to add the tweaks in this section, I strongly advise to backup the current working template before trying these. None of this is hard at all, but the formatting is a little funky and very easy to screw up (trust me on that ...I know from exp) and a working copy of what you had before you started with this section could come in handy...just in case.
Ok, first hiding the category
post so it
never shows in the "Recent Posts" lists and the same with it's archive
so it won't show in the "Archive List". Note:this
currently only covers lists NOT in a drop-down menu. If your
recent posts or archive list are in a drop-down I'll have to get back
to you. Not a big deal, I just haven't got around to it yet.
UPDATECode for hiding the category post and archive now available at the post Drop Down Menu For Categories
Now find
in your template where the recent posts list is. It should look
something like this.
<BloggerPreviousItems>
<li><a href="<$BlogItemPermalinkURL$>"><$BlogPreviousItemTitle$></a></li>
</BloggerPreviousItems>
</ul>
// Cloak the Delicious Tag Post
rec = document.getElementById('recently').getElementsByTagName('a');
for(i=0; i < rec.length; i++){
if(rec[i].href == delTagPost){
rec[i].parentNode.style.display = 'none';
}
}
</script>
<BloggerArchives>
<li><a href="<$BlogArchiveURL$>"><$BlogArchiveName$></a></li>
</BloggerArchives>
</ul>
// Cloak the Delicious Archive Post
arc = document.getElementById('archive-list').getElementsByTagName('a');
for(i=0; i < arc.length; i++){
if(arc[i].href == delArchivePost){
arc[i].parentNode.style.display = 'none';
}
}
</script>
These last bits are some more tweaking for the category post itself. May or may not be useful to others, but for my uses there were certain bits on the category post page I didn't want displayed or I wanted to modify.
The first part was the date header on that page, since this page is performing a special function the date isn't really relevant to it and I didn't want it shown here. Here's what I did, I gave the ItemPages only a unique ID that I could manipulate with scripting. This looks a little odd, because it embeds a conditional <ItemPage> tags inside an element, and it's easy to mess up the format so be careful here if you do this. So find the element containing your date, mine looked like this, yours most certainly will be a bit different.
<div class="post-date">
and I added a unique id to it for the ItemPage's only with this snippet of code
<ItemPage>id="delpost-date"</ItemPage>
so it looks like this
<div class="post-date" <ItemPage>id="delpost-date"</ItemPage>>
Again if you go this route, it's easy to get those tags out of whack a bit, since it's very oddly formatted. Myself it was easy to knock off the trailing >, but if you take it slowly you should get it inline. Just copy what's between the ItemPage tags and insert it right before the > in the date's containing element. If you do it and the format of your page falls apart, you know you've screwed it up, checking in the preview should tell you whether everything goes south. When there is an error it's usually VERY noticeable. :-)
I also wanted to do basically the same thing with the post title area (So it will write out the selected category when displaying) and to the post's footer section since it's not really relevant to this post either. If you wanna go that route for the post title you again use the <ItemPage> tags to add an id of delpost-title to the element containing your post-titles. Here's the code
<ItemPage>id="delpost-title"</ItemPage>
And mine ends up looking like this...yours will most likely have different elements or class names. The idea is the same.
<div class="post-title" <ItemPage>id="delpost-title"</ItemPage>>
And for the footer I add an id of delpost-footer
<ItemPage>id="delpost-footer"</ItemPage>
so it comes out like for me, again yours will be slightly different.
<div class="post-footer" <ItemPage>id="delpost-footer"</ItemPage>>
If you get this far now just add this script inside or after the post-footer section.
selURL = unescape(document.location);
selected = selURL.split('?');
if (selected[0] == delTagPost){
document.getElementById('delpost-footer').style.display = 'none';
}
</script>
I think that's about it. I probably should mention some of the limits of del.icio.us. I haven't found a limit to the number of tags (categories) it will display, although I suspect there must be one. I've tested this with accounts that use more than 100 and they all show up, so maybe it's unlimited, maybe not. My advice is to not just shotgun everything into a zillion categories. Adding a post to multiple categories is fine but make it relevant and don't go creating a bunch of niche categories, unless you're really gonna use them.
Additionally,there is a limit to the number of posts that will display in a selected category, and that is 100..this is a limit imposed by del.icio.us , and I suppose it could change if they decide to. It could go up, it could go down. It could stay the same. They're in control of that. So if you fill up a category you can still add to it, but I believe the newest post will show up while the oldest gets kicked out of the list. I suppose if you get that far that maybe you could create another category...like if you filled up Humor go to Humor2 or something. I'm a long way from that so I haven't thought much about it yet.
Anyway if you find a mistake in my instructions (almost certain) or in the scripts I posted ( oh I tried very hard not to miss anything, and tested as much as possible, but it's very likely I have missed something for a certain situation) then lemme know in the comments. If it's something I can fix I'll try to when I can.
Post a Comment
68 comments:
Hi,
Thanks a lot for your nice tutorial, very useful indeed, I tried to implement the three parts of it on my blog and it seems really nice.
Just a few questions:
Now I've got my categories by list but how can I get a nice cloud like yours? Is't possible to get it only with CSS or there is a simpliest way?
Other one: when I use IE6 I can see at the bottom of my post the Quick link edit and the Delicious links. When I use Firefox I don't see them. Did you already notice this difference, or did I miss something?
Many thanks again,
Jean-Marie Le Ray
Thanks for the comments, I think your the first one to try this method besides me. Looks nice.
Now I've got my categories by list but how can I get a nice cloud like yours?
Watch this space..it's not too difficult,especially since you've got everything setup already. I just haven't written out how to do the "Tag Cloud" yet. Probably either tonight or tomorrow I'll have it up.
when I use IE6 I can see at the bottom of my post the Quick link edit and the Delicious links. When I use Firefox I don't see them.
Hmm. Just to cover those, if you see them in IE then they should be setup correctly.
It sounds like you don't see the Quick Edit links in Firefox also, the bit we added works the same as the Quick Edit links. Just to cover the basic, are you Logged into Blogger with Firefox? These only work when you are logged in. Also there are some 'cookie' settings that can keep it from working..firefox would also have to be set to allow third party cookies I believe for the Quick Edit and the new Post to Delicious icons to show up...if you get one you should get the other.
I also noticed another thing on your setup. I may have to tweak somethings for "international" users, I only tested this in English and for some of your categories with the accented and other non-english characters (I don't know if that's the proper terminology)
like sémantique it doesn't seem to be working. I thought I had gotten the correct encoding del.icio.us was using down...apparently I didn't. I'll look into it and post a fix when I find one.
Jean-Marie,
I think I tracked down my obvious mistake that was keeping the categories with the "non-english" characters from working correctly.
In Part One, the very first initial script that you paste into your "category" post has been changed to fix that issue, easiest thing to do is just copy the new one and replace the script in your current category post with the new one and republish. You may have to clear the browsers cache and republish to see the effect.
I actually snagged your delicious username to pull in your feed to test this, so I think it's working now (hopefully). Sorry for the mistake.
I should have been thinking more "International" ..:-D
Ugh, another bad on my part Jean-Marie,
Everything I said about the quick edit/post to delicious icons is correct, those things have to be in order.
BUT from your comments I tracked down another error in my posted code...you should get something for being my "tester"...
The code in Part Two that you paste for the "Post to delicious" link was missing a closing </span> tag , the code is corrected now so either snag it whole from there or you can just add the missing </span> tag to what you have, it goes at the very end of that bit after the closing <script> tag.
It is VERY IMPORTANT to fix that error, it won't cause much of a problem in Firefox but in IE it will cause a large part of the page to be unseen...I think that's one of the reasons that one got by me, I never use Internet Explorer and Firefox will automatically "fix" unclosed tags like that, IE doesn't. Extremely sorry I didn't catch that and sorry for any problems it may have caused.
Hi,
Thanks a lot to fix the problems (It is VERY IMPORTANT to fix that error, it won't cause much of a problem in Firefox but in IE it will cause a large part of the page to be unseen...), that's right, I've already experienced it.
I'm happy to see that my questions turned useful also for you :-)
So if you don't mind I would have another one to ask you. It's just a detail, but as you rightly said, we've got to be "international" !
At the bottom of each post, I'll now have "Category: ..."
Should it be possible to get "catégorie" instead, since my blog is mainly french written ?
If it's too much hassle, just don't mind.
Thanks again,
J-M
Yeah, I can see where that might be useful. :-)
That was one of the spots I thought about making easier to customize, but didn't. Maybe I'll add it in as a variable to make it easier for folks in the future.
As of right now, if you want to modify that bit, I can point you at it.
In part two, the first script in that section that is pasted into the "footer" part of the blog post, about 8 lines down there is a line
cat.innerHTML = 'Category : ';
Everything in the ' ' marks is whats printed out for that heading, you can change that to whatever and it should work. Let me test that real quick just to make sure I'm not overlooking something..again.
Yep, just tried it. That should work.
It works, definitively!
Now, if I may, I would like to ask you a question about delicious. I asked it on a dedicated forum, but till now no one gave me any answer.
If it's possible, I would like to separate my delicious tags in public tags and private tags, where private tags would be all tags of my blog.
For instance, with your how-to, categories are recalled on my delicious account, but if anyone else visits my tags on my accounts, he/she'll see all tags about my posts!
So if I've got one hundred categorized posts, you'll see one hundred delicious tags with the name of my blog!
Do you think it's possible to get a private space for these on delicious ?
Thanks again for your patience!
Jean-Marie
I don't think that is possible right now with Delicious. From what I've read, they are thinking about implementing some sort of "privacy" feature, but when and if it would work in the manner you want I have no idea.
The only thing I can think of for your situation is to have two delicious accounts, one for your blog and one for your personal use, and point the blog categories at your blog delicious account.
Would make it a little more of a hassle, would have to switch between the two accounts when bookmarking at delicious, but that's the only way I know of separating them.
Hello!
thank you very much for wonderful manual and brilliant idea (hack)! I was looking for simmilar information and was pleased to find your blog. Already read your tutorial and implemented scripts (except the "last bits") - it really seems what i was looking for and is great. Meanhwhile i have some problems, probably due to my mistakes while posting or smth i've missed to do... There is constantly active del.icio.us link near "quick edit" what is not very good. I've noticed that after second part it was dissapearing as soon as i've saved tags in del.icio.us, but after 3rd part it looks active as it is now. What can you suggest for me?
my blog is: http://clingenblog.blogspot.com
Best regards,
Ramunas
ramujana,
From what I can tell nothing is wrong, that's what is supposed to be there. You've done everything right.
That Delicious Link only appears to YOU when you are logged into blogger, like the quick edit link.
I can't see it, no one else will either. It's setup just like the Quick Edit link so only you have access to it when needed to post to delicious.
Hi Phydeaux,
Nice trick, it seems to be a good idea. I also asked it to Delicious support, I'll let you know their answer. In the meanwhile I'll think about implementing your solution.
Many thanks,
Jean-Marie
Hi phydeaux,
you're definitely right - i've forgotten to log off from delicious... thanx agian for nice script.
Good luck,
r.
Hi phydeaux,
I have followed all your instructions and I think I have it mostly working. I have two questions:
1. the only thing that isn't working for me is when i click on a category - the page that loads (the one in the archive) doesn't pull up anything (even though there are posts tied to the tags). I am not sure where to troubleshoot.
2. I'd like have everything I post from my blog to have the initial tag "gatheringinlight" (the name of my blog) + theology or whatever. So I can limit the categories on my blog to only the ones used on the blog (and not all the ones I use everywhere else). When I finished following all the instructions here I had a list of about 60 categories or something. I decided for the time being to set up a seperate account for the blog, but I am wondering if there's a way to keep it all together.
3. Also are familiar with a step by step guide to putting the tag cloud in? I've seen your stuff on it, but I need a little more aid in the process.
thanks -- wess
Wess,
1) It seems in setting up the two different accounts with delicious, the username variable is out of sync-this ties into your other question about keeping your personal bookmarks and bookmarks for your blog separate..as with Jean-marie in the comments above I don't know of a way of doing that right now on the same account with delicious.
If you want to keep them separate I think having two different accounts would be the way to do it.
As for your problem, I see two different things looking at your site. On your main page one username shows in the script setup, on the "category" page an invalid different username is in the script setup...so things were changed but not completely republished.
Set in your template in the script setup the username you are using for the blog delicious account..i believe it's gatheringinlight...REPUBLISH the entire blog. You MIGHT have to clear your cache to get the old page out of your browser. I'm pretty sure that will sync things back up so everything is pointing at the same account and it should probably work then.
As for the instructions for the tag cloud, I haven't put that up yet. What I have working on my blog right now works for me, but I've discovered a bit of an issue that may keep it from working for everyone until I track the problem down exactly. Check the front page of the blog, hopefully sometime this week I'll have it nailed down and will post the resolution when I get it.
To add something to my last comments on Wess' and Jean-Marie's desire to have one delicious account but only show the blog related tags with the scripts.
Theoritically that may be possible, delicious has something called tag intersections, whereby you can call up everything that has both tag a + b.
I would probably need to rewrite the script slightly to work with that.
But right now it's impossible to completely sort out. Per the delicious mailing list, they've had hardware issues lately and the bits that make the "tag intersections" work is affected (at least for the feeds they provide) and not functioning correctly. It works somewhat browsing delicious from their website, but is sporadic when dealing with their supplied feeds.
I'll keep my eyes peeled for them getting that functionality to 100%, and when they do I'll look into what exactly I need to modify in the scripts so it can more easily be implemented. Of course all this is theoritical..since I haven't seen it in action yet. :-D
Check back and if/when I can find out if it's really doable with their feeds I'll post an update. The only way I know to reliably keep them separate as of right now is with different accounts. Delicious has moved to new Yahoo! datacenters and have said they are working on the issue, so maybe this will be something that can added to this method soon.
Hi Phydeaux,
Thansks for your work.
Here is the Delicious support answer to my question: "We're working on a private bookmarks feature; it's coming soon."
Keep going on :-)
Jean-Marie
Thank you very much for taking a look at that. Its as you said, and was a very easy fix. When I was working on it last night I remember now that blogger timed out in the middle of republishing and I never went back to do it again. All of your instructions on here were very easy to follow. Thanks again. I'll continue to watch and see what you come up with.
Thanks for this great tutorial.
I have implemented it on my blog.
However I think I don't really apply it 100%. I don't understand CSS, and know very little about html.
Here are my queries:
1. I don't know the last bits, this div class="post-date" and div class="post-footer" I can't find the alike elements on my template.
2. How to change the word 'Categories:' on the categories page?
3. This is from the second part of your tutorial, the additional part.
I don't know where to put this kind of code:
#delicious ul {}
#delicious ul li {}
It's for changing the bullet list isn't it?
I want to delete the bullets on the Categories page (in front of notea and categories link).
Sorry if my words are confusing :)
Thank you
I reposted Origena's comments above, since Blogger seemed to eat them during it's recent outage.
Nice job Origena. Looks great. To try and answer your questions. Please backup your template before trying these last things. It can get a little confusing, and I wouldn't want you to lose what you already have. Best to make a backup at this point.
1)Yes, your template is a bit different from the standard Blogger ones.
I don't think you have to worry about the "post-footer" stuff. Yours is a different layout and don't think you need that.
For the post-date section,In your template where the date is written out yours starts like this.
<small class="metadata">
Then the section holds the date and email link come. You would only add what I have if you want that part to not appear on the category page only. So you would change that to look like
<small class="metadata"
<ItemPage>id="delpost-date"</ItemPage>>
2)Unfortunately I didn't make
that easy enough to change. The first thing is to add the parts for the title, again yours is a bit differnt than my example. Where the post title starts you have <h3>then the post title
You would change that to
<h3
<ItemPage>id="delpost-title"</ItemPage>>
That will make it display the category selected next to the word category:, but to change the word category itself I'm afraid I didn't set that up well. You have to go back to the cateogry post itself and modify the script that is there slightly. So if you got the above, go to edit the category post. Make sure you're in the Edit HTML mode and about 9 lines down you'll probably see
= 'Category: '
what's between the ' ' marks is what it will be rewritten to. You can change it there. Kinda tricky, but if something doesn't work out, you can always get a fresh copy of that script here.
3)Again with your particular setup, it might need a bit of different formatting. Here is what you would put in the CSS section to affect them, and I put in some sample settings so you could see what they affect, you may want to change them to suit.
#del-container ul.delicious-posts {list-style:none;}
#del-container li.delicious-posts {}
#del-container .delTitle {font-size:140%;}
#del-container .delNote {padding:0px 10px}
#del-container .small-del-tags {padding-left:25px;}
You could put these right after the settings for the "cloud". And like I said you can change some of the lines to fit what you want or take them out completely if they are not needed. As is they should make the displayed title a bit larger, give the "notes" you added a bit of padding, and slide the tags for each post over a bit and also get rid of the bullets.
If you run into any problems, or if I made a mistake here, let me know and we will try to sort it out.
Origena
I forgot to add you may want to check if your comments are working on your blog. I tried the other night and they didn't seem to be for me. I know those templates need some Blogger comment settings to be correct to work..ah, found this on the templates site. If they aren't working might be worthwhile to check these things.
The steps are:
1) Make sure your settings permit everybody to comment.
2) Turn off the picture for the commenter's Blogger identity.
3) Turn off verification.
If any of these are omitted, comments will not work on any of the templates in this series.
Don't know if that's it or not, but probably where to start.
BIG thanks Phydeaux3!
I will try to digest your instruction at my best :-)
And yes, my comment system had a problem before. I had not realised it since I used my current template.
You are truly kind, to search the answer for my comment problem.
I hope you don't mind I linked your blog you already before I ask your permission.
Again...BIG thank you!
You are welcome origena. And of course it's ok you linked to me. ;-)
If you run into any problems with the last bits keep asking and we'll eventually sort it out. :-D
Hi there Phydeaux3!
I've been looking for ways to categorize my blog for so long so finding your site was a delight! I've everything you put on this 3-part journal and i think I got everything in but i am having problems with two things:
1. I can't seem to figure out how to take out the date on the category post I did, i am not sure what i did wrong...
2. When i tried on clicking on the del.icio.us tags, the category post comes up but the posts that come in are duplicated by links to the category post...i can't get rid of them.
Hope you can help me please please :)
Hey Anne, nice work.
1) Hmmm. Your question makes me see something in my scripts I hadn't noticed before. Apparently the date hiding fails if the post title isn't setup successfully also. That shouldn't be, I'll have to go in and fix it..but to answer your question we'll have to do two things..one for the post title and one for the date header for the category post. BACKUP your current template before doing this, isn't hard, but it's easy to get something out of place.
Find in your template where the post title setup begins, yours will look something like
<span class="PostTitle">
Add this to it so it looks like
<span class="PostTitle" <ItemPage>id="delpost-title"</ItemPage> >
Similar for the date
Look for the part that starts
<div class="DateHeader">
and add the delpost-date id to it similar to the above, it should end up like
<div class="DateHeader" <ItemPage>id="delpost-date"</ItemPage> >
Once those are setup correct, republish the entire blog, clear the browser cache to make sure you get the new changes, and it should do 2 things, rewrite the title so it shows which 'tag' has been selected and make the date disapper.
2)Second question is much easier. In the script section in the head of your template with your username and page settings there is the line
var delShowTags = true;
Change to
var delShowTags = false;
And it won't bring in the link for which category the post is in. Again save and republish the entire blog for that to take effect.
I think that should cover it if I understood your questions correctly. If any problems lemme know and we'll try to work them out.
Hey Anne, it looks like you solved the first part while I was typing, or you are really really fast. :-D
Hiya! Haha was still trying to sniff through the files while waiting for your answer...got it before you answered, but I didn't figure out the answer to the second question until you pointed out! Super super thanks! One last question, how do i take out the bullets on the category listing??
Ooops saw the answer in one of the questions above! Got it now!
I have got to thank you soo soo much for putting up this tutorial! this is me jumping up and down after finally having my own categories! Thanks soo soo much!!
See, I waited before replying on that one. I figured you would see the answer.
:-D
Nice work on the photoblog..looks great.
LOL! Hahaha! Thanks for dropping by my blog...hey i'll link you ok!
Hey, great tutorial you've got here. I followed it and everything worked!! (I do have a little experience with these things, but never anything this complex.) I've got it on my postcrossing blog now.
Thank you so much!
-Laura :)
Why thanks Laura, glad you found it helpful.
And a nice implementation too. Looks great. A very unique blog you have with a unique subject matter. I like it. Very very cool.
Hey Phydeaux3! Just want to ask if this last script about making the header and footer of the category page will work with other posts? You see i've decided i want to hide my links (since i've got too many!) and put that all to a link page, that my visitors can click if they want to see it...so that my right side bar can be a bit clean...but like the category post i don't want the date and footer to appear? Any tips? I've already set up the post (in my Dec 2005 archives) but have not implemented yet coz i can't figure out how to "hide" the header and footer...you think you can help this confused soul :)
Anne,
Well the scripts are only setup for the category posts, but we may be able to work something out for your situation.
Give me a few days when I have a bit more time to look at it and I'll try to work something up for you. I'll probably reply to the email on your blog, since this is specific to you and posting code in the comments section here I've found to be a pain.Little easier through email. I will be in touch.
¡You did a great job with categories!
Just a little suggest, i think dont' need the page http://phydeaux3.blogspot.com/2001/01/categories.html
With DOM you can replace the main DIV (maybe the id="main-column").
I do somethinh similar, using too delicious and Json, but also a little bit of Ajax.
Saludos!
Mario
Thanks for the comment and suggestion Mario.
And yes I'm aware that you could replace the main column with the category results through the DOM.
Actually that's the way I was doing it when I first started messing with it. And while it certainly has a sort of "gee whiz" factor when doing it that way, I found it distracting for some reason. (Probably due to my lack of skill, I'm sure others could implement it much better). For me..I Like a new separate page loading with the results. Maybe I'm just old-school, but it seems to behave in an "expected" manner when a new page loads, rather than replacing large swaths of text with the dom. Obviously , that's a matter of taste, and there are certainly circumstances where I might change my mind about it. But for now, I prefer it the way it is even though it does require the creation of a somewhat problematic "category" page. Different strokes I suppose..
Thanks for the comments.
Saludos!
Hi! Thanks for the the information on how to put categories in a Blogger blog. I have tried it, worked on it and have most of it working smoothly.
However, some of the last steps are not working out so far.
(NOTE: When I have quoted code in this comment, I substituted [ and ] for < and >, because I couldn't figure out how to type in code without the Blogger comment form rejecting the message.)
Firstly, I do want to hide the date on the "Categories" post (the one which display the list of posts for a selected category). I could not figure out into which element to copy this code: [ItemPage]id="delpost-date"[/ItemPage]. I experimented a little bit, but so far no success.
My template in that area reads:
[div id="mainClm"]
[!-- Blog Posts --]
[Blogger]
[BlogDateHeader]
[h3][$BlogDateHeaderDate$][/h3]
[/BlogDateHeader]
[a name="[$BlogItemNumber$]"][/a]
[BlogItemTitle [ItemPage]id="delpost-title"[/ItemPage]][h2]
[$BlogItemTitle$][/h2][/BlogItemTitle]
[div class="blogPost"]
[$BlogItemBody$][BR]
Secondly, as to the code [ItemPage] id="delpost-title" [/ItemPage]. I am able to see the selected category now. Was this change also supposed to prevent display of the post's original title, "Categories"? If yes, it's not working for me. If no, how could I hide that?
Relatedly, is there a way I can format the new "dynamic" title "Category: {the selected category}" either a) to "automatically" look like all the other post titles or b) format it "manually"?
Thanks again for your work and for sharing this information!
Baba
http://occupationdad.blogspot.com/
aboutblog [ a t ] sbcglobal [ d o t ] net
Hey Baba,
For the date. In your template it would be
<h3 <ItemPage> id="delpost-date"</ItemPage>>
<$BlogDateHeaderDate$> </h3>
For the category heading, what you have is slightly off. In that bit, you have the ItemPage tags INSIDE of the BlogItemTitle tags. It won't work there. It should go inside the h2 tags that surround the Post Title.
That part should look like
<h2 <ItemPage> id="delpost-title"</ItemPage>>
<$BlogItemTitle$></h2>
With that in place, it should be formatted like your other post titles, and the title will get rewritten to say Category:(selected category) . That part isn't easily modified I'm afraid. But it can be if really needed.
Try those out and see if it's closer to what you want. If you still need to modify it further then post back and I'll try to point you in the right direction.
Baba
Just to make clear, in both examples I put previous, you do keep what is before and after the example code in your current template. I just put in the tags directly affected to simplify posting.
When you move the delpost-date stuff to it's new location, make sure you keep the ending > on the BlogItemTitle tag.It's easy to miss that. If you run into any probs, let me know and we'll try to pin it down.
Thank you for responding to my comment so very quickly! It works! The thing that's driving me crazy is that I tried putting the code in the exact location in the [h3] tag, but there was no effect. And I know I "reloaded" the categories post page when I looked at it. Maybe I made small typo' I didn't notice ... or maybe it had something to do the browser (Firefox 1.5.0.1 for Mac) I was using - once in a while it interacts strangely with Blogger. Well, no point in dwelling on it now that it's working. Thanks again so much!!!
Hi, Phydeaux3!
I found your blog via a Google Blogger Help Groups search under "Categories". I too have been looking for ways to use Categories in Blogger.
I have come up with a rather primitive way using a modified "Minima" template by creating posts titled with my Category names and then creating links to them in the sidebar, referencing the post pages as hyperlinks. If you're interested, you can check them out at http:thebloggingblogger.blogspot.com (I'm still building it, so there's no real content there yet).
I like your blog template, and would like to ask you for permission to use it/modify it, assuming, of course, I retain credit to you in the html.
Thanks!
Phydeaux3,
Please disregard the request in my previous post on 02/27/06. I've tweaked Minima some more and am satisfied with it. I will, however, be trying your great (in all ways, especially your tutorials!) codes for categories this weekend - well, here goes...
Jeff
Jeff,
Sorry I didn't respond to your earlier comment, I never got the email notification from Blogger (or I missed it). Your template looks cool.
Thanks for the kind words. Like I said before this method of using delicious won't be for everyone. Works well enough for me. Good luck with it.
Hi Phydeaux,
Thanks a ton for the detailed instructions on how to setup categorised posts!. Came to your blog via maniladailyphoto. I use a testing blog to test out my template changes.. so as not to disrupt the main photoblog.
I was able to follow through your instructions till page 2 but was stumped at page 3 (like many others).. Following are my concerns / requirements.. let me know if you can help me with them.
a) My recent posts and archive lists are in a drop-down menu ;-((
b) I would want the categories list to also be in a drop-down.. I noticed a comment from somebody earlier saying that he had implemented this feature.. but his site also has the more elegant 'category cloud' now
c) I do not want just post summaries to appear on the category page.. rather complete posts (like on the archives page).. Is this possible?
Thanks again for your wonderful tutorial
Hey Rahul,
Glad it was helpful. For your questions.
A & B.. See this post
Drop Down Menu For Categories
I just added it with the code Marcos had whipped up for the dropdown. Even tho he is using the Cloud on his blog, he also is using the drop down as well. Just replace the code for the 'flat' listing with that bit and put in your username and it should work.
C) Well that's a bit harder. It kinda depends. This script will only display the 'notes' section from del.icio.us. And if I'm not mistaken, I think there is a character limit (I seem to remember a 255 limit but don't remember for sure).
But, I see your test blog is a photoblog. Is the real blog a photoblog too??? If so, you CAN use some html in the delicious notes, if you wanted to display the images from your post, if BEFORE you published you copied the image/link then pasted that in the notes section at delicious, it should bring up the image when the category is displayed. Not sure if that would be a hassle or not.
Also keep in mind the character limit, I don't know if you normally post just the image with a little description, or if it's just the photo. If what you paste into the notes section goes over the limit it will cut it off there. So depending on how you photoblog it may all fit or not.
So don't know if that will be helpful or not. Something to think about I suppose. So there definitely is a limit, but you may be able to post your images with it.
Thanks Phydeaux again,
a) probably my problem here was misunderstood.. My recent posts and archives are a drop down list.. and in part three, the steps you've given to remove the category post from these listing is only for flat lists.. not for drop down lists.. need help on that.
b) Yup, successfully managed to have the category posts in a drop down list... when placing the code alongwith other drop downs, the category list moves to another line.. still trying to solve this one.
c) Yet to investigate the delicious notes approach.. good idea though ;-)
Yes, my main blog is a photoblog too.. http://indianimagery.blogspot.com
Ah, sorry Rahul for misunderstanding the problem. Hmm. Guess that means I should go ahead and work out the code to hide it for the drop down lists too huh? (I've been lazy) Ok. I'll take a look at it tonight and see what I come up with. I just have to remind myself of the syntax to use when the element is a drop down menu.
Will post the results.
Ok Rahul,
I got the code for hiding the post and archive when in a drop down appended to the post Drop Down Menu For Categories
I also took a glance at your testblog, for the issue of the category drop down going to a new line you might try this.
If you look at the first couple of lines of that section, a div is setup with the id of 'delicious', which is where the menu is inserted. A div is a block level element which is why that bit drops to a new line (most situations that's ok, but in your case not wanted). You can try changing that div to a span. A span is an inline element and I think it will then stay on the same line as your other menus.
Just replace the opening word div with span and make sure to also change the closing div a few lines later to /span
Hope this helps.
I'm very impressed. So far, categories seem to be working fine. The only problem is that when I started using Del.icio.us I didnt didnt know it didnt handle multiple word categories. So now I have and the etc. and I'm having trouble deleting them.
Also, How can I format the resulting category page differently? I like how yours comes in with larger titles. Mine has a symbol before the title and the snippet of text from the post due to the ul tag.
Sorry about the multiple posts. I seem to have missed something for cloaking the category post as that is not working.
Hi Phydeaux3,
Thanks so much for your category manual. For a novice like me, I managed to implement most of what you outlined.
However, I still have problem with the automated link to del.icio.us in every post. I couldn't get the display icon in my post, I also have problem with Quick Edit icon, it just doesn't show up in my blog.
My turnaround solution is to create a manual "One Click" link which I found from the Blogger Hacks. A bit of hassle, but it works !!
If you have time, maybe you can pinpoint to me why the del.icio.us link doesn't show up. My blog is bhappy.blogspot.com
Thanks again.
Mark,
Sorry it took a few days for me to respond. Blogger took the site down for quite a bit, plus was busy having fun. :-)
It looks like you found the bits to change for formatting the category page, as it looks good now.
The part on 'cloaking' the category page itself, I only see a problem with the archive listing.
The problem is here in the code that lists the archives.
ul class="archive-list"
The default blogger code for the archives gives that ul a CLASS of "archive-list". Change that to an id="archive-list" and the 'cloaking code will work.
I did note that in bold in the instructions, but there is a lot of stuff to digest. :-)
Change that, save, republish, yadda and it should work.
Looks good.
Denise,
Looks good.
On the problem of the delicious link not showing up, it is directly related to why the Quick Edit link doesn't show up for you either. They both work off the exact same stuff.
There are several things that can cause that, some on the blogger side and some your end. I took a look at what you have and everything looks good on the BLogger side. For both the
Quick Edit link and the Delicious link you setup everything looks perfect.
Has the quick edit link ever shown up for you in any Blog??? I ask because this may narrow down where to look on your end for the problem.
In my exp, when everything on the Blogger side is ok, the last thing that can affect it is usually cookies on your side. Both the quickedit and delicious link use what are called Third Party cookies, in that the page is from blogspot.com, but they use cookies from a different site (blogger.com) to work. Certain settings in your browser can block those, or I recently had a friend who installed a new firewall program which also blocked those cookies.
So you seem like you might know how to check those things in your browser. Allow complete cookie access to blogger.com and blogspot.com. If that ain't it, it may be in another type of firewall/security program on your computer.
That post to delicious link you have up is good, and good to leave for your visitors to bookmark your site.
The thing about the 'special' delicious icon for your categories is since it's hardcoded to your particular account, you can pass it the tags/category you have already entered, so you don't have to do that part again.
So that's my best guess, cookies. Let me know how it turns out or if we can narrow the problem down anymore with that information.
Hi Phydeaux3,
Thanks for the fast response. I checked the cookies setting in Firefox, IE and Firewall, all of them has set to allow cookies.
Yesterday, got myself a new notebook, and guess what !!... the quick edit and del.icio.us links showed up by itself. Maybe I didn't get my setting correctly in my old notebook.
Anyway, my category is working great. And thanks again for such great help.
Cheers,
Denise
Well glad it's sorted at least on your new notebook. I suppose that's the one you'll be using from now on anyway. :-)
Hi Phydeaux3--
I successfully implemented your scripts on three of the blogs I maintain, and the categorization system is working great. You've been a huge help.
On this 3rd blog I'm tweaking, I am trying to implement the date cloaking for the category post, as well as the title cloaking, and I can't figure out where to paste the scripts you've provided.
The HTML in my template for these sections looks like this (like Baba above, I subbed "[ ]" for "< >" in the code:
[BlogDateHeader]
[h2 class="date-header"][$BlogDateHeaderDate$][/h2]
[/BlogDateHeader]
[!-- Begin .post --]
[div class="post"][a name="[$BlogItemNumber$]"][/a]
[BlogItemTitle]
[h3 class="post-title"]
[$BlogItemTitle$>]
[/h3]
[/BlogItemTitle]
Thanks so much, Maria
Hi Phydeaux3,
Thank you so much for posting your very helpful categories setup. I have everything running as expected (at least I think I do) with the exception of one problem that I was hoping you could assist me with. Whenever my page loads I get an error:
Error: 'document.getElementById(...)' is null or not an object.
URL: http://spotthemusic.blogspot.com
Have any ideas what it might be? I thought I had everything setup as explained and I did double check things, but the error is still coming up.
Thanks in advance.
jef-
The error is coming up twice actually,
Error: document.getElementById("recently") has no properties
Source File: http://spotthemusic.blogspot.com/
Line: 332
Error: document.getElementById("archive-list") has no properties
Source File: http://spotthemusic.blogspot.com/
Line: 401
These are coming from the code snippets that are supposed to 'hide' the category post/archive you created for the categories.
You have the code from here ok, problem is your recent posts and archive lists aren't done in the expected manner. The code needs for them to be in an ul list with the proper id for the hiding to work.
A sample of each of the blogger code that would make those work is in this page, so either convert your lists to ul lists with those (you may have to add some styling if you do that) or if you don't mind that post/archive being visible then you can remove those two snippets of hiding code you got on this page.
So look over this page again to get the proper format for the lists.
Except for that it's looking good
Hi, thanks for an excellent guide.
I managed to get through it and it really worked. I've been searching a while for a solution to the category-problem i Blogger, and this was just perfect.
However, I did manage to get stuck in the hide resent post and archive-part. My problem is that I do not know excactly where to place the the script-codes of yours. If you could point it out for me in terms of an examplecode, I would be gratefull.
leif-
The code that does the 'hiding' on the recent posts/archive lists goes anywhere after those lists.
Also those lists have to be setup 'exactly' like the examples on this page (ul lists with the id set) for it to work, so maybe that's an issue also.
Go over the examples on this page again and see if that helps. If you are still having trouble, if you leave a link to your blog I may be able to spot exactly where the issue is.
Thanks! This time I think I got it right. The Archive-listing from Januar 2001 are gone anyway. If you have the time, could you just se to it that it is done correctly? If not, thanks anyway. Whether you make it or not, my adress is: itkunnskap.blogspot.com
By the way, I've linked to your guide in my rescent posting at my blog. Is that ok? Is it also ok if I place your blog in my recommended blogglist?
leif,
Looks like you got it. Everything looks good to me. Nice job on the setup too. Looks nice.
I hate to tell you that I'm just finishing up testing on a rewrite of everything that would've made converting everything over to your native language a bit easier, but you seem to have found where to put everything just fine. :-D
The new version of the scripts also add a few features, but unfortunately it's not a trivial matter to go from these original scripts to the new ones, one of the reasons I did the rewrite, to make it easier in the future to upgrade and manage. So I wouldn't suggest you convert over to the new ones when released (probably in a day or so), you'll probably want to stick with what you got for a bit.
And yes, links are always fine. I don't ever ask for them, but if you want to link then go ahead.
Oh, maybe I should mention something I've noticed that may affect you. There is another user that is in a scandanavian language that I was looking at his blog the other day, and I noticed all the encoding for your language was working out, EXCEPT for in the links that are in the post itself, and only seems to be a problem with the ø character (don't know what that's called) as in Verktøy. But those characters work just fine in the list pulled from delicious.
I've been trying to figure out why that is for the last few days and still dont' know why. From what I've seen, the encoding seems to get trashed by Blogger before the scripts even get to it, but I have no idea why. So just a heads up that category links in the post itself with that character seem to get trashed somewhere, I'm still trying to find out why. If I do, I'll make a post about it so keep a look out.
I had not noticed the problem before you mentioned it. By the way, thanks for dropping by my blogg. I've pulled out the Verktøy-category for now, since it didn't look too good that way (and as you said, and as I noticed, it don't work). It ain't a critical fault, so I can go around it, but I will have a look if you post anything on the subject.
By the way Verktøy means Tool in norwegian ;)
I sorry, but I do have to ask you one more thing. I got the Category, before the tags on each post, translated to norwegian (Kategori) as you may have noticed. But when you click on a category in the list (at the left on the blogg) I get a title on the categorypage that says 'Category:' (and the chosen category in norwegian). I've tried to change 'Category' to the norwegian Kategori, but haven't managed to find where the change has to be made. If you can find the time i would be gratefull, but its no rush.
again, thanks for all.
Leif,
Yeah, that is hard to find and customize. You're gonna hate me when I post the rewritten codes, I've made doing all that much easier. :-D
For that instance of "Category:", as it is now it's in the actual category post itself - the scripts itself in that post.
There is a line that reads
document.getElementById('delpost-title').innerHTML = 'Category: '
As the script displays in Part One..it's about the 11th line down, it may be a little different line number in your actual post.
But as you can probably guess, anything in the ' ' marks is where you
change it.
Ah, Verktøy is Tøøl. I like those ø . Seems like heavy business is going down when thøse are used. I'm gonna start using 'em myself I think. :-D
And it's weird what's happening to them on Blogger. I've tested it out and they seem to work on initial publish (at least for me), but then at some point in subsequent publishing, they get trashed on Blogger's end, I don't think my scripts could be doing it. And I've done some testing with other non-english characters, such as accent marks, umulats sp?, and those french squiqqly things under the c's. The ønly ønes that seem tø have a prøblem is the ø...so I'm a little confused as to why. I got some suspicions, but I døn't knøw why thøse øther characters aren't trashed alsø.I'll keep my eyes øpen.
Thanks for the info. I can't use your codes the way you intended because use of the "ul" tag messes up my template format and your code doesn't work if I take it out.
A little background on my situation: I am great at HTML, but for some reason cannot comprehend CSS (mainly because I don't have time to learn it, I guess). As a result, I pulled all of the CSS code out of my template and replaced it with my own HTML. It's tedious, but I can make my page do what I want that way.
I have gotten around formatting difficulties by typing out all my tag urls in HTML. The end result has been something that works and looks like it should be in my web site. The trouble is, my "Categories" page is in a terrible format, and I can't fix it. I don't really want it to do much. Listing the category that the pages listed fall under would be nice, but is not necessary. What I really need is to remove the tags -- they look exactly like my titles and it is really confusing.
This seems to be a repeated question, but you said that you had answered it in the questioner 's other questions. I didn't see any other questions by that author.
If you can help, that’s fine, but if you can’t, I guess I can just link all my tags to the Delicious page. But I’d like to keep all the linking on my site if at all possible.
Thanks.
Realm-
If I understand your question correctly, you don't want the tags shown on the category page...
Change
var delShowTags = true;
to
var delShowTags = false;
in the script variables section, republish the entire blog should do it.
As for displaying the selected category on that page, well it's explained in this section of the how-to. Although your template setup is so different, I'm not sure if it will work with that or not, I've not tried it. It will probably work, but you'd have to understand how it operates, it just needs an id added to the enclosing tag around the post title, which in your case looks like the [b] tag that surrounds it, just modify the instructions to work with it.
Hope this helps.
I just used the categories on my site but sometimes when I click on a category nothing appears but then if I refresh it a few times the listings will appear.
Any ideas?
Todd -
Yes, I'm seeing that sporadic error right now also, and it seems to be a problem on the del.icio.us side. Some work, some don't, some will if you refresh.
See this post(the comments section) for my comments on following it.delicious2Blogger - Categories for Blogger
I'm fairly certain it's on delicious side, and most likely they should have it cleared up soon. I will be keeping my eye on it.
Post a Comment