|
|
| Line 7: |
Line 7: |
| It creates a line like: Concept:Node_A["Node A"] --> Concept:Node_B["Node B"] | | It creates a line like: Concept:Node_A["Node A"] --> Concept:Node_B["Node B"] |
| </noinclude> | | </noinclude> |
| ```**Explanation of the fix:**
| |
| * This template now requires two parameters, `{{{1}}}` (the source) and `{{{2}}}` (the destination).
| |
| * `{{PAGENAMEE:...}}` creates a valid ID for Mermaid (e.g., `Concept:Node_A`).
| |
| * `{{#titleparts:...|2}}` creates a clean label for the node, stripping the "Concept:" prefix (e.g., `Node A`).
| |
|
| |
| ---
| |
|
| |
| ### Step 2: Fix the Graph Page Query
| |
|
| |
| Now, we'll update the query to feed the corrected template the two parameters it now expects.
| |
|
| |
| **Edit Page:** `Project:Mermaid_Graph_Test`
| |
|
| |
| **Replace the entire content of the page with this:**
| |
|
| |
| ```wikitext
| |
| This page tests the dynamic generation of a Mermaid graph from Semantic MediaWiki data.
| |
|
| |
| {{#mermaid:
| |
| graph TD;
| |
| {{#ask:
| |
| [[Category:Graph Example]]
| |
| [[Connects to::+]]
| |
| |? <!-- This becomes parameter {{{1}}} for the template -->
| |
| |?Connects to <!-- This becomes parameter {{{2}}} for the template -->
| |
| |format=template
| |
| |template=MermaidRelationship
| |
| |link=none
| |
| |sep=
| |
| }}
| |
| }}
| |