Templates

From Redazione
Jump to navigation Jump to search
 
(12 intermediate revisions by the same user not shown)
Line 12: Line 12:
 
{{CI text highlight | text to highlight }}
 
{{CI text highlight | text to highlight }}
  
 +
<noinclude>
  
<noinclude>
 
 
'''inline logo'''
 
'''inline logo'''
  
Line 37: Line 37:
  
  
'''pdf thumbnail link'''
+
'''pdf thumbnail '''
  
 
<pre>
 
<pre>
{{CI pdf thumbnail link | Knuth-plass-breaking.pdf }}
+
{{CI pdf thumbnail | Knuth-plass-breaking.pdf |  Breaking paragraphs into lines | clear after = true }}
 
</pre>
 
</pre>
  
 
produces:
 
produces:
{{CI pdf thumbnail link | Knuth-plass-breaking.pdf }}
 
{{CI clear div }}
 
(a thumbnail of the first page of the pdf, with direct link to read it)
 
  
 +
{{CI pdf thumbnail | Knuth-plass-breaking.pdf | Breaking paragraphs into lines | clear after = true }}
  
 +
it shows a thumbnail of the first page of the pdf, with a direct link to it: it expects filename and optionally caption as unnamed arguments, plus a "clear after" argument, specifying whether we want to prevent subsequent elements to float (default is false), or alternatively a "clear" argument, specifying the actual value for the [https://www.w3schools.com/cssref/pr_class_float.asp float css property].
  
'''clear div'''
+
Basically, if you want to show a series of pdf thumbnails as a column, you can omit both "clear after" and "clear" arguments, if you want to display the pdf thumbnails aside  each other, you can use "clear after = false" or "clear = none". If you want let the text around to float on the left you can use "clear = right" (or "clear = left" if you want the text around floating on the right). [[File:How it works/Templates/msupload_insertpdf_arrow.jpg|thumb]]When using "clear after = false" or "clear = none" just remind to disable it for the last thumbnail otherwise the following page's section will float on the right of the element, which is usually an unwanted behavior.
  
<pre>
+
Finally, since April 2021 this template can be inserted using WikiEditor following the instructions [[How_it_works/Images_upload_%26_gallery|here]] (see picture on the right).
{{CI clear div }}
 
</pre>
 
 
 
 
 
the latter does not show anything, but avoids the elements above it to float if they are floating elements, precisely like the pdf thumbnail link above (indeed, if you look the wiki text, you will see that we have put it right below it, otherwise this paragraph would have shown on the right of the thumbnail instead than below it.
 
  
  
Line 91: Line 85:
  
 
| Why the specific weight of bread is less than ... ?
 
| Why the specific weight of bread is less than ... ?
| Because the in a right triangle the area of the square whose side is the hypotenuse is equal to the sum of the areas of the squares on the other two sides
+
| Because in a [https://en.wikipedia.org/wiki/Right_triangle right triangle] the area of the square whose side is the hypotenuse is equal to the sum of the areas of the squares on the other two sides
 
}}
 
}}
  
Line 97: Line 91:
  
 
The accordion template (technically a [https://en.wikiversity.org/wiki/Lua Lua module]) takes advantage of [[How_it_works/Front-end_features#Dynamic_components|Dynamic components]] on the front-end, so basically you can add to your pages the equivalent of a paying wordpress plugin with just few lines of wiki text.
 
The accordion template (technically a [https://en.wikiversity.org/wiki/Lua Lua module]) takes advantage of [[How_it_works/Front-end_features#Dynamic_components|Dynamic components]] on the front-end, so basically you can add to your pages the equivalent of a paying wordpress plugin with just few lines of wiki text.
 +
 +
 +
 +
 +
'''clear div'''
 +
 +
<pre>
 +
{{CI clear div }}
 +
</pre>
 +
 +
 +
the latter does not show anything, but avoids text or elements to float if there are floating elements above, for instance using a floating image thumbnail (an image with floating text on left or right).
 +
  
  
  
 
</noinclude>
 
</noinclude>

Latest revision as of 01:33, 11 April 2021

Templates are a way to insert elements commonly used among your pages by reference, and they are usually invoked with one or more parameters which will be wrapped or transformed by the template in various ways. Besides all the Wikipedia's or Mediawiki's templates which can be used or imported if missing, here are some additional templates specifically created for this platform. To use them, go to "Edit source" in the top menu, and insert the wiki text as shown below.


text highlight

{{CI text highlight| text to highlight }}

produces:

text to highlight


inline logo

{{CI inline logo}}

produces:

Cultura italiana


notice box

{{CI notice box | some notice }}

produces:

some notice


pdf thumbnail

{{CI pdf thumbnail | Knuth-plass-breaking.pdf |  Breaking paragraphs into lines | clear after = true }}

produces:

Knuth-plass-breaking.pdf
Breaking paragraphs into lines

it shows a thumbnail of the first page of the pdf, with a direct link to it: it expects filename and optionally caption as unnamed arguments, plus a "clear after" argument, specifying whether we want to prevent subsequent elements to float (default is false), or alternatively a "clear" argument, specifying the actual value for the float css property.

Basically, if you want to show a series of pdf thumbnails as a column, you can omit both "clear after" and "clear" arguments, if you want to display the pdf thumbnails aside each other, you can use "clear after = false" or "clear = none". If you want let the text around to float on the left you can use "clear = right" (or "clear = left" if you want the text around floating on the right).

How it works/Templates/msupload insertpdf arrow.jpg

When using "clear after = false" or "clear = none" just remind to disable it for the last thumbnail otherwise the following page's section will float on the right of the element, which is usually an unwanted behavior.

Finally, since April 2021 this template can be inserted using WikiEditor following the instructions here (see picture on the right).


Accordion

{{CI accordion
|Why should I use this website? 
|Of course that's your choice ... 

|Why canapes tend to fall on the wrong side? 
|Because the specific weight of bread ... 

|Why should I wake up my sons so early to bring them at school ? 
|To prevent it grows some odd idea in their dreams...

}}


which produces the following

Why should I use this website?
Of course that's your choice ...
Why canapes tend to fall on the wrong side?
Because the specific weight of bread is less than ...
Why should I wake up my sons so early to bring them at school ?
To prevent it grows some odd idea in their dreams...
Why the specific weight of bread is less than ... ?
Because in a right triangle the area of the square whose side is the hypotenuse is equal to the sum of the areas of the squares on the other two sides

(except that last question-answer which is "a plus")

The accordion template (technically a Lua module) takes advantage of Dynamic components on the front-end, so basically you can add to your pages the equivalent of a paying wordpress plugin with just few lines of wiki text.



clear div

{{CI clear div }}


the latter does not show anything, but avoids text or elements to float if there are floating elements above, for instance using a floating image thumbnail (an image with floating text on left or right).