• Problems

    This line enable URL Rewriting . It must be enabled via the RewriteEngine directive! and if your .htaccess file is going to use rewrite rules, you should always include this line. Otherwise, you can’t be sure if its enabled or not. The string “on” is case insensitive.


The <body> section of a layout template is made up of sections and widgets.
  • Sections are areas of your page, such as a sidebar, footer.
  • A widget is a page element such as a page, a blogroll, or anything else you can add from the “Page Elements” tab.
You can include any HTML you like around the sections in your template.

2) Writing content:

<b:section> and <b:widget> work similar to that  of div. In your published blog, all <b:section> and <b:widget> tags will be replaced with <div> tags, which will have the specified ID. This will allow you to refer to, for example, div#header or div#myList in your CSS. <b:section> work similar to that of container , it can include as many <b:widget>.
There must be one section tags for valid templete.for e.g
<b:section id="header" class="header" >
</b:section>

how to use  <b:section> and <b:widget> ?
  STEP ONE : First of all define section tags with unique id , otherwise your template will not valid .

<b:section id="header"  >
</b:section>

A <b:section> tag can have the following attributes.

 id     -  A unique name, with letters and numbers only. An ID serves as the unique identifier for a section.It is required

 class  -Common class names are 'navbar,' 'header,' 'main,' 'sidebar,' and 'footer.' If you switch templates later, these names help Blogger determine how best to transfer over your content. However, you can use different names, if you like.It is optional.

 maxwidgets -   The maximum number of widgets to allow in this section. If you don't specify a limit, there won't be one. It is optional.

 showaddelement  - Can be 'yes' or 'no,' with 'yes' as the default. This determines whether the Page Elements tab will show the 'Add a Page Element' link in this section.It is optional

 growth - Can be 'horizontal' or 'vertical,' with 'vertical' as the default. This determines whether widgets within this section are arranged side-by-side or stacked.It is optional

STEP TWO:Define widget :

<b:widget id="header" type='HeaderView' locked="yes"/>

 Widget attribute:
  • id – (Required) May contain letters and numbers only, and each widget ID in your template should be unique. A widget's ID cannot be changed without deleting the widget and creating a new one.
  • type – (Required) Indicates the kind of widget.
  • locked – (Optional) Can be “yes” or “no,” with “no” as the default. A locked widget cannot be moved or deleted from the Page Elements tab.
  • title – (Optional) If no display title is specified, a default title such as “List1” will be used.
  • pageType – (Optional) Can be “all,” “archive,” “main,” or “item,” with “all” as the default. The widget will display only on the designated pages of your blog. (All widgets display on the Page Elements tab, regardless of their pageType.)
  • mobile – (Optional) Can be “yes”, ”no,” or “only” with “default” as the default. This decides if the widget will be displayed on mobile or not. Only Header, Blog, Profile, PageList, AdSense, Attribution will be displayed on mobile when the mobile attribute is “default.”
The types of widgets that can be specified are:
  • BlogArchive
  • Blog
  • Feed
  • Header
  • HTML
  • SingleImage
  • LinkList
  • List
  • Logo
  • BlogProfile
  • Navbar
  • VideoBar
  • NewsBar

 You can use default widget or create one of your's , We will discuss it in next tutotrial.

SUMMING UP:
A sample  code of <b:section > and <b:widget> is

<b:section id="header"  >
<b:widget id="logo" type='HeaderView' locked="yes"></b:widget>
</b:section>
 

No comments:

Post a Comment