[RESOLVED]Blogger: Help with multiple tag search
[RESOLVED]
Hey guys and girls!
I'm using blogger.com for my blog, and am constantly working to improve the visitor's experience on by blog by improving the look and feel and performance of my website. In this direction, I've included a CSS/JavaScript/JQuery based header animated slideshow, that, I feel enhances the visual appeal of my blog. To make it easily navigable, I worked upon and implemented a CSS/JQuery based menu at the top of header, that, I plan, will give an easy access to various elements of my blog, including some pages, and other elements.
Now, I found out that clicking on any of our blog's label tags shows us all posts that include that label. I implemented this with some of my newest posts, and carefully put labels in all those posts, that I wanted to, be displayed when searched for a single label. Doing this, I got a url, something like this: www.myblogsname.com/search/label/my%20label. I easily used this url to create a hyperlink to create a menu item at the top of the page, in the menu bar.
*Please note that I don't have a blog named www.myblogname.com. It is used just for an example, as I don't want to indulge in SSP.
This is an actual image from my blog's header menu. The menu item What's Growing marked here, works with the tag search url of about the same label in many of my blog posts. The underlying URL of link is something like: www.myblogsname.com/search/label/my%20label
But, since I realized that quite late in my blogging career, I'm left with no other option but to lookout for alternative ways to do that and create a url to search for multiple labels. I want to create a URL with those multiple labels, because using that URL, I'll be able to create a hyperlink menu in the menu bar. The need to find this work around arises from the fact that there are a number of posts that are related to each other in one or the other ways, but, since, I didn't know the deep importance labels and tags, I never bothered to use common labels in all those related posts, and now have to look out for work around to make all those related posts easily navigable by clicking on a button.
In this lookout, I scoured the mighty internet, and found some tips on how this could be done. I experimented with some examples quoted on some helpful websites/blogs, but, wasn't able to implement the thing the way I wanted (in the way, I expected it to work correctly). Working on with trial and error with the ways, I reached a URL like this: (Please note that this is just an example)
www.myblogname.com/search/?q=label1|labelname1:label2|label%20name%202:label3|labelname3:label4|labelname4
While this URL is working, but isn't working quite the way it should, and isn't showing all the posts having the keywords/labels I passed in the URL. I'm saying this because I know that there are multiple posts with the keyword labels I've used in the URL, but, just two or three our four posts appear.
I would like to request you guys to help me out with this stuff, as I'm stuck in this, and can't get a way out of this.
The issue has now been resolved.
Here is the solution:
Finally, having a brainstorming session with Ranjith, paid up. I finally got the thing rectified, and now it is working quite properly.
We just have to make a URL this way: www.myblogname.com/search/?q=label|labelname1:label|label%20name%202:label|labelname3:label|labelname4
The first change to the url, I was using earlier was correcting the label keyword. Earlier, I was using label1:labelname1,label2:labelname2, label3:labelname3, and so on to denote labels, while I had to usethe keyword label, This way label:labelname1, label:labelname2, label:labelname3.
The second important thing to keep in mind is the capitalization (case) of the keywords/labels/tags. This was one big hurdle for getting it done for me. You are required to use the keywords as you've used in the post. For example, if you've used "Poem" in any of your posts and are using "poem" in the url label, to search for, it simply won't work.
Just a while back, I was told by Ranjith that this could have been done the easier way by adding/appending labels to each of those posts, as I had just 50 published posts. Till now I thought it wasn't possible, once I had published the posts, because, I tried changing the labels but couldn't. After his tip, I checked again, and still, I wasn't able to edit the labels unless I clicked on "Labels", and I thought that I was such a fool to try this stuff instead of trying a way to edit labels in the posts.
Anyways, this, I think, might help other people who want such a thing, and have too many posts to append the labels to.
Reason: Update to indicate that the issue is resolved
CK, I created tabs for my labels. Some of them have multiple labels and they show up in both the label tabs. Is that what you are trying to do?
Thanks for the reply, Pankti. I checked your blog, and the tabs too, but, this is just a part what I want. The thing you've implemented is using single label/tag, while I want to use multiple label/tag in the same URL. for example, one of your blog's tabs is has this url: yourblogname/search/label/Short%20Story, and another is yourblogname/search/label/Poems, while I want to use the label Short Story as well as Poems in the same URL, so that I could show all posts having the labels, with just one click. I hope, I now make myself clear.
CK, I have used multiple lables in couple of my posts. There's this post called "Fresh," which has photography as well as poem. This will appear under both the label tabs.
You still didn't understand the scenario, Pankti. Now, take an example. You have different posts with different labels (namely, poem and photography). Now you want to be able to view both the posts - the one with the label "Photography" and the other one with the label "Poem", by clicking on just a single tab. I want that! I hope, this time, I'm making myself more clearer than before.
Ranjith, I still don't understand what CK wants to do....but never mind. You are there for him.
Pankti Wait for a few minutes. I will explain it using pictures. It has been many days since I have done it.
Ranjith, that'd be great
Ranjith, I am still waiting
Pankti You'll have to wait for 2-3 days
I was a bit busy today. I'm travelling tomorrow.
I will do it on 29th.
Try this : http://www.XYZ.com/search/?q=label:love%20label:friendship
I think it's working.
In case it works and you use it, let me tell that these pages won't be indexed as they are blocked by robots.txt. You may have to edit it.
Ranjith, in this case, I think, the second label "label:love%20label:friendship" will be taken as a label ("keyword"), itself, and won't tell the browser that it signifies use of a new label. The url would be equivalent to "label:love label:friendship"
Ranjith, you are not allowed to share links on the forum, even if it is link to my own blog.
Sorry guys, this wasn't intended, I don't know why Ranjith has shared that link.
In the mean time, I'd like to share that this way too isn't working properly, because it is still showing a number of posts that didn't have any of those labels, we used in the URL "Flower", "Grape"
ssp
CK It's allowed.
And the rule is not 'you are not allowed to share links on the forum'. It is something different. teak se pado kiddo.
Ranjith, teak (teak wood) is padho ya thik se padho?
Ranjith 2 choclates ka IOU already hai
IOU = I owe you = debt note in commerce transactions
Engineers are always dumb
Finally, having a brainstorming session with Ranjith, paid up. I finally got the thing rectified, and now it is working quite properly.
We just have to make a URL this way: www.myblogname.com/search/?q=label|labelname1:label|label%20name%202:label|labelname3:label|labelname4
The first change to the url, I was using earlier was correcting the label keyword. Earlier, I was using label1:labelname1, label2:labelname2, label3:labelname3, and so on to denote labels, while I had to usethe keyword label, This way label:labelname1, label:labelname2, label:labelname3.
The second important thing to keep in mind is the capitalization (case) of the keywords/labels/tags. This was one big hurdle for getting it done for me. You are required to use the keywords as you've used in the post. For example, if you've used "Poem" in any of your posts and are using "poem" in the url label, to search for, it simply won't work.
Labels for posts and displaying pages containing only articles with a specific label are pretty basic features for any blogging platform. But what if you want to search for several labels and retrieve articles that contain all those labels or any label? Is that even possible? I
One of the solutions I discovered on the Blogger help forums uses search with a query in this format: <blog-URL>/search/?q=label:LABEL1+label:LABEL2. This returns posts with both labels. I tested it myself and it works, but it’s hard to manually build the URL and the search is case sensitive, meaning that it will return no results it you don’t input the label name exactly as created in Blogger.
While playing around on the blog I discovered an easier way to do this: modify the normal label URL in Blogger by adding a + sign followed by the name of the second label: <blog-URL>search/label/LABEL1+LABEL2. It’s easier to remember and to type, but it’s also case sensitive. It actually works with more than two labels – I only tested it with three, so I’m not sure if there is a limit to the number of labels you can add in the URL. I don’t use any labels with multiple words so I couldn’t test this case, but it’s safe to assume you need to escape spaces by replacing them with %20 just like Blogger does with the regular label pages.
But what about the other case, when you want to find posts with any of those labels – the OR operator instead of AND? Unfortunately the second option doesn’t seem to support OR, but the first one does: just replace the + in the search query with a vertical bar like this: <blog-URL>/search/?q=label:LABEL1|label:LABEL2. It’s fun to see this in action especially with labels that have very little to do with one another.
This Indiwiki entry is courtesy http://exde601e.blogspot.in
Pankti
Supppose you have 4 posts, 3 labels : seo, template, book-review
Post Name : Label
Post 1 : seo
Post 2 : template
Post 3 : seo
Post 4 : seo
Post 5 : book-review
And suppose, you already have three tabs similar to what you already have on your blog - seo, template, book-review
Now consider that you have somehow managed to convert your blog to a kichdi blog, writing about everything that you can - receipies, fashion, news etc. And because of it, the number of tabs have also increased which looks ugly. You want to recategrise your posts to blogging, receipies, fashion, books and news. You have hundreds of articles on your blog and changing the labels of your posts to fit them into one of the above actegories is difficult. Following is the re-categorsisation that you need to do for the above five posts.
Post 1 : blogging
Post 2 : blogging
Post 3 : blogging
Post 4 : blogging
Post 5 : books
But you don't want to do this tedious work. So, what you want is when you click the 'blogging' tab, all blogging realted posts - Post 1, 2, 3, 4 should be displayed i.e. all posts which are tagged with either seo or templates should be displayed when you click the blogging tab.
Ranjith: Bow down/hats off ka smiley kaise banate hain? agar mujhe aata toh main bana deta, I couldn't understand a single word of the question, but from your answer I could guess exactly what it was. awesome!!
Ah! Now I get it. Thanks.
PS: I think I will need to resort to this in few months. I am thinking to add recipes too in my blog
@SB Draw it. Scan. Upload to Picasa. Paste here.
@ Pankti All the best for your kichdi blog.
Kichadi is Copy Righted to me Any attempt to copy that will be dealt harshly
VP, don't worry. I will make Veg. Pulao..not Khichdi
I am thinking to add recipes too in my blog
food things look too weird in a literary related blog
ND, but I am not sure if my blog would be considered a literary one.
stories, poems, book reviews does count as literary....uspe recipes will look weird....thats just my personal opinion...its ur blog u can write watever u want
Yes ND. What you are saying makes sense. Sigh...there goes my recipes down the drain.
Maybe I can start another blog for cooking? But then, would I be able to update it regularly? This is so confusing!!!!
you can still write....just do once in a while and not fill it up with recipes...maybe once a week/fortnight or so...if you want to retain the literary feel to ur blog...or maybe add poems/stories/quotes to ur recipe to make it unique
A recipes blog is different from a literary blog ( if we don't include book reviews in literary i.e. literary = stories, poems, memoirs etc ). Recipes blogs get good traffic from Google. Literary blogs don't.
About the frequency of posting : Just remove the timestamps from your posts, so that people will never know when you had last updated your blog. In case, you start a recipes blog, then I will help you in removing those timestamps if you are interested.
Thanks Ranjith. The more I think, the more I feel that I should rather start a separate blog for food. I can put in various recipes, restaurant reviews and opinions about cookery shows that I like to watch. I am still thinking about it. But any thoughts are welcome. ND, thanks for pushing me to think like that.
Sign in to reply to this thread