Module:Variants: Difference between revisions
Add profession icon, and show both professions in table.
(Add logic for main variants table (so they are sorted the same)) |
(Add profession icon, and show both professions in table.) |
||
Line 1:
require('Module:Mw.html extension')
local p = {}
Line 12 ⟶ 13:
local query = {
'[[Variant of::'..variant_name..']]',
'?Profession A #', -- Adding a # to this query makes it return plaintext instead of a link
'?Profession B #',
'?Profession Level A',
'?Profession Level B',
Line 63 ⟶ 66:
:tag('th')
:wikitext('Level')
:attrIf(smw_data[1]['Profession B'], 'colspan', 2)
:done()
:done()
Line 78 ⟶ 82:
:done()
:tag('td')
:
:wikitext(entry['Profession Level A']..' [[File:'..entry['Profession A']..' small icon.png|21x21px|link='..entry['Profession A']..']]')
:done()▼
:IF(entry['Profession B'])
:tag('td')
:wikitextIf(entry['Profession B'], (entry['Profession Level B'] or '')..' [[File:'..(entry['Profession B'] or '')..' small icon.png|21x21px|link='..(entry['Profession B'] or '')..']]')
▲ :done()
:END()
:done()
end
|