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
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.
mediawiki-l@lists.wikimedia.org