9.29.2005
Drop Down and Give Me Twenty
Ah, my little ones, grasshoppers... wisdom you want? Knowledge you seek? Syntax I invert to sound wise?
What you need ... what you want... what you seek .... can be summed up in three words: drop-down menus!
Open your Blogger Dashboard. Click on Change Settings. Select the Template tab and "Edit Current." And before you do one more thing, SAVE A COPY of the template. Yes, back to Lesson One. Learn it well. Grasshopper.
Moving on. You've saved a copy of your template. You have your Blogger Template page open.
Locate the Sidebar content. This is assuming you have a sidebar. Not all templates do, so on some blogs (this one, for instance) the sidebar content is just placed at the bottom of the page, and will be found at the tail end of the template.
Most Blogger templates come with a default setting for Archives and Previous Post Items. You will need to peruse your blog carefully to find the default code.
Since templates are created by different authors, they are not consistent. Look for a section named something like Archive Links. Note that these areas will generally start with the tag that indicates a comment (as opposed to active code). Comments are used to help organize the template. They mark sections, like so:
<!-- Archive Links -->
Blogger has certain variables it uses, such as $BlogArchiveURL$ and $BlogItemPermaLink$. These Blogger Tags are shortcuts used to pull data from your blog. We'll start by utilizing the existing Blogger variables and set up two drop-down menus: One for Archives and one for Previous Posts. In a later lesson, we'll create our own customized indices, by topic.
Let's get started!
Step One -- Delete your DEFAULT ARCHIVE CODE, which generally looks like this:
Step Two -- Replace it with the DROP-DOWN MENU ARCHIVE CODE:
You should be able to cut & paste the lines above into your template.
Now use the PREVIEW button to see your lovely new Archive menu! Yay! Ay yi yi yi yi yi (stop me now, please)
You can do the exact same thing for the PREVIOUS POST links. Delete the default code and paste in this:
Notice the language of the drop-down menu code. You have a SELECT tag with OPTION values. Those are the building blocks we will use to create your custom topic indices as well. That's in the next lesson.
QUIZ:
What function do the SELECT tags serve? For reference, read HTML Dog's explanation.
What do you call something like $BlogItemPermalink$ between the two dollar signs? I would call it a variable, but Blogger calls it a Blogger Tag. Weird.
How did I finally, finally figure out how to put code snippets into my posts? I could tell you, but I would have to kill you. That's for much much later.
What you need ... what you want... what you seek .... can be summed up in three words: drop-down menus!
Open your Blogger Dashboard. Click on Change Settings. Select the Template tab and "Edit Current." And before you do one more thing, SAVE A COPY of the template. Yes, back to Lesson One. Learn it well. Grasshopper.
Moving on. You've saved a copy of your template. You have your Blogger Template page open.
Locate the Sidebar content. This is assuming you have a sidebar. Not all templates do, so on some blogs (this one, for instance) the sidebar content is just placed at the bottom of the page, and will be found at the tail end of the template.
Most Blogger templates come with a default setting for Archives and Previous Post Items. You will need to peruse your blog carefully to find the default code.
Since templates are created by different authors, they are not consistent. Look for a section named something like Archive Links. Note that these areas will generally start with the tag that indicates a comment (as opposed to active code). Comments are used to help organize the template. They mark sections, like so:
<!-- Archive Links -->
Blogger has certain variables it uses, such as $BlogArchiveURL$ and $BlogItemPermaLink$. These Blogger Tags are shortcuts used to pull data from your blog. We'll start by utilizing the existing Blogger variables and set up two drop-down menus: One for Archives and one for Previous Posts. In a later lesson, we'll create our own customized indices, by topic.
Let's get started!
Step One -- Delete your DEFAULT ARCHIVE CODE, which generally looks like this:
<BloggerArchives>
<a href='<$BlogArchiveURL$>'><$BlogArchiveName$></a>
</BloggerArchives>
Step Two -- Replace it with the DROP-DOWN MENU ARCHIVE CODE:
<select name="archivemenu" onchange=
"document.location.href=this.options[this.selectedIndex].value;">
<option selected>- Archives -</option>
<BloggerArchives>
<option value="<$BlogArchiveURL$>"><$BlogArchiveName$></option>
</BloggerArchives>
</select>
You should be able to cut & paste the lines above into your template.
Now use the PREVIEW button to see your lovely new Archive menu! Yay! Ay yi yi yi yi yi (stop me now, please)
You can do the exact same thing for the PREVIOUS POST links. Delete the default code and paste in this:
<select name="previousitemsmenu" onchange=
"document.location.href=this.options[this.selectedIndex].value;">
<option selected>- Previous Posts -</option>
<BloggerPreviousItems>
<option value="<$BlogItemPermalinkURL$>"><$BlogPreviousItemTitle$></option>
</BloggerPreviousItems>
</select>
Notice the language of the drop-down menu code. You have a SELECT tag with OPTION values. Those are the building blocks we will use to create your custom topic indices as well. That's in the next lesson.
QUIZ:
What function do the SELECT tags serve? For reference, read HTML Dog's explanation.
What do you call something like $BlogItemPermalink$ between the two dollar signs? I would call it a variable, but Blogger calls it a Blogger Tag. Weird.
How did I finally, finally figure out how to put code snippets into my posts? I could tell you, but I would have to kill you. That's for much much later.
Comments:
<< Home
Hurray for you! No need to tell us at Mirty's Place. I check here twice a day. Glad you finally figured it out. I bet Dr. Bean is too!
Master Mirty,
I am mesmerized by your instructions and will endeavor to apply them this Sunday. Our humble Coffeehouse will owe much to your wisdom. I hope this pleases you.
Your faithful pupil,
Bean
[bows deeply, leaves in silence]
I am mesmerized by your instructions and will endeavor to apply them this Sunday. Our humble Coffeehouse will owe much to your wisdom. I hope this pleases you.
Your faithful pupil,
Bean
[bows deeply, leaves in silence]
Mirty, awesome stuff, I love drop down menu's cause the clean up the side bar, make's it easier for people to see all the great stuff some people (ahem, ahem, me) keep there. One questions teach, I tried it for my previous posts anfd the box form was too wide, it moved down the whole sidebar, how come some times the bar is too wide to fit on the page?
Chaim - You can adjust the width. By default, it will stretch out to the length of the post titles, which can be a problem.
I formatted the drop-down sidebar menus at mirty12.blogspot.com with this CSS code:
select {
width: 200px;
color: #666;
background: #e0e0e0;
}
This code means that when the SELECT element is used, the boxes will be set to a width of 200 pixels. It also sets up the color scheme.
Try adding that CSS code. The CSS settings are usually at the top of the template and they apply to the whole page. Everything inside the curly brackets is formatting applied to the specified element.
FYI, the color tag there sets the text color and the background sets the background color -- for the drop-down menus. Which can be cool.
I formatted the drop-down sidebar menus at mirty12.blogspot.com with this CSS code:
select {
width: 200px;
color: #666;
background: #e0e0e0;
}
This code means that when the SELECT element is used, the boxes will be set to a width of 200 pixels. It also sets up the color scheme.
Try adding that CSS code. The CSS settings are usually at the top of the template and they apply to the whole page. Everything inside the curly brackets is formatting applied to the specified element.
FYI, the color tag there sets the text color and the background sets the background color -- for the drop-down menus. Which can be cool.
Mirty, you're awesome. Even though I haven't done this yet, I plan on it.
What are the next ones going to be about? Are you taking requests?
What are the next ones going to be about? Are you taking requests?
I am taking requests... So far, I've got one for info on how to change colors on various elements (fonts, borders, etc.)
You're wonderful, though I still haven't tried. this is the one I want to do to add my recipes and other goodies.
Slight problem, Professor.
The Archive menu code the way it stands now (take a look at Kerckhoff if you need to) has a "CURRENT POSTS" option at the bottom of the list when you are looking at an archive. Meaning, when you select some previous month to look at, it puts "CURRENT POSTS" at the bottom so there's an easy way to get back to the most recent posts. (Clicking on the title of the blog doesn't work, since this is only a link when you're looking at an individual post.) I got the drop down menu to work and it looks great but it doesn't add the "CURRENT POSTS" option so it makes it very awkward to get from the archives back to the present. So I undid your beautiful code and left things the way they were for now. Can you teach me how to add that option?
Am I making any sense?
The Archive menu code the way it stands now (take a look at Kerckhoff if you need to) has a "CURRENT POSTS" option at the bottom of the list when you are looking at an archive. Meaning, when you select some previous month to look at, it puts "CURRENT POSTS" at the bottom so there's an easy way to get back to the most recent posts. (Clicking on the title of the blog doesn't work, since this is only a link when you're looking at an individual post.) I got the drop down menu to work and it looks great but it doesn't add the "CURRENT POSTS" option so it makes it very awkward to get from the archives back to the present. So I undid your beautiful code and left things the way they were for now. Can you teach me how to add that option?
Am I making any sense?
Help, Mirty!
I even added a last line to the menu to force the "current posts" option. Here's my code with the greater-than and less-than signs replaced by square brackets since I don't know how you do the trick of inserting HTML without it being interpreted as HTML.
[select name="archivemenu" onchange=
"document.location.href=this.options[this.selectedIndex].value;"]
[option selected]In the Freezer[/option]
[BloggerArchives]
[option value="[$BlogArchiveURL$]"][$BlogArchiveName$][/option]
[/BloggerArchives]
[option value="[$BlogURL$]"]Current Posts[/option]
[/select]
But for some reason this doesn't work. The last menu option desplays and works beautifully on the front page, but if I go to an archive or an individual post, the last option disappears off the menu. What's happenning?
I even added a last line to the menu to force the "current posts" option. Here's my code with the greater-than and less-than signs replaced by square brackets since I don't know how you do the trick of inserting HTML without it being interpreted as HTML.
[select name="archivemenu" onchange=
"document.location.href=this.options[this.selectedIndex].value;"]
[option selected]In the Freezer[/option]
[BloggerArchives]
[option value="[$BlogArchiveURL$]"][$BlogArchiveName$][/option]
[/BloggerArchives]
[option value="[$BlogURL$]"]Current Posts[/option]
[/select]
But for some reason this doesn't work. The last menu option desplays and works beautifully on the front page, but if I go to an archive or an individual post, the last option disappears off the menu. What's happenning?
Doctor Bean - I've noticed the same, but it was true way before I even used Mirty's ideas... Current Posts just aren't always shown on Blogger.
OK! Good news!
(Am I becoming the annoying student that the teacher tries to ignore? If so, just smack me and I'll stop commenting.)
I think I'll delete some of the intermediate comments in which I was stumbling in the dark screaming for help.
The key is to republish the entire blog, which propagates the code to all the archive sidebars. When I just republish the index, many of the archive pages still had the old code. Perhaps this will be useful to other pupils.
(Am I becoming the annoying student that the teacher tries to ignore? If so, just smack me and I'll stop commenting.)
I think I'll delete some of the intermediate comments in which I was stumbling in the dark screaming for help.
The key is to republish the entire blog, which propagates the code to all the archive sidebars. When I just republish the index, many of the archive pages still had the old code. Perhaps this will be useful to other pupils.
Yes! That point about "republish entire blog" -- Very true. If you republish only the index, the changes don't get propagated throughout your blog. (I noticed that some time ago but forgot to mention it. Thanks!)
Mirty,
thanks so much. applying it to my blog. You make it so easy.
your faithful reader... going onto customize...
thanks so much. applying it to my blog. You make it so easy.
your faithful reader... going onto customize...
Who knows where to download XRumer 5.0 Palladium?
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!
Cool story you got here. I'd like to read a bit more about this theme. Thanx for giving that information.
Sexy Lady
Blonde escorts UK
Join the fun!
Sexy Lady
Blonde escorts UK
<< Home



