«ܘܝܩܝܦܕܝܐ:NavFrame»: ܦܘܪܫܐ ܒܝܢܝ ܬܢܝܬ̈ܐ

ܡܢ ܘܝܩܝܦܕܝܐ، ܐܝܢܣܩܠܘܦܕܝܐ ܚܐܪܬܐ
Content deleted Content added
ܙ ܒܘܛ: ܫܘܢܝܐ ܕ ܐܣܘܪ̈ܐ ܕܐܢܛܪܘܝܩܝ, ܐܝܬ ܗܫܐ ܒܘܝܩܝܓܠܝܬ̈ܐ ܥܠ d:q13395701
ܙ Bot: Replace deprecated <source> tag and "enclose" parameter; ܫܘܚܠܦ̈ܐ ܫܘܦܪ̈ܢܝܐ
 
ܣܪܛܐ 1: ܣܪܛܐ 1:
{{notice|The use of NavFrame for tables has been deprecated in favor of [[Wikipedia:Collapsible tables|collapsible tables]] since September 2007. NavFrame is still useful for non-table content.}}
{{notice|The use of NavFrame for tables has been deprecated in favor of [[ܘܝܩܝܦܕܝܐ:Collapsible tables|collapsible tables]] since September 2007. NavFrame is still useful for non-table content.}}
{{shortcut|WP:NAVFRAME}}
{{shortcut|WP:NAVFRAME}}
Documentation for '''dynamic navigation boxes'''.
Documentation for '''dynamic navigation boxes'''.


Dynamic navigation boxes use a combination of [[CSS]] and [[Javascript]] to make collapsible navigation boxes. The technical parts comprise style sheet declarations in [[MediaWiki:Common.css]], and Javascript code in [[MediaWiki:Common.js]].
Dynamic navigation boxes use a combination of [[CSS]] and [[Javascript]] to make collapsible navigation boxes. The technical parts comprise style sheet declarations in [[ܡܝܕܝܐܘܝܩܝ:Common.css]], and Javascript code in [[ܡܝܕܝܐܘܝܩܝ:Common.js]].


Example (click "show" or "hide" to see the good bits):
Example (click "show" or "hide" to see the good bits):
ܣܪܛܐ 11: ܣܪܛܐ 11:
From: [[User:Mzajac/Soviet-legacy_AFV_Navbox]].-->
From: [[User:Mzajac/Soviet-legacy_AFV_Navbox]].-->


==How to use==
== How to use ==
===NavFrame divs===
=== NavFrame divs ===
The basic concept here is to use the [[Span and div|'''div''']] [[HTML element|element]] within a Wiki article's markup code to identify certain content (which we'll call the "details" here) that we want the user to be able to "show" or "hide". The markup code used to achieve this effect comprises three main classes: <code>'''NavFrame''', '''NavHead''', '''NavContent'''</code>.
The basic concept here is to use the [[Span and div|'''div''']] [[HTML element|element]] within a Wiki article's markup code to identify certain content (which we'll call the "details" here) that we want the user to be able to "show" or "hide". The markup code used to achieve this effect comprises three main classes: <code>'''NavFrame''', '''NavHead''', '''NavContent'''</code>.


The underlying implementation uses [[Javascript]] to add a "show" or "hide" link in the <code>NavHead</code> part, and to turn the visibility of the <code>NavContent</code> part on or off. In web browsers that do not support Javascript, or where Javascript is disabled, the content will always be displayed, and the "show"/"hide" links will not be present.
The underlying implementation uses [[Javascript]] to add a "show" or "hide" link in the <code>NavHead</code> part, and to turn the visibility of the <code>NavContent</code> part on or off. In web browsers that do not support Javascript, or where Javascript is disabled, the content will always be displayed, and the "show"/"hide" links will not be present.


The default behavior of this code will initially "show" the details, as well as a link to "hide" the details. To reverse the default behavior, so that the details are initially hidden, use <code>class="NavFrame collapsed"</code> (instead of <code>class="NavFrame"</code>) in the outer div element. Do not add <code>style="display:none;"</code> to the NavContent element, because that will make it impossible for users without Javascript to see the content.
The default behavior of this code will initially "show" the details, as well as a link to "hide" the details. To reverse the default behavior, so that the details are initially hidden, use <code>class="NavFrame collapsed"</code> (instead of <code>class="NavFrame"</code>) in the outer div element. Do not add <code>style="display:none;"</code> to the NavContent element, because that will make it impossible for users without Javascript to see the content.


====Simple example====
==== Simple example ====
You will need to create three <code>div</code> elements:
You will need to create three <code>div</code> elements:
<source lang="html4strict"><div class="NavFrame">
<syntaxhighlight lang="html4strict"><div class="NavFrame">
<div class="NavHead">[... This is the title of your collapsible content ...]</div>
<div class="NavHead">[... This is the title of your collapsible content ...]</div>
<div class="NavContent">
<div class="NavContent">
[... The content you want to hide goes here ...]
[... The content you want to hide goes here ...]
</div>
</div>
</div></source>
</div></syntaxhighlight>
<div class="NavFrame">
<div class="NavFrame">
<div class="NavHead">[... This is the title of your collapsible content ...]</div>
<div class="NavHead">[... This is the title of your collapsible content ...]</div>
ܣܪܛܐ 36: ܣܪܛܐ 36:


To initially hide the content do this:
To initially hide the content do this:
<source lang="html4strict"><div class="NavFrame collapsed">
<syntaxhighlight lang="html4strict"><div class="NavFrame collapsed">
<div class="NavHead">[... This is the title of the hidden content ...]</div>
<div class="NavHead">[... This is the title of the hidden content ...]</div>
<div class="NavContent">
<div class="NavContent">
[... This content is initially hidden ...]
[... This content is initially hidden ...]
</div>
</div>
</div></source>
</div></syntaxhighlight>
<div class="NavFrame collapsed">
<div class="NavFrame collapsed">
<div class="NavHead">[... This is the title of the hidden content ...]</div>
<div class="NavHead">[... This is the title of the hidden content ...]</div>
ܣܪܛܐ 49: ܣܪܛܐ 49:
</div>
</div>


====Mixed classes example====
==== Mixed classes example ====
You can even apply other classes along with these, making a more styled design rather than if you were to use the standard classes:
You can even apply other classes along with these, making a more styled design rather than if you were to use the standard classes:
<source lang="html4strict"><div class="messagebox standard-talk NavFrame">
<syntaxhighlight lang="html4strict"><div class="messagebox standard-talk NavFrame">
<div class="somerandomclass NavHead">
<div class="somerandomclass NavHead">
[... This is the title; it does not have to be plain text, you can get creative here ...]</div>
[... This is the title; it does not have to be plain text, you can get creative here ...]</div>
ܣܪܛܐ 57: ܣܪܛܐ 57:
[... The content you want to hide goes here ...]
[... The content you want to hide goes here ...]
</div>
</div>
</div></source>
</div></syntaxhighlight>
<div class="messagebox standard-talk NavFrame">
<div class="messagebox standard-talk NavFrame">
<div class="somerandomclass NavHead">
<div class="somerandomclass NavHead">
ܣܪܛܐ 66: ܣܪܛܐ 66:
</div>
</div>


====Getting a caption instead of a heading====
==== Getting a caption instead of a heading ====
If you swap the order of the two inner <code>div</code> elements, then you can get an always-visible caption below optionally-hidden content, instead of an always-visible heading above optionally-hidden content:
If you swap the order of the two inner <code>div</code> elements, then you can get an always-visible caption below optionally-hidden content, instead of an always-visible heading above optionally-hidden content:


<source lang="html4strict"><div class="NavFrame">
<syntaxhighlight lang="html4strict"><div class="NavFrame">
<div class="NavContent">
<div class="NavContent">
[... The content you want to hide goes here ...]
[... The content you want to hide goes here ...]
</div>
</div>
<div class="NavHead">[... This is the caption below your collapsible content ...]</div>
<div class="NavHead">[... This is the caption below your collapsible content ...]</div>
</div></source>
</div></syntaxhighlight>
<div class="NavFrame">
<div class="NavFrame">
<div class="NavContent">
<div class="NavContent">
ܣܪܛܐ 82: ܣܪܛܐ 82:
</div>
</div>


====If the title doesn't fit on one line====
==== If the title doesn't fit on one line ====
If the title is too long, then the formatting is very bad:
If the title is too long, then the formatting is very bad:
<source lang="html4strict"><div style="width: 20em">
<syntaxhighlight lang="html4strict"><div style="width: 20em">
<div class="NavFrame">
<div class="NavFrame">
<div class="NavHead">[... This is the title of your collapsible content ...]</div>
<div class="NavHead">[... This is the title of your collapsible content ...]</div>
ܣܪܛܐ 91: ܣܪܛܐ 91:
</div>
</div>
</div>
</div>
</div></source>
</div></syntaxhighlight>
<div style="width: 20em">
<div style="width: 20em">
<div class="NavFrame">
<div class="NavFrame">
ܣܪܛܐ 102: ܣܪܛܐ 102:


To correct this, you need to add <code>height: auto</code> to the style of the <code>NavHead</code> <code>div</code>, and a dummy element to leave space for the "show/hide" link:
To correct this, you need to add <code>height: auto</code> to the style of the <code>NavHead</code> <code>div</code>, and a dummy element to leave space for the "show/hide" link:
<source lang="html4strict"><div style="width: 20em">
<syntaxhighlight lang="html4strict"><div style="width: 20em">
<div class="NavFrame" style="width: 20em">
<div class="NavFrame" style="width: 20em">
<div class="NavHead" style="height:auto">
<div class="NavHead" style="height:auto">
ܣܪܛܐ 112: ܣܪܛܐ 112:
</div>
</div>
</div>
</div>
</div></source>
</div></syntaxhighlight>
<div style="width: 20em">
<div style="width: 20em">
<div class="NavFrame" style="width: 20em">
<div class="NavFrame" style="width: 20em">
ܣܪܛܐ 125: ܣܪܛܐ 125:
</div>
</div>


===Collapsible tables===
=== Collapsible tables ===
{{see main|Help:Collapsing}}
{{see main|Help:Collapsing}}
The initial state of any collapsible content can be controlled using a "collapsible table", because it also allows a table with only one element with content, and a header.
The initial state of any collapsible content can be controlled using a "collapsible table", because it also allows a table with only one element with content, and a header.


==Left-alignment==
== Left-alignment ==
To have things lined up to the left, add in this line of code <source lang="html4strict">style="text-align:left"</source> to the first (or whichever) <tt><nowiki><div></nowiki></tt> you want the text inside aligned to the left.
To have things lined up to the left, add in this line of code <syntaxhighlight lang="html4strict">style="text-align:left"</syntaxhighlight> to the first (or whichever) <tt><nowiki><div></nowiki></tt> you want the text inside aligned to the left.
<div class="NavFrame collapsed" style="text-align:left">
<div class="NavFrame collapsed" style="text-align:left">
<div class="NavHead">Left-alignment</div>
<div class="NavHead">Left-alignment</div>
ܣܪܛܐ 151: ܣܪܛܐ 151:


== Templates ==
== Templates ==
*[[Template:Hidden]]
* [[ܩܠܒܐ:Hidden]]
*[[Template:Hidden_begin]]
* [[ܩܠܒܐ:Hidden_begin]]
{{Navigational templates}}
{{Navigational templates}}


{{DEFAULTSORT:NavFrame}}
{{DEFAULTSORT:NavFrame}}
[[Category:Navigational boxes|NavFrame]]
[[ܣܕܪܐ:Navigational boxes|NavFrame]]


[[ko:위키백과:NavFrame]]
[[ko:위키백과:NavFrame]]

ܬܢܝܬܐ ܗܫܝܬܐ ܒܣܝܩܘܡ 11:41, 19 ܒܢܝܣܢ 2020

ܩܠܒܐ:Notice ܩܠܒܐ:Shortcut Documentation for dynamic navigation boxes.

Dynamic navigation boxes use a combination of CSS and Javascript to make collapsible navigation boxes. The technical parts comprise style sheet declarations in ܡܝܕܝܐܘܝܩܝ:Common.css, and Javascript code in ܡܝܕܝܐܘܝܩܝ:Common.js.

Example (click "show" or "hide" to see the good bits):

ܩܠܒܐ:WWIISovietAFVs

How to use[ܫܚܠܦ]

NavFrame divs[ܫܚܠܦ]

The basic concept here is to use the div element within a Wiki article's markup code to identify certain content (which we'll call the "details" here) that we want the user to be able to "show" or "hide". The markup code used to achieve this effect comprises three main classes: NavFrame, NavHead, NavContent.

The underlying implementation uses Javascript to add a "show" or "hide" link in the NavHead part, and to turn the visibility of the NavContent part on or off. In web browsers that do not support Javascript, or where Javascript is disabled, the content will always be displayed, and the "show"/"hide" links will not be present.

The default behavior of this code will initially "show" the details, as well as a link to "hide" the details. To reverse the default behavior, so that the details are initially hidden, use class="NavFrame collapsed" (instead of class="NavFrame") in the outer div element. Do not add style="display:none;" to the NavContent element, because that will make it impossible for users without Javascript to see the content.

Simple example[ܫܚܠܦ]

You will need to create three div elements:

<div class="NavFrame">
  <div class="NavHead">[... This is the title of your collapsible content ...]</div>
  <div class="NavContent">
    [... The content you want to hide goes here ...]
  </div>
</div>


To initially hide the content do this:

<div class="NavFrame collapsed">
  <div class="NavHead">[... This is the title of the hidden content ...]</div>
  <div class="NavContent">
    [... This content is initially hidden ...]
  </div>
</div>

Mixed classes example[ܫܚܠܦ]

You can even apply other classes along with these, making a more styled design rather than if you were to use the standard classes:

<div class="messagebox standard-talk NavFrame">
  <div class="somerandomclass NavHead">
    [... This is the title; it does not have to be plain text, you can get creative here ...]</div>
  <div class="NavContent anotherclass">
    [... The content you want to hide goes here ...]
  </div>
</div>

Getting a caption instead of a heading[ܫܚܠܦ]

If you swap the order of the two inner div elements, then you can get an always-visible caption below optionally-hidden content, instead of an always-visible heading above optionally-hidden content:

<div class="NavFrame">
  <div class="NavContent">
    [... The content you want to hide goes here ...]
  </div>
  <div class="NavHead">[... This is the caption below your collapsible content ...]</div>
</div>

If the title doesn't fit on one line[ܫܚܠܦ]

If the title is too long, then the formatting is very bad:

<div style="width: 20em">
<div class="NavFrame">
  <div class="NavHead">[... This is the title of your collapsible content ...]</div>
  <div class="NavContent">
    [... The content you want to hide goes here ...]
  </div>
</div>
</div>

To correct this, you need to add height: auto to the style of the NavHead div, and a dummy element to leave space for the "show/hide" link:

<div style="width: 20em">
<div class="NavFrame" style="width: 20em">
  <div class="NavHead" style="height:auto">
    <div class="hack-to-leave-space" style="float:right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
[... This is the title of your collapsible content ...]
  </div>
  <div class="NavContent">
    [... The content you want to hide goes here ...]
  </div>
</div>
</div>

Collapsible tables[ܫܚܠܦ]

ܩܠܒܐ:See main The initial state of any collapsible content can be controlled using a "collapsible table", because it also allows a table with only one element with content, and a header.

Left-alignment[ܫܚܠܦ]

To have things lined up to the left, add in this line of code

style="text-align:left"

to the first (or whichever) <div> you want the text inside aligned to the left.

Limitations[ܫܚܠܦ]

Currently, the three Nav* classes apply styles of their own. When mixing classes, this causes some of the Nav styles to override other styles (in the above example, NavFrame is overriding the styles from .messagebox.standard-talk).

This limitation does not affect collapsible tables.

Accessibility[ܫܚܠܦ]

All browsers from Internet Explorer 5.5 and on (IE6/7/8, Firefox, Safari/Chrome/KHTML, Opera 8/9, etc.) that support JavaScript will properly collapse the elements.

Internet Explorer 5 and browsers which do not support JavaScript will render the elements without the [hide/show] links and will not collapse them.

Templates[ܫܚܠܦ]

Navigation template comparison
ܚ · ܕ · ܫ collapsible Header color Image Groups Style (body)
parameter/s
Example
{{Navigation}} NavFrame NavHead ܠܐ ܠܐ ܐܝܢ {{OPEC}}
{{Navigation with image}} NavFrame NavHead Left/right of body ܠܐ ܐܝܢ {{HolmesNovels}}
{{Navigation with columns}} NavFrame NavHead ܠܐ ܠܐ ܐܝܢ
{{Dynamic navigation box}} collapsible navbox ܠܐ ܠܐ ܐܝܢ {{CSUHeads}}
{{Dynamic navigation box with image}} NavFrame NavHead Upper left ܠܐ ܠܐ {{SlovakPMs}}
{{Navbox generic}} collapsible navbox Right-hand side ܐܝܢ ܐܝܢ {{Dilbert}}
{{NavigationBox}} ܠܐ navbox Right of title+body ܠܐ ܠܐ {{EPA}}
{{Commons:NavigationBox}} ܠܐ #ccccff Right of title+body ܠܐ ܠܐ
{{Commons:Dynamic navigation box}} NavFrame #ccccff ܠܐ ܠܐ ܠܐ
{{Commons:Dynamic navigation box with image}}  NavFrame #ccccff Upper left ܠܐ ܠܐ
The background color for the header or title is inherited from the class listed below. The templates have titlebkg parameters that override the default.
Collapsible attributes
Type CSS classes Collapses when Custom
initial state
Nesting Header
color
Font size
NavFrame div NavFrame, NavHead, NavContent 3+ of the same ܠܐ ܐܝܢ #ccccff 95%
Collapsible table collapsible, navbox 2+ of the same ܐܝܢ ܐܝܢ #ccccff 90%

For the technically minded, see Common.css and Common.js.