Jump to content

Template:ButtonsGroup: Difference between revisions

Changed to add parameters for name/link
(Changed to add parameters for name/link)
Line 1: Line 1:
<includeonly><div style="display:flex; flex-flow:row wrap; justify-content:flex-start; gap:20px;">
<includeonly><div style="display:flex; flex-flow:row wrap; justify-content:flex-start; gap:20px;">
<div class="online_records_button" style="align-content:center;">[[{{#replace:{{PAGENAME}}|Genealogy|}} Online Genealogy Records]]</div>
<div class="online_records_button" style="align-content:center;">[[{{{RecordsLink|{{#replace:{{PAGENAME}}|Genealogy|}} Online Genealogy Records}}}|{{{RecordsName|{{#replace:{{PAGENAME}}|Genealogy|}} Online Genealogy Records}}}]]</div>
<div class="community_button" style="align-content:center;">[[Online Research Help|Online<br>Research Help]]</div>
<div class="community_button" style="align-content:center;">[[Online Research Help|Online<br>Research Help]]</div>
{{#ifexist: {{#replace:{{PAGENAME}}|Genealogy|}} Getting Started |<div class="red_online_button" style="align-content:center;">[[{{#replace:{{PAGENAME}}|Genealogy|}} Getting Started|Getting<br>Started]]</div>}}
{{#ifexist: {{#replace:{{PAGENAME}}|Genealogy|}} Getting Started |<div class="red_online_button" style="align-content:center;">[[{{{StartedLink|{{#replace:{{PAGENAME}}|Genealogy|}} Getting Started}}}|Getting<br>Started]]</div>}}
</div></includeonly><noinclude>
</div></includeonly><noinclude>
<big>'''ButtonsGroup template'''</big><br>
<big>'''ButtonsGroup template'''</big><br>
Line 22: Line 22:
# The template reads the pagename, strips anything after a comma and removes the word "Genealogy" which matches the usage on Country pages.
# The template reads the pagename, strips anything after a comma and removes the word "Genealogy" which matches the usage on Country pages.
# The template checks if the "Getting Started" page exists and displays the button if so, hiding it otherwise.
# The template checks if the "Getting Started" page exists and displays the button if so, hiding it otherwise.
# There are several pages that don't have the same name/link format as Country pages, the template can be updated to include parameters to handle these cases if necessary.  The default logic is used if the parameter doesn't exist, for example:
# There are several pages that don't have the same name/link format as Country pages, these parameters (both name/link for "Online Genealogy Records" and link for "Getting Started") can be overridden using the following:
#: <syntaxhighlight lang="linux-config" style="max-width:300px;">
#: <syntaxhighlight lang="linux-config" style="max-width:300px;">
{{ButtonsGroup
{{ButtonsGroup
Approver, Batcheditor, Moderator, Patroller, Protector, Reviewer, Bots, Bureaucrats, editor, Interface administrators, pagecreator, pagedeleter, Page Ownership admin, Push subscription managers, Suppressors, Administrators, Upload Wizard campaign editors, Widget editors
321,763

edits