Template:FileCaption/doc

From WikiCorporates
Jump to navigation Jump to search

Template Experimenting with an image at the top right of the page, on the same line as the Page Title.

ToDo: Rename this to "Img Titlebar" or some such.

How big the image can be is determined by (a) <h1> lineheight (1.3) and (b) <h1> top margin (0). An image taller than 50px is obscured by the Search box.

Path is set to http://wikipolitiks.local/Images/

Usage

{{Img Title
|image-name.png  - the filename of the image
|50              - width
|50              - height
}}

Example

{{Img Title|Influencers.svg|50|50}}

Gives the image at the top right of this page. Template:Img Title

ToDo

This template only works for external images, ie. not stored in the database. It doesn't seem possible to have an internal link - I want to link to the top-level Category, eg. "Category:Influencers". See Mediawiki Help:Images
For internal images, I will have to do the following. The downside is that the height is hard-wired into the .css:

Put a style in MediaWiki:Common.css
  .img-title { position:absolute; top:-50px; right:0; }  (''done'')
Then:
  [[File:Foreign-Policy-Centre.png|182x50px|class=img-title|link=Category:Influencers]]