stephane ancelot wrote:
Hi,
I would like to setup a template to add a photo in each user page
a default photo will be used first and the user could change it later.
Best Regards
steph
We do something similar here for employee profile pages using a
parameterized template
(http://www.mediawiki.org/wiki/Help:Templates#Using_parameters_in_templates)
in a "float: right" div.
Template:Employee consists of:
<div style="margin-left: 5px; float: right;">
{| class="cfbasic" style="width:400px; font-face: 10px;"
| colspan="3" align="center" | <big>'''{{{FullName}}}'''</big>
[mailto:{{{UserName}}}@collaborativefusion.com
{{{UserName}}}@collaborativefusion.com]
|-
|
rowspan="9"|[[Image:{{{Photo_Image|No_image.jpg}}}|thumb|175px|center|{{{FullName}}}]]||'''Department'''||{{{Department}}}
|-
|'''Position''' || {{{Position}}}
|-
|'''Office'''||{{{Office}}}
|-
|'''Cell'''||{{{Cell}}}
|-
|'''Pager'''||{{{Pager| }}}
|-
|'''Home'''||{{{Home| }}}
|-
|}
</div>
Then on my user page, I add:
{{Template:Employee |
FullName = Sean McAfee |
Photo_Image = Sean.jpg |
Department = [[System Operations]] |
Position = System Administrator |
UserName = smcafee |
Office = 555-555-5555 |
Pager = 555-555-5555 |
Cell = 555-555-5555 |
}}
It's a little more than just a photo, but the idea is the same. Default
values for a field are specified by placing a pipe ( the | character)
after the field definition in the template. In this one, users without
an image specified on their page get something similar to
http://ottawa.rent-index.com/housingImages/no_image.gif.
--
Sean McAfee
System Engineer
Collaborative Fusion, Inc.
smcafee@collaborativefusion.com
412-422-3463 x 4025
5849 Forbes Avenue
Pittsburgh, PA 15217
****************************************************************
IMPORTANT: This message contains confidential information
and is intended only for the individual named. If the reader of
this message is not an intended recipient (or the individual
responsible for the delivery of this message to an intended
recipient), please be advised that any re-use, dissemination,
distribution or copying of this message is prohibited. Please
notify the sender immediately by e-mail if you have received
this e-mail by mistake and delete this e-mail from your system.
E-mail transmission cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses. The
sender therefore does not accept liability for any errors or
omissions in the contents of this message, which arise as a
result of e-mail transmission.
****************************************************************
IMPORTANT: This message contains confidential information and is intended only for the individual named. If the reader of this message is not an intended recipient (or the individual responsible for the delivery of this message to an intended recipient), please be advised that any re-use, dissemination, distribution or copying of this message is prohibited. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.