Homepage
Games
News
News βΎ
All
Transfers
Drama
Business
Sponsors
Mergers
Investors
Hires
Companies
More
People
Tournaments
Brands
Brands βΎ
Companies
Organizations
Sponsors
Other
Locations
Search
Editing
Module:Infobox/Widget/Role
From TwogPedia
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local Role = {} function Role.make(rowName, role, game, frame) local container = mw.html.create('div') local array = mw.text.split(role, ',') for i, v in ipairs(array) do local value = string.upper(mw.text.trim(v)) local valueNode = mw.html.create('div') -- If no game then return value without link if game == nil then return container:node(valueNode:wikitext(value)) end local catName = '' local visibleName = '' -- General if value == 'COACH' then catName = 'Coaches' visibleName = 'Coach' end if value == 'MANAGER' then catName = 'Managers' visibleName = 'Manager' end if value == 'TALENT' then catName = 'Talents' visibleName = 'Talent' end -- Dota 2 if value == 'CARRY' then catName = 'Carry_players' visibleName = 'Carry' end if value == 'HARD SUPPORT' then catName = 'Hard_support_players' visibleName = 'Hard support' end if value == 'OFFLANE' then catName = 'Offlaners' visibleName = 'Offlane' end -- Dota and LoL overlap if value == 'SUPPORT' then catName = 'Support_players' visibleName = 'Support' end if value == 'MID' then catName = 'Mid_players' visibleName = 'Mid' end -- LoL if value == 'TOP' then catName = 'Top_players' visibleName = 'Top' end if value == 'BOT' then catName = 'Bot_players' visibleName = 'Bot' end if value == 'JUNGLE' then catName = 'Junglers' visibleName = 'Jungle' end -- CS:GO Values if value == 'AWPER' or value == 'AWP' then catName = 'AWPers' visibleName = 'AWPer' end if value == 'LURKER' then catName = 'Lurkers' visibleName = 'Lurker' end if value == 'RIFLER' then catName = 'Riflers' visibleName = 'Rifler' end if value == 'ENTRY' or value == 'ENTRY FRAGGER' then catName = 'Entry_fraggers' visibleName = 'Entry fragger' end if value == 'IGL' or value == 'IN-GAME LEADER' then catName = 'In-game_leaders' visibleName = 'In-game Leader' end local link = 'Category:' .. game .. '/' .. catName local pageExists = frame:callParserFunction('#ifexist', link, 'yes', 'no' ) if pageExists == 'no' then container:node(valueNode:wikitext(visibleName)) else local categoryLink = '[[:Category:' .. game .. '/' .. catName .. '|' .. visibleName ..']]' valueNode:wikitext(categoryLink) container:node(valueNode) end end return container end return Role
Summary:
Please note that all contributions to TwogPedia may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
TwogPedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Template used on this page:
Module:Infobox/Widget/Role/doc
(
edit
)
No categories
Edit