Chaim made this picture!



10.07.2005

 

Your Content Goes Here

Gosh, you guys are so good. I'm seeing drop-down menus for Previous Posts and Archives sprouting up like dandelions everywhere.

Now we're moving on... to customized drop-down menus. Blogger is sadly one-dimensional. Flat. We want categories, indices, complexity. We shall have it.



For examples, see the sidebars of the following sites --

Elie
Akiva

The code is simple, but requires maintenance to keep the indices up to date. The basic code is similar to what we covered in a previous post. You set up a SELECT statement with OPTIONS. But instead of using Blogger Tags (variables), you will input each option.

Code from my blog template looks like this:



< SELECT NAME="Funnymenu" onchange=
"document.location.href=this.options[this.selectedIndex].value"; >
< option > - Life is Funny-</option >
< option value="http://mirty12.blogspot.com/authority.html" > Authority</option >
< option value="http://mirty12.blogspot.com/culture-clash.html">Culture Clash </option >
< option value="http://mirty12.blogspot.com/doggerel-of-day.html" > Doggerel </option>
< option value="http://mirty12.blogspot.com/pickles-for-me.html" > Pickles for Me </option >

</select >





The code above creates the "Life Is Funny" menu at my Mirty blog.

The structure is simple. Each menu item has an opening OPTION VALUE tag, followed by a link, followed by text, and lastly, a closing OPTION tag. All the OPTION VALUE tags are nested within the opening and closing SELECT tags.

< option value="link to your post" > This is what people will read </option >

For your post link, use the URL that goes directly to the post itself. You can usually find this by clicking on the little date/time stamp at the bottom of the post. (If you hover your mouse over it, the little pop-up tip says "Permanent Link")

Good luck. Remember the formatting tips and make it look slick!

Technorati Tags -

  # 7.10.05
Comments:
This comment has been removed by a blog administrator.
 
This comment has been removed by a blog administrator.
 
Oysh - so sorry to keep commenting, but does it not work for external links? It seems to be limited to things within my own blog...
 
In writing this to post, I had to use the ampersand-lt code to indicate the left carat and the ampersand-gt to indicate right carat.

more on that here --
HHTML Goodies

But to write your code, use the actual carat symbol. The ampersand-lt and gt are just something I'm using here in the tutorial, in order to make the carat appear on screen but not actually run the code it creates.
 
I hope that's not too muddy. Basically, you could cut and paste the code shown in the post, fill in your own links, and it will work in your template.

If you do a "view source" and see the ampersands, you're only viewing a textual feature, not the drop-down menu function.
 
I'm testing a drop-down menu box for external links. See the top of the blog.
 
This has been very helpful. Thank you. I am considering developing categories, but I have a couple thousand posts now and am not sure if I am up for the work, oy.

But you have made it possible, so thanks.
 
I see you've added the links to your Mirty blog... does that mean you've figured out the code?
 
In your example, I think you forgot a closing quotation mark at the end of this line:
"document.location.href=this.options[this.selectedIndex].value;

Without it, the drop-down menu looked fabulous, but the links didn't work. With a final quotation mark added, it worked like a charm and my blog is now looking very spiffy!

Thanks, Mirty!

:)
 
Talmida - Thanks for catching that. I've fixed it now.
 
Ezzie - Still testing. Too busy right now anyway... probably next week!
 
Mirty: Many, many thanks. You're the best thing to happen to our Coffeehouse since sliced bagels. (You might want to take a look, though my work on the side bar isn't done.)

Question: The external links (or blogroll) in the old plain bulletted list format had the advantage of letting you right-click on the link and choosing "Open in a new window". That option is lost with drop-down menus. Is there anyway to include HTML code in the drop-down menus to have the links always open in another window? For external links that would be handy.
 
Another issue (brought to me by a co-Coffeehouser) is that search-bots won't follow drop-down menu links which will mean that our archives don't get indexed and people won't be able to find us by searching for key words in our archives. Here and here are help pages from Google suggesting this is true. Another less important consequense is that the other blogs we link to would no longer benefit in terms of page rank from being linked by us since bots wouldn't see the links.

Any thoughts?
 
Mirty - same question as Dr. Bean about the external links...

Also, some drop-downs do register on searches (such as the ones I have for my blogroll).

And, same compliments: You're the best, Mirty!
 
We may be able to set the menu links to open in a separate window. I'll do some testing on that. That would be a nice feature!

Maybe a "Go" button as well.

That may require additional script lines in the Header section of the blog.

I am bummed about the problem with indexes and rankings. Ezzie - I tried a modified version of the Alliance blogroll code to work with my Blogroll (from www.blogrolling.com) but could not get it working right. I would like that though. Stay tuned.
 
Oh! I should have mentioned - I added a bit to it: It only worked for my Blogrolling Blogroll when I added the Show/Hide thingy underneath (go look at my blog, you'll see what I mean).
 
Here's the code: All < and > I made ( or )... though around 'My Blogroll' the ( ) are not < >. And you'd have to change that blogrolling # to your own.

(h3)(a href="#" OnClick="return toggle('My Blogroll')")(span style="font:Times New Roman;")(span style="font-size:74%;")Show/Hide(/span)(/span)(/a)(/h3)
(div class="side" id="My Blogroll" style="display:none" align="left" )
(!-- Start hidden information --)
(script language="javascript" type="text/javascript" src="http://rpc.blogrolling.com/display.php?r=53422cf384f1d4f5a3e3a74e42136685")(/script)
(!-- End hidden information --)
(/div)
 
Ezzie, I like that toggle Blogroll - now you see it, now you don't. I've added that to my template.
 
I see - and yours looks cooler, too. I don't have enough room for that whole sentence. Any clue how I can get rid of that wasted space to the right and left? I've finally realized that while my nice 17" screen easily shows my bookmarks and the entire width of my blog, it's incredibly annoying for everyone else trying to read it, as they have to scroll left/right all the time.

I also like the show/hide blogroll because I can add more people and not have it take up extra space on the side.
 
Join the fun!


<< Home