Module:Featured: Difference between revisions
From PC Gaming Shelter
Created page with "local p = {} function p.main(frame) local args = frame:getParent().args or {} local header = args[1] or args['header'] or 'Navigate' local title = args[2] or args['title'] or 'Title' local tagline = args[3] or args['tagline'] or 'Tagline' local url = args[4] or args['url'] or '' local html = mw.html.create() html:tag('div'):addClass('card bg-dark thumbwall mb-3') :tag('div'):addClass('card-header'):wikitext(header):done() :tag('div'):addClas..." |
Tag: Undo |
||
| (14 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
function p. | function p.video(frame) | ||
local args = frame:getParent().args or {} | local args = frame:getParent().args or {} | ||
local header = args[ | local header = args[2] or args['header'] or 'Navigate' | ||
local title = args[ | local title = args[3] or args['title'] or 'Title' | ||
local tagline = args[ | local tagline = args[4] or args['tagline'] or 'Tagline' | ||
local url = args[ | local url = args[5] or args['url'] or '' | ||
local video = frame:callParserFunction('#tag', { | |||
'embedvideo', | |||
service = 'youtube', | |||
autoResize = '1', | |||
url | |||
}) | |||
local html = mw.html.create() | local html = mw.html.create() | ||
html:tag('div'):addClass('card bg-dark thumbwall mb-3') | html:tag('div'):addClass('card bg-dark thumbwall mb-3') | ||
:tag('div'):addClass('card-header'):wikitext(header):done() | :tag('div'):addClass('card-header'):wikitext(header):done() | ||
:tag('div'):addClass('card-body') | :tag('div'):addClass('card-img'):wikitext(video):done() | ||
:tag('div'):addClass('card-title'):wikitext(title):done() | :tag('div'):addClass('card-body bg-dark flex-column') | ||
:tag('div'):addClass('card-tagline'):wikitext(tagline):done() | :tag('div'):addClass('card-title mb-0'):wikitext(title):done() | ||
:tag('div'):addClass('card-tagline h3 lead'):wikitext(tagline):done() | |||
:done() | :done() | ||
:done() | :done() | ||
Latest revision as of 00:09, 18 March 2026
Documentation for this module may be created at Module:Featured/doc
local p = {}
function p.video(frame)
local args = frame:getParent().args or {}
local header = args[2] or args['header'] or 'Navigate'
local title = args[3] or args['title'] or 'Title'
local tagline = args[4] or args['tagline'] or 'Tagline'
local url = args[5] or args['url'] or ''
local video = frame:callParserFunction('#tag', {
'embedvideo',
service = 'youtube',
autoResize = '1',
url
})
local html = mw.html.create()
html:tag('div'):addClass('card bg-dark thumbwall mb-3')
:tag('div'):addClass('card-header'):wikitext(header):done()
:tag('div'):addClass('card-img'):wikitext(video):done()
:tag('div'):addClass('card-body bg-dark flex-column')
:tag('div'):addClass('card-title mb-0'):wikitext(title):done()
:tag('div'):addClass('card-tagline h3 lead'):wikitext(tagline):done()
:done()
:done()
return html
end
return p
