Template:Flowlist/doc: Difference between revisions

From HIBIKIFORUM
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(4 intermediate revisions by the same user not shown)
Line 31: Line 31:


== Examples ==
== Examples ==
<pre>
<div style="float:right;width:45%">
[[File:Books.png|left|thumb|100px|Animal Books]] List of animals:
[[File:Books.png|left|thumb|100px|Animal Books]] List of animals:
{{flowlist|
{{flowlist|
Line 40: Line 40:
* [[sheep]]
* [[sheep]]
* [[pig]]
* [[pig]]
}}
}}</div>
</pre>


[[File:Books.png|left|thumb|100px|Animal Books]] List of animals:
{{Pre|
{{flowlist|
{{!(n(}}{{fcb|#4169e1|File}}:{{fcb|#2e8b57|Books.png}}|left|thumb|100px|Animal Books]] List of animals:
* [[cat]]
{{((}}{{fcb|#4169e1|flowlist}}|
* [[dog]]
* {{!(n(}}{{fcb|#2e8b57|cat}}]]
* [[horse]]
* {{!(n(}}{{fcb|#2e8b57|dog}}]]
* [[cow]]
* {{!(n(}}{{fcb|#2e8b57|horse}}]]
* [[sheep]]
* {{!(n(}}{{fcb|#2e8b57|cow}}]]
* [[pig]]
* {{!(n(}}{{fcb|#2e8b57|sheep}}]]
* {{!(n(}}{{fcb|#2e8b57|pig}}]]
{{))}}
}}
}}
{{clear}}
{{clear}}


;Alternative syntax:
;Alternative syntax:
<pre>
<div style="float:right;width:45%">
[[File:Books.png|left|thumb|100px|Animal Books]] List of animals:
[[File:Books.png|left|thumb|100px|Animal Books]] List of animals:
{{flowlist}}
{{flowlist}}
Line 64: Line 65:
* [[sheep]]
* [[sheep]]
* [[pig]]
* [[pig]]
{{endflowlist}}
{{endflowlist}}</div>
</pre>


[[File:Books.png|left|thumb|100px|Animal Books]] List of animals:
{{Pre|
{{flowlist}}
{{!(n(}}{{fcb|#4169e1|File}}:{{fcb|#2e8b57|Books.png}}|left|thumb|100px|Animal Books]] List of animals:
* [[cat]]
{{((}}{{fcb|#4169e1|flowlist}}{{))}}
* [[dog]]
* {{!(n(}}{{fcb|#2e8b57|cat}}]]
* [[horse]]
* {{!(n(}}{{fcb|#2e8b57|dog}}]]
* [[cow]]
* {{!(n(}}{{fcb|#2e8b57|horse}}]]
* [[sheep]]
* {{!(n(}}{{fcb|#2e8b57|cow}}]]
* [[pig]]
* {{!(n(}}{{fcb|#2e8b57|sheep}}]]
{{endflowlist}}
* {{!(n(}}{{fcb|#2e8b57|pig}}]]
{{((}}{{fcb|#4169e1|endflowlist}}{{))}}
}}
{{clear}}
{{clear}}


Line 105: Line 107:


== TemplateData ==
== TemplateData ==
<templatedata>
{{#switch: {{BASEPAGENAME}}
|Flowlist=<templatedata>
{
{
"description": "Create a list around left floating objects, like images and infoboxes.",
"params": {
"params": {
"class": {
"class": {
"label": "Class",
"label": "Class",
"description": "CSS class to containing <div> tag"
"description": "Adds a CSS class to the containing <div> tag."
},
},
"style": {
"style": {
"label": "Style",
"label": "Style",
"description": "CSS style"
"description": "Adds CSS style options."
}
}
},
}
"description": "Create a list around left floating objects, like images and infoboxes.",
}
"paramOrder": [
</templatedata>
"class",
|Endflowlist=<templatedata>
"style"
{
]
    "description": "Ends a flow list started by {{flowlist}}. It takes no parameters.",
    "params": {}
}
}
</templatedata>
</templatedata>
}}




Line 129: Line 135:


<!-- Categories below this line, please -->
<!-- Categories below this line, please -->
[[Category:Templates]]
[[Category:List templates]]
[[Category:Formatting Templates]]
}}}}</includeonly>
}}}}</includeonly>

Latest revision as of 02:20, 20 August 2023

Light bulb.png }}
It contains usage information, categories and other content that is not part of the original template page.


Usage

If you have this problem of list bullets and numbers overlapping with a left floating image or Infobox, for example:

Animal Books

List of animals:

then {{Flowlist}} enables lists to stay clear of these left floating objects. It effectively makes lists act as a block level element. It does however have a few side effects that you should take note of.

Animal Books

List of animals:

This template can be used with or without {{endflowlist}}.

Examples

Animal Books
List of animals:
[[File:Books.png|left|thumb|100px|Animal Books]] List of animals:
{{flowlist|
* [[cat]]
* [[dog]]
* [[horse]]
* [[cow]]
* [[sheep]]
* [[pig]]
}}
Alternative syntax
Animal Books
List of animals:
[[File:Books.png|left|thumb|100px|Animal Books]] List of animals:
{{flowlist}}
* [[cat]]
* [[dog]]
* [[horse]]
* [[cow]]
* [[sheep]]
* [[pig]]
{{endflowlist}}

Parameters

  • |class= – adds a CSS class to the containing div.
  • |style= – adds CSS style options.

Side effects

Using this technique has a side effect. If your list is longer than the floated element, then the list will not flow around the image like normal, but instead be one block, leaving white space below the floated element. This goes for both left and right side of the list.

This

Animal Books
Animal Books
List of animals:
  • cat in a very long sentence that should collide with the image to the right
  • dog in a very long sentence that should collide with the image to the right

Will become

Animal Books
Animal Books
List of animals:
  • cat in a very long sentence that should collide with the image to the right
  • dog in a very long sentence that should collide with the image to the right

See Also

TemplateData

Create a list around left floating objects, like images and infoboxes.

Template parameters

ParameterDescriptionTypeStatus
Classclass

Adds a CSS class to the containing <div> tag.

Unknownoptional
Stylestyle

Adds CSS style options.

Unknownoptional