#summary How to use multiple content sections = Introduction = The [http://code.google.com/apis/gadgets/docs/spec.html 1/28/2008 Gadget specification] introduces support for multiple content sections in a single gadget XML file. This page provides example code for utilizing this functionality. = Details = You are now allowed to include more than one `` section in a gadget XML file. All Content sections should be siblings in the document tree, and may use the optional parameter `view=` to define the views in which they should render. ==Two content sections== The following code shows a superficial example. {{{ Profile ]]> Canvas ]]> }}} The output on the above gadget is as follows: *Profile view* {{{

Profile

}}} *Canvas view* {{{

Canvas

}}} *Any other views that are not canvas or profile* _no content is displayed_ ==Content sections with multiple views specified== Content sections may specify multiple views, separated by commas: {{{ Canvas and Profile ]]> }}} The output on the above gadget is as follows: *Profile view* {{{

Canvas and Profile

}}} *Canvas view* {{{

Canvas and Profile

}}} *Any other views that are not canvas or profile* _no content is displayed_ ==Content section with view specified and no default content section== If you specify a content section with a view parameter, that content section is only shown on that view. Without specifying a default content section, other views will not display any content. {{{ Profile ]]> }}} The output on the above gadget is as follows: *Profile view* {{{

Profile

}}} *Canvas view* _no content is displayed_ *Any other views that are not canvas or profile* _no content is displayed_ ==Content section with view specified and a default content section== To specify a default content section, simply define a content section with no view parameter. {{{ Profile ]]> Default ]]> }}} The output on the above gadget is as follows: *Profile view* {{{

Profile

}}} *Canvas view* {{{

Default

}}} *Any other views that are not canvas or profile* {{{

Default

}}} == Full example == You can use all of these techniques in one gadget file. {{{ Profile ]]> Canvas ]]> This shows up in canvas and profile views ]]> Default

The content in this section only shows up if no other content sections are applicable

]]>
}}} The output on the above gadget is as follows: *Profile view* {{{

Profile

This shows up in canvas and profile views

}}} *Canvas view* {{{

Canvas

This shows up in canvas and profile views

}}} *Any other views that are not canvas or profile* {{{

Default

The content in this section only shows up if no other content sections are applicable

}}}