Module:Breadcrumb/doc: Difference between revisions

From The Seven Sages of Rome
Created page with "== Module:Breadcrumb == This module generates a breadcrumb navigation component for MediaWiki pages. The breadcrumb provides users with a visual representation of the page's hierarchy, linking back to the main page and a relevant category before displaying the current page. === Usage === The module is intended to be used in templates or directly in wiki pages via `#invoke`. ``` {{#invoke:Breadcrumb|breadcrumb | CategoryLink=Category:Example | CategoryName=Example Ca..."
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 6: Line 6:
The module is intended to be used in templates or directly in wiki pages via `#invoke`.
The module is intended to be used in templates or directly in wiki pages via `#invoke`.


```
<pre>
{{#invoke:Breadcrumb|breadcrumb
{{#invoke:Breadcrumb|breadcrumb
  | CategoryLink=Category:Example
  | CategoryLink=Category:Example
Line 12: Line 12:
  | PAGENAME=Current Page
  | PAGENAME=Current Page
}}
}}
```
</pre>


=== Parameters ===
=== Parameters ===
* `CategoryLink` - The wiki link to the relevant category (without brackets, e.g., `Category:Example`).
* '''CategoryLink''' - The wiki link to the relevant category (without brackets, e.g., `Category:Example`).
* `CategoryName` - The display name of the category.
* '''CategoryName''' - The display name of the category.
* `PAGENAME` - The name of the current page.
* '''PAGENAME''' - The name of the current page.


=== Behavior ===
=== Behavior ===
Line 29: Line 29:
=== Example Output ===
=== Example Output ===
If the following invocation is used:
If the following invocation is used:
```
<pre>
{{#invoke:Breadcrumb|breadcrumb
{{#invoke:Breadcrumb|breadcrumb
  | CategoryLink=Category:Manuscripts
  | CategoryLink=Category:Manuscripts
Line 35: Line 35:
  | PAGENAME=Codex ABC
  | PAGENAME=Codex ABC
}}
}}
```
</pre>


The output will be:
The output will be:
```
<pre>
Home > Manuscripts > Codex ABC
Home > Manuscripts > Codex ABC
```
</pre>
(with appropriate HTML styling and icons)
(with appropriate HTML styling and icons)


=== Notes ===
=== Notes ===
* The `CategoryLink` parameter should not include square brackets.
* The '''CategoryLink''' parameter should not include square brackets.
* The breadcrumb styling relies on Bootstrap 4.
* The breadcrumb styling relies on Bootstrap 4.
* The home link is hardcoded to `/Main Page`.
* The home link is hardcoded to `/Main Page`.


This module improves navigation usability, especially in structured content like Semantic MediaWiki categories.
This module improves navigation usability, especially in structured content like Semantic MediaWiki categories.

Latest revision as of 14:07, 25 March 2025

Module:Breadcrumb

This module generates a breadcrumb navigation component for MediaWiki pages. The breadcrumb provides users with a visual representation of the page's hierarchy, linking back to the main page and a relevant category before displaying the current page.

Usage

The module is intended to be used in templates or directly in wiki pages via `#invoke`.

{{#invoke:Breadcrumb|breadcrumb
 | CategoryLink=Category:Example
 | CategoryName=Example Category
 | PAGENAME=Current Page
}}

Parameters

  • CategoryLink - The wiki link to the relevant category (without brackets, e.g., `Category:Example`).
  • CategoryName - The display name of the category.
  • PAGENAME - The name of the current page.

Behavior

The module generates a structured breadcrumb navigation with three levels: 1. **Home Link**: Links back to the main page, displaying a home icon. 2. **Category Link**: Displays the category as an intermediate step in the hierarchy. 3. **Current Page**: Displays the current page as non-clickable text.

It utilizes Bootstrap 4 classes for styling and includes SVG icons for a modern visual appearance.

Example Output

If the following invocation is used:

{{#invoke:Breadcrumb|breadcrumb
 | CategoryLink=Category:Manuscripts
 | CategoryName=Manuscripts
 | PAGENAME=Codex ABC
}}

The output will be:

Home > Manuscripts > Codex ABC

(with appropriate HTML styling and icons)

Notes

  • The CategoryLink parameter should not include square brackets.
  • The breadcrumb styling relies on Bootstrap 4.
  • The home link is hardcoded to `/Main Page`.

This module improves navigation usability, especially in structured content like Semantic MediaWiki categories.