Template:Panorama: Difference between revisions

From AnthroWiki
(Created page with "<onlyinclude><includeonly>{{#if: {{Isnumeric|{{{2|}}}}}|<div class={{#switch:{{{float|}}}|left="float-left"|right="float-right"|#default=""}} style="max-width:{{{4|100%}}}; ma...")
 
No edit summary
 
Line 1: Line 1:
<onlyinclude><includeonly>{{#if: {{Isnumeric|{{{2|}}}}}|<div class={{#switch:{{{float|}}}|left="float-left"|right="float-right"|#default=""}} style="max-width:{{{4|100%}}}; margin-left:auto; margin-right:auto;"><div class="thumbinner centered panorama" style="max-width:{{#expr:{{{2}}} + 2}}px; width: 100%; width: inherit;"><div class="thumbimage" style="overflow-y:hidden; overflow-x:scroll; overflow:auto; width:100%; width:inherit; {{#ifeq:{{{dir|}}}|rtl|direction:rtl;}}">[[File:{{{1}}}|{{{2}}}px|alt={{{alt|}}}]]</div>{{#if: {{{3|}}}|<div class="thumbcaption" style="text-align: {{{text-align|center}}};"><div class="magnify">[[:File:{{{1}}}|{{int:Thumbnail-more}}]]</div><div style="float:right; margin:0 3px">[[Datei:Magnifying glass.png|12x12px|link=//tools.wmflabs.org/zoomviewer/?flash=no&f={{urlencode:{{{1}}}}}|alt=|Interactive image viewer]]</div>{{#ifeq:{{{text-align|center}}}|center|<div style="float:left; width:30px; height:12px;"></div>}}{{{3}}}</div>|<div style="display:none">[[Template:Panorama/Maintenance/Picture description missing]]</div>}}</div></div>|<div class="error" style="text-align:center; border:3px solid #ff0000; max-width:100%">File:{{{1|}}}: Please enter a total width '''without''' unit.<span style="display: none">[[Template:Panorama/Maintenance/Width with unit]]</span></div>}}{{#if:{{{4|}}}|<span style="display: none">[[Template:Panorama/Maintenance/Para4]]</span>}}</includeonly></onlyinclude>
<onlyinclude><includeonly>{{#if: {{Isnumeric|{{{2|}}}}}|<div class={{#switch:{{{float|}}}|left="float-left"|right="float-right"|#default=""}} style="max-width:{{{4|100%}}}; margin-left:auto; margin-right:auto;"><div class="thumbinner centered panorama" style="max-width:{{#expr:{{{2}}} + 2}}px; width: 100%; width: inherit;"><div class="thumbimage" style="overflow-y:hidden; overflow-x:scroll; overflow:auto; width:100%; width:inherit; {{#ifeq:{{{dir|}}}|rtl|direction:rtl;}}">[[File:{{{1}}}|{{{2}}}px|alt={{{alt|}}}]]</div>{{#if: {{{3|}}}|<div class="thumbcaption" style="text-align: {{{text-align|center}}};"><div class="magnify">[[:File:{{{1}}}|{{int:Thumbnail-more}}]]</div><div style="float:right; margin:0 3px">[[File:Magnifying glass.png|12x12px|link=//tools.wmflabs.org/zoomviewer/?flash=no&f={{urlencode:{{{1}}}}}|alt=|Interactive image viewer]]</div>{{#ifeq:{{{text-align|center}}}|center|<div style="float:left; width:30px; height:12px;"></div>}}{{{3}}}</div>|<div style="display:none">[[Template:Panorama/Maintenance/Picture description missing]]</div>}}</div></div>|<div class="error" style="text-align:center; border:3px solid #ff0000; max-width:100%">File:{{{1|}}}: Please enter a total width '''without''' unit.<span style="display: none">[[Template:Panorama/Maintenance/Width with unit]]</span></div>}}{{#if:{{{4|}}}|<span style="display: none">[[Template:Panorama/Maintenance/Para4]]</span>}}</includeonly></onlyinclude>
{{Documentation}}
{{Documentation}}

Latest revision as of 07:09, 27 June 2021

<templatestyles src="Module:Documentation/styles.css"></templatestyles>

Template documentation[view] [edit] [history] [purge]
This template can cause unexpected effects if not properly integrated and when printed. It should therefore only be used with images that are at least four times as wide as they are high and whose width exceeds 800 pixels.


This template creates a frame for an image with automatic horizontal scrolling. The scroll appears as soon as the image is wider than the browser window. The template is therefore suitable for wide images, such as panoramas.

The use is similar to [[File: ... ]] or [[Image: ... ]]:

{Panorama|Filename|Total Image Width|Description|Visible Width}.
  • Filename is the filename of the image, without "File:" or "Image:", so for example "Panorama-Sunset_at_Königswalde.jpg"
  • Total image width specifies the desired width of the image without the unit px, for example "1500"
  • The Description can also be omitted, but a short description of the image is usually desirable, for example "Sunset at Königswalde".
  • The visible width specifies the width of the "window" in which the image should appear. The unit must be specified here, in px, em or percent. If no description is given, the third field must be left blank.

As an example, this would result in:

Simple
{{Panorama|An Teallach panorama.jpg|1500|360°-Panorama from Scotland (Sgurr Fiona, An Teallach)}}
360°-panorama from Scotland (Sgurr Fiona, An Teallach)
With 60% visible width
{{Panorama|An Teallach panorama.jpg|1500|360°-panorama from Scotland (Sgurr Fiona, An Teallach)|60%}}
360°-panorama from Scotland (Sgurr Fiona, An Teallach)
Template:Panorama/Maintenance/Para4
With 70% visible width and no description
{{Panorama|An Teallach panorama.jpg|1500||70%}}
Template:Panorama/Maintenance/Para4