Example:
This is the basic syntax for using "else" tag
<b:if cond='condition'>
[content to display if condition is true]
<b:else/>
[content to display if condition is false]
</b:if>
Red is my condition to follow.[content to display if condition is true]
<b:else/>
[content to display if condition is false]
</b:if>
Orange is what happens if condition is met.
Light Blue is the else tag.
Dark Blue is what will happen if the condition is not met.
Then the tag at the end is to close out this group.
Here is another way to look at this.
Monday- Friday
Store Hours: 10am-10pm
All other days
Store Hours: 12pm-6pm
So you can think about it in this manner.
My condition is "On Monday through Friday"
What happens is "My store is open from 10am-10pm"
If it is not Monday-Friday
I am open from "12pm-6pm"So here is a practical use of the else tag that you may use.
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<style>
#Blog1 {background-color: red;}
</style>
<b:else/>
<style>
#Blog1 {background-color: blue;}
</style>
</b:if>
In this code above I am styling the background color of the Blog1 gadget to be red on the homepage and on all other pages it will display blue.
<style>
#Blog1 {background-color: red;}
</style>
<b:else/>
<style>
#Blog1 {background-color: blue;}
</style>
</b:if>
0 comments:
Post a Comment
Please don't post hyperlinked text within the comment box! It will not be published and you will be marked as spam.