Welcome to Warhammer 40k - Lexicanum! Log in and join the community.

Template:Portal/doc

From Warhammer 40k - Lexicanum
Jump to: navigation, search

This template is part of a set of templates designed to streamline the portals look and feel.

Usage

The basic usage is

{{Portal}}

<div style="margin: 10px">

{{Portal Header|Icon=Icon.jpg|Box Content=
Main Intro
}}

Other content 

</div>
|}

As you can see there is the need of a DIV element to put some margin, and a "|}" to close the table at the end of the block.

Explaination

But let's explain what each row does.

{{Portal}}

Includes the portal navigation template (Template:Portalsnav) and opens the table that provides the base background colour (usually the darker one)

<div style="margin: 10px">

Adds some padding in a safe way, I could have tried to do it inside this template but mediawiki closes the div right after the end of the template. In other words, it's quick and dirty, but it works.

{{Portal Header|Icon=Icon.jpg|Box Content=
Main Intro
}}

Calls the main header template (Template:Portal Header) to display the introduction of the Portal along with an icon (resized to 100px wide), Box Content holds the content of the introduction box, usually a relevant quote in Race Portals.

Other content

The other boxes, the simplest way to add boxes or headings with no boxes is to use Template:Portal Box Template:Portal Heading.

</div>
|}

Closure of the 'safe padding' and the coloured container, again it's quick and dirty, but it works.

Look and feel

The look of every element can be changed by creating some templates with css code inside.

Every table/element includes a template inside his style parameter, basically it works like this

<div style="misc style rules;{{style template}}"><h2>''{{{Box header}}}''</h2></div>

Not only both Template:Portal,Template:Portal Header,Template:Portal Headingand Template:Portal Box use different templates, the template included is also relative to the page it is included into.

IE.: if in Portal:Test I put a Template:Portal Box, the resulting box will include the styles from Template:Portal Box Head Styles/Portal:Test for the box title and Template:Portal Box Styles/Portal:Test for the lower box part, where the content is. As you can see the path is Template:Portal Box Head Styles/Portal:Test so the Portal Box template automatically switches Portal Box Head Styles/Portal Box Styles based on which page it is included into. You can force a different style by using the parameter Style, in this way you can have different looking boxes in a single page.

This page uses Template:Portal Main Table Styles/Portal, Template:Portal Header Styles/Portal, Template:Portal Box Head Styles/Portal and Template:Portal Box Styles/Portal.

ANY kind of css rule is allowed there, but it's best to keep them simple, and alter the main templates in case that all the portals need that style change.

Simplyfied skeleton

To be used for copy-paste.

{{Portal}}

<div style="margin: 10px">

{{Portal Header|Icon=|Box Content=
<p style="text-align:center;padding-left:100px">''''' '''''<br />
'''--'''</p>
}}

{{Portal Heading|Title=Important Articles}}

<div style="float: left; width: 58%;">



</div>

<div style="float: right; width: 41%;">



</div>

<div style="clear:both">
{{Portal Heading|Title=Portal Maintenance|Box Content=}}
</div>

<div style="float: left; width: 58%;">

{{Portal Box
|Title=Recently Added/Modified
|Box Content=

}}

</div>

<div style="float: right; width: 41%;">

{{Portal Box
|Title=Requested Articles
|Box Content=

}}

</div>

</div>
|}

==Sources==
* 

[[Category:Portals|]]
[[Category:]]

Real-life example

{{Portal}}

<div style="margin: 10px">

{{Portal Header|Icon=ServiceImage.jpg|Box Content=
<p style="text-align:center">
'''''Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 
Nunc adipiscing aliquet ligula. Praesent at magna. 
Mauris sit amet lorem et nulla lobortis pulvinar. 
Morbi luctus, enim vitae euismod tincidunt, metus justo sollicitudin augue, 
et feugiat lacus urna sed ligula.'''''<br />
'''--Drunken dude'''</p>
}}

{{Portal Heading|Title=Important Articles}}

<div style="float: left; width: 58%;">

{{Portal Box
|Title=Important stuff
|Box Content=
'''Seriously important'''

* [[thing1]]
* [[thing2]]
* [[thing3]]
* [[thing4]]
}}

{{Portal Box
|Title=More stuff
|Box Content=
'''Seriously important'''

* [[anotherthing1]]
* [[anotherthing2]]
* [[anotherthing3]]
* [[anotherthing4]]
}}

{{Portal Box
|Title=Last stuff
|Box Content=
It's not just about list, you can freely put long text, just like 
I'm doing here, all the wiki stuff works.
}}

</div>

<div style="float: right; width: 41%;">

{{Portal Box
|Title=Spotlight on things
|Box Content=
[[Image:ServiceImage.jpg|right|thumb|200px]]
Image test with other things.

}}

{{Portal Box
|Title=I really don't know what to put here
|Box Content=
So I'll just slap squigs around, you never go wrong with squigs
* [[Squigs]]
* [[Squigs]]
* [[Squigs]]
* [[Squigs]]

[[Squigs]],[[Squigs]], [[Squigs]].

<table>
   <tr>
      <td>[[Squigs]]</td>
      <td>[[Squigs]]</td>
   </tr> 
   <tr>
      <td>[[Squigs]]</td> 
      <td>[[Squigs]]</td> 
   </tr>
</table>

}}

</div>

<div style="clear:both">
{{Portal Heading|Title=Portal Maintenance|Box Content=}}
</div>

<div style="float: left; width: 58%;">
{{Portal Box
|Title=Recently Added/Modified
|Box Content=
* [[Special:Recentchanges]] Lame link I know.
}}
</div>

<div style="float: right; width: 41%;">
{{Portal Box
|Title=Requested Articles
|Box Content=
* [[Special:Wantedpages]] Lame link I know.
}}
</div>

</div>
|}

==Sources==
* <sup>1</sup> [[Lipsum]].

[[Category:Portals|Example]]
[[Category:Help|Portals]]

Result

This produces:


Portals :
Adeptus MechanicusAstra MilitarumChaosDark EldarEldarImperiumNecronsOrksSpace MarinesTauTyranids
LexicanumPublicationsQuotesGalaxyMiniaturesGames


Portal/doc

ServiceImage.jpg

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.Nunc adipiscing aliquet ligula. Praesent at magna.Mauris sit amet lorem et nulla lobortis pulvinar.Morbi luctus, enim vitae euismod tincidunt, metus justo sollicitudin augue,et feugiat lacus urna sed ligula.
--Drunken dude

.

Important Articles

Important stuff

Seriously important

.

More stuff

Last stuff

It's not just about list, you can freely put long text, just like I'm doing here, all the wiki stuff works.

.

Spotlight on things

ServiceImage.jpg

Image test with other things.

.

I really don't know what to put here

So I'll just slap squigs around, you never go wrong with squigs

Squigs,Squigs, Squigs.

Squigs Squigs
Squigs Squigs
.

Portal Maintenance

Recently Added/Modified

.

Requested Articles

.

Sources