Difference between revisions of "Template:Family"

From NorCon MUSH
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#get_db_data:
+
<noinclude>Include the template <nowiki>{{Family}}</nowiki> followed by <nowiki>{{FamilyEnd}}</nowikI> to include a formatted table of your character's +sheet family relations.</noinclude>
db=norcon
+
|from=chars LEFT JOIN  `chars_relations` on chars.relations = chars_relations.id
+
|where=name='{{#replace:{{BASEPAGENAME}}|&#39;|\'}}'
+
|data=name=name,relations=relations
+
}}
+
{{#ifeq: {{#external_value:relations}} | | | {| class="table table-striped sortable" {{!}}
+
!Relationship
+
!Name
+
!Rank
+
!Age
+
|-{{#arraydefine:relations|{{#regex:{{#external_value:relations}}|/ /| ,}}}} {{
+
  #loop: i
+
  | 0                    <!-- loops start value for {{#var:i}} -->
+
  | {{#arraysize:relations}} <!-- number of loops -->
+
  | <nowiki/>
+
{{ #arraydefine: val | {{#arrayindex:relations| {{#var:i}} }} | :}} {{FamilyRelation |Relation={{#arrayindex: val | 0}} |Var={{#var:i}} |ID={{#arrayindex: val | 1}}}}
+
{{!}}-
+
}}
+
|} }}</includeonly>
+

Latest revision as of 09:48, 14 August 2025

Include the template {{Family}} followed by {{FamilyEnd}} to include a formatted table of your character's +sheet family relations.