Difference between revisions of "Template:Prof"

From AIRWiki
Jump to: navigation, search
m
 
(21 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<noinclude>This template simplifies the creation of articles about professors/researchers. When inserted in a person's page, it creates a decorative table with much helpful information. It also takes care of annotating the given data semantically, so that users can easily find it or query it in other articles. Do not try to read this page's source code for learning table syntax &ndash; there are far easier ways of creating tables in MediaWiki.
+
<noinclude>This template simplifies the creation of articles about professors. When inserted in a person's page, it creates a decorative table with much helpful information. It also takes care of annotating the given data semantically, so that users can easily find it or query it in other articles. Do not try to read this page's source code for learning table syntax &ndash; there are far easier ways of creating tables in MediaWiki.
  
 
To use this template, insert the following at the beginning of your user page. All fields are strictly '''optional''' and should be omitted if no data is given.
 
To use this template, insert the following at the beginning of your user page. All fields are strictly '''optional''' and should be omitted if no data is given.
  
 
'''Please delete all lines that you do not give useful information for!'''
 
'''Please delete all lines that you do not give useful information for!'''
<pre>{{UserPhD
+
<pre>{{Prof
 
  | firstname=Mario
 
  | firstname=Mario
 
  | lastname=Rossi
 
  | lastname=Rossi
Line 11: Line 11:
 
  |        ***NOTE:*** you can specify a LIST of research areas, separating them with a semicolon (;)
 
  |        ***NOTE:*** you can specify a LIST of research areas, separating them with a semicolon (;)
 
  | photo=name of picture (e.g. "Mario.jpg"), use "upload file" on the left
 
  | photo=name of picture (e.g. "Mario.jpg"), use "upload file" on the left
 +
| status=active or inactive
 
}}</pre>
 
}}</pre>
 
The order of the fields is not relevant. The template should be given as the ''first'' thing on a page.
 
The order of the fields is not relevant. The template should be given as the ''first'' thing on a page.
  
 
</noinclude><includeonly>
 
</noinclude><includeonly>
{| align="right" cellpadding="2" cellspacing="0" width="350px"
+
{| style="padding:0px" align="right" cellpadding="2" cellspacing="1" width="250px"
  
 
|-
 
|-
Line 21: Line 22:
  
 
|-
 
|-
{{#ifeq:{{{photo|}}}|||{{Tablelongrow|Value='''[[Image:{{{photo}}}|200px|Foto di {{PAGENAME}}]]'''}}}}
+
{{#ifeq:{{{photo|}}}|||{{Tablelongrow|Value='''[[Image:{{{photo}}}|250px|Foto di {{PAGENAME}}]]'''}}}}
 
+
<!--
 
|-
 
|-
 
{{#ifeq:{{{firstname|}}}|||{{Tablerow|Label=First Name|Value={{{firstname}}}}}}}
 
{{#ifeq:{{{firstname|}}}|||{{Tablerow|Label=First Name|Value={{{firstname}}}}}}}
Line 29: Line 30:
 
{{#ifeq:{{{lastname|}}}|||{{Tablerow|Label=Last Name|Value={{{lastname}}}}}}}
 
{{#ifeq:{{{lastname|}}}|||{{Tablerow|Label=Last Name|Value={{{lastname}}}}}}}
  
 +
-->
 
|-
 
|-
 
{{#ifeq:{{{email|}}}|||{{Tablerow|Label=E-Mail|Value={{Mailbox|{{{email}}}}}}}}}
 
{{#ifeq:{{{email|}}}|||{{Tablerow|Label=E-Mail|Value={{Mailbox|{{{email}}}}}}}}}
 +
|-
 +
{{#ifeq:{{{resarea|}}}|||{{#arraymap:{{{resarea|}}}|;|x|[[hasResArea::x| ]]|}}}}
 +
<!-- NOTE: this solution for research areas is nicer to see, but it doesn't work fine
 +
          with areas whose name contains the sequence of chars ", " as it's used as
 +
          a separator for ASK results-->
 +
{{Tablerow|Label=Research Areas|Value=<ul>{{#arraymap:{{#show: User:{{PAGENAME}} | ?hasResArea }}|, |x|<li>x</li>|}}</ul>}}
  
|-
+
<!--{{Tablerow|Label=Research Areas|Value={{#show: User:{{PAGENAME}} | ?hasResArea }}}}-->
<!-- {{#ifeq:{{{resarea|}}}|||{{#arraymap:{{{resarea|}}}|;|x|[[hasResArea::x| ]]|}}}}
+
<!--|-
{{Tablerow|Label=Research Areas|Value=<ul>{{#arraymap:{{#ask: [[User:{{PAGENAME}}]] | ?hasResArea= }}|, |x|<li>x</li>|}}</ul>}} -->
+
{{#ifeq:{{{status|}}}|||{{Tablerow|Label=Status|Value=[[userStatus::{{{status}}}]]}}}}-->
{{#ifeq:{{{resarea|}}}|||{{#arraymap:{{{resarea|}}}|;|x|{{Tablerow|Label=Research Area|Value=[[hasResArea::x]]|}}}}
+
|}[[Category:Prof]]</includeonly>
|}[[Category:PhD]]</includeonly>
+

Latest revision as of 23:26, 17 August 2017

This template simplifies the creation of articles about professors. When inserted in a person's page, it creates a decorative table with much helpful information. It also takes care of annotating the given data semantically, so that users can easily find it or query it in other articles. Do not try to read this page's source code for learning table syntax – there are far easier ways of creating tables in MediaWiki.

To use this template, insert the following at the beginning of your user page. All fields are strictly optional and should be omitted if no data is given.

Please delete all lines that you do not give useful information for!

{{Prof
 | firstname=Mario
 | lastname=Rossi
 | email=mario.rossi@elet.polimi.it
 | resarea=The name of your research area
 |         ***NOTE:*** you can specify a LIST of research areas, separating them with a semicolon (;)
 | photo=name of picture (e.g. "Mario.jpg"), use "upload file" on the left
 | status=active or inactive
}}

The order of the fields is not relevant. The template should be given as the first thing on a page.