From FamilySearch Wiki
Revision as of 17:29, 18 October 2013 by Ccsmith (talk | contribs) (How to create a sidebar)

Jump to: navigation, search

What is a sidebar

Sidebar is a term that refers to various forms of information that is displayed in a box, with or without borders, to the side of an article. You can display text, images, widgets, etc. in them.

What is the purpose of sidebars?

The purpose of the sidebars is to isolate the material in it from any changes in the main article that might affect the location or arrangement of the material in the sidebar.

What are the advantages of sidebars

It has the advantage of being updatable without having to go each of the articles where the sidebar may appear. This very important if you have a particular sidebar on many pages. You simply go to the sidebar article and made whatever changes you want. Then, when someone goes to any of the pages where the sidebar appears, they will see the updated material. Again, this material will appear on all the articles where the sidebar is imbedded.

How to create a sidebar

Probably the easiest way is to create sidebars is to use “div” tags. For example: <div>text</div>. But to control the width and the location of the sidebar you must include the width and its desired location on the page.

This is an example for setting the width and location of the sidebar: <div style=”width:25%; float:left;”>text</div>. In this example, the width is set to 25% of the total page width and the sidebar is to float on the left side of the article and will do so at the location you set it. Click here to see the article for the Template:Example-sidebar on this page

Since you have set a width to your sidebar, you must set a width to the material in the article itself. Otherwise the material in the article you imbedded the sidebar in will be pushed down the page below the sidebar.

To control the width of the material to the side of the sidebar, you can use <div></npowiki> tags. You can enclosed all the material just like was done with the sidebar. Example: <nowiki><div style="width:75%; float:right;">article material</div>. Notice that you need to put in the float:right so the material will appear at the top of the page instead of remaining below the sidebar.

Pay close attention to the width of your sidebar. If it is too wide you might find some of the material in the imbedded article pushed down the page. If this happens check for the width of the material in the main article and either change its width or the width on the sidebar.

How to embed a sidebar

Type the following: {{Name of sidebar-sidebar}} where you want the sidebar to appear. It can be placed anywhere on the page. It will begin where you place it. So, if you put it at the top, it will appear at the top. If you place it half way down the page, it appear somewhere in the middle of the article.

How to edit a sidebar

To edit a sidebar, you treat it just like a regular article. Click on the "Edit This Page" button on the sideba page and make whatever changes you want just as you do on any article in the Wiki.