PC Gaming Shelter
An archive dedicated to preserving PC Gaming history and more

Module:Featured

From PC Gaming Shelter
Revision as of 13:13, 27 March 2026 by WikiVisor (talk | contribs)

Documentation for this module may be created at Module:Featured/doc

local p = {}

function p.video(frame)
  local args        = frame:getParent().args or {}
  local contentType = args[1] or 'video'
  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 content     = args[5] or args['url'] or args['image'] or args['text'] or ''
  
  local html = mw.html.create()
  
  local order = 1
  if contentType == 'video' then
  	content = frame:callParserFunction('#tag', { 
  		'embedvideo', 
  		service = 'youtube',  
  		autoResize = '1',
  		content 
	})
  elseif contentType == 'image' then
  	--
  elseif contentType == 'text' then
  	order = 2
  end	
  
  if content ~= '' and ( contentType == 'video' or contentType == 'image' or contentType == 'text' ) then
  html:tag('div'):addClass('card bg-dark thumbwall mb-3')
	:tag('div'):addClass('card-header order-0'):wikitext(header):done()
	:tag('div'):addClass('card-img' .. tostring(order)):wikitext(content):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()
  end
  
  return html
end

return p