Jump to content

Portals

From mediawiki.org

How to use the Wikipedia portal technology

[edit]

The objective of this document is to simplify the implementation of a Wikipedia-style portal in a normal Mediawiki system. This was tested with version 1.17 of Mediawiki.

References

[edit]

Prerequisites

[edit]
  • Copy/import the templates and other documents, an example of which is available here. Note that these were copied from Wikipedia, then modified to correct some inconsistencies. The templates were mostly ok, there were problems in the naming of "box-header" and "box-footer" in some places. Also, there were document prefixes missing ({{FULLPAGENAME}}) in some places.

Steps

[edit]

To create a new portal on the topic "Topic" using the {{box portal skeleton}} follow these steps:

1. Create a new page using [[Portal:Topic]] as the title of the page (where "Topic" is the subject of your portal) and enter the following text
{{subst:box portal skeleton}}

Save

This will create a skeleton of the portal, for modification. You need to modify the overall layout and define the sections that you want, for example "Selected Articles", "News", "Photos", etc. There are basically two types of sections: fixed information, and randomly selected information. The fixed sections can be used for constant information, like the portal overview or tasks to be completed. The random sections can be used for information which constantly changes in order to generate interest in the user for making a repeat visit to the portal, like photos, "did you know this", etc. The pre-defined sections in the skeleton are simply examples and will almost certainly need to be adjusted.

2. To define the format of the subpages, which are the box sections on the portal page, click the template links to the subpage header and footer which will be found near the top of your new portal page. You can modify the appearance of the section boxes by modifying the "box-header" document.
{{Template:Box-header | title={{{1}}} 
|editpage={{{2}}} 
|border=#aaaaaa           <!-- This is the color of the borders around Box Sections -->
|titleforeground=white    <!-- This is the color of the Box Section Title Bar text -->
|titlebackground=#aaccff  <!-- This is the color of the Box Section Title Bar -->
|background=#f9f9ff       <!-- This is the color of the Box Section background -->
|foreground=black}}       <!-- This is the color of the Box Section text -->
{{Template:Box-footer | {{{1}}} }}
3. Modify the Template:Browsebar document to design the browse bar which appears at the top of all portal pages. Note that the example provided is from Wikipedia. This format requires a Portal:Contents/Portals document. Depending on the number of portals in your system, you can modify the design to suit your needs. You can also remove the reference to {{browsebar}} from your Portal:Topic page if you don't require a browse bar.
4. Place a link to your portal at the top of an appropriate article (of the same or different name) by placing a {{portal}} there. If the article name is different than the portal name, use {{portal|portal name}}.

For an explanation of how and why this format works go here.

To define an icon for the portal, create a document Template:Portal/Images/Topic with the text:

<noinclude>{{pp-template}}</noinclude>MyTopicIcon.svg

Upload the image "MyTopicIcon.svg". Now your icon will appear where the {{portal}} template is used.

5. Update {{Number of portals}} if desired.
At this point, you have created a Portal under construction. It is a framework with a lot of red links where content should go. A fair amount of work is still necessary to turn a skeleton portal into one ready for browsing. The first thing to do is to decide on the layout and naming for the box sections (subpages), and identifying which ones will be fixed data and which ones will be random.
6. Return to your portal page Portal:Topic and begin editing (general instructions on editing a portal are below). Basically follow the red links to create sub-pages that will fill the boxes.
7. Consider the first box in the skeleton as an example of a fixed section. The title bar should contain the name of your topic, and the contents should have Portal:Topic/Intro. Click on the link in the contents to create the "Intro" article. When saved, this article will then appear as the contents of the section.

The fixed sections are defined, for example, in this manner, using the "box-header" template:

<div style='float:right; width:44%'>
{{{{FULLPAGENAME}}/box-header|Things to do|{{FULLPAGENAME}}/Opentask|}}
{{{{FULLPAGENAME}}/Opentask}}
{{{{FULLPAGENAME}}/box-footer|}}
</div>

In this case, "Things to do" is the title of the section, and Portal:Topic/Opentask is the name of the article to be placed in the box.

8. Consider the second box in the skeleton as an example of a random section. The title bar should have "Selected article" as the title, and the content should have several "red" links. There are two types of random selections, see w:Template:Random portal component and w:Template:Random portal component with nominate for a discussion on how they work and which one to use.

The random sections resemble:

{{Random portal component with nominate
|max=5
|header=Selected article summary
|footer=More articles...
|subpage=Selected article}}

In this case, the title is "Selected article summary", the article summaries are located under Portal:Topic/Selected article, there are 5 articles (named Portal:Topic/Selected article/1 to Portal:Topic/Selected article/5), and the footer (link to Portal:Topic/Selected article) is "More articles...".

The random selection sections require some support documents which need to be created first:

Document Portal:Topic/Selections/Layout (used to format the content of the section box)

{{#if:{{{image}}}|<div style='float:left;margin-right:1em'>[[Image:{{{image}}}|100px|{{{caption}}}]]
</div>}}{{{text}}} 

{| class='noprint' width='100%'  border='0' style='padding: 0; margin: 0; background-color:transparent'
|-
| ||
 <div style='text-align:right;margin-right:10px;margin-bottom:4px;'>
'''[[{{{link}}}|Read more...]]'''
 </div >
|}<noinclude>

== Layout template ==
<pre>
{{Portal:Principal/Selections/Layout
  |image=
  |caption=
  |text=
  |link=
}}
</pre>
</noinclude>

Document Portal:Topic/Selections (used to show and manage documents in the section)

__NOTOC__
== Usage ==
The template used for the creation of these sub-pages is located at [[{{FULLPAGENAME}}/Layout]]
# Select an existing article to add
# Copy format text from [[{{FULLPAGENAME}}/Layout]]
# Add a new Selected article to the next available subpage by clicking its red link
# Paste format text then fill in image and caption, if any, text (summary of article), and article link
# Update "max=" to new total for its {{tl|Random portal component}} on the main portal page.
{{purgepage}}

{{Numbered subpages}}

{{purgepage}}

At this point, you can add your documents to the list in Portal:Topic/Selections by following the instructions at the top of the page. By default, there are 50 available articles. This can be changed by editing the {{Numbered subpages}} template.

See also

[edit]