Before getting into the details of selective display,let us discuss about the different types of pages on blogger.
1. home page- yea its your blogs home page as the name suggests(actually this is not a type. but i will still include it here..)
2. Archive Page- Refers to archive pages..
3. Item Page - Refers to Post Pages
4. Index Page - Includes home page + label page + search results page
1. home page- yea its your blogs home page as the name suggests(actually this is not a type. but i will still include it here..)
2. Archive Page- Refers to archive pages..
3. Item Page - Refers to Post Pages
4. Index Page - Includes home page + label page + search results page
Selective Display..
There are different conditions to check the page type. You can use these conditions for the selective display.
You might like to display a welcome message on the home page only...
Welcome to my Blog
Displaying on all pages other than the homepage
this is not the homepage
Displaying something on the Archive Pages..
Hii this is an archive page
Displaying something on non Archive Pages..
Hii this is an non archive page
Displaying something on post page only
Hii this is a post page
Displaying something on non post page only
Hii this is a non post page
You can use the conditional thing for the index type pages. But i don't find much use in that.
Now displaying something on a particular url only (may be a particular post page only or something like that)
this will be displayed on The_Particular_Page_Url only
(you will have to replace The_Particular_Page_Url with the url where you need the widget to be displayed..)
Now displaying something on all pages other than a particular url..
this will not be displayed on The_Particular_Page_Url
Now how to use two conditions (or more).. the logical AND thing.. :)
this is not Particular_Page_Url1 and this is not Particular_Page_Url2
the else thing..
What if you need to display something on the homepage and something else on all other pages.. here comes the use of if else
What if you need to display something on the homepage and something else on all other pages.. here comes the use of if else
This is the homepage
line1
line2
This is not the homepage
line 3
line4
Different combinations are possible..
Limitations
1) I don't see a way to use OR conditions
2) There isn't any direct easy way to include AND in conditional statements
3) The main drawback is that we cant enclose an entire widget within the b:if tag.. you will get some message telling that a b:section cant have b:if s ie you can wrap an unexpanded widget within a b:if condition
Limitations
1) I don't see a way to use OR conditions
2) There isn't any direct easy way to include AND in conditional statements
3) The main drawback is that we cant enclose an entire widget within the b:if tag.. you will get some message telling that a b:section cant have b:if s ie you can wrap an unexpanded widget within a b:if condition
Wrapping a widget with the conditional tags
Every widget other than the BlogPost Widget has this general structure
somethings here
Every widget other than the BlogPost Widget has this general structure
somethings here
Wrapping conditional tags can be done as
some things here
this code will display the widget on The_Particular_Page_Url only (you have to provide this url)
Another Limitation..
wrapping the blogpost widget is little complicated as it has many b:includables.. yea you can do that too.. :)
wrapping the blogpost widget is little complicated as it has many b:includables.. yea you can do that too.. :)