Module:QuestDetails: Difference between revisions

From Brighter Shores Wiki
Jump to navigation Jump to search
Content added Content deleted
No edit summary
No edit summary
Line 1:
local p = {}
 
local Infobox = require('Module:Infobox')
local parse = require('Module:Param Parse')
 
function p.details(frame)
local args = frame:getParent().args
local configparams = {}
params['start_point'] = 'value1'
infobox_name = 'QuestDetails',
params['requirements'] = 'value2'
class = 'questdetails',
}
mw.smw.set(params)
local paramsdiv = {mw.html.create( 'div' )
div:wikitext( "Testing" )
{name = 'start_point', func = parse.has_content, smw_property = 'Start Point'},
if (args[1]) then
{name = 'requirements', func = parse.has_content, smw_property = 'Requirements'}
div:wikitext( args[1].tostring() )
}
end
if (args[2]) then
local infobox = Infobox.new(config, params, args)
div:wikitext( args[2].tostring() )
local auto_width = { ["max-width"] = "85%", ["width"] = "auto" }
end
infobox
 
:add_row{
return infoboxdiv
{ tag = 'th', class = "questdetails-header", content = 'Start Point' },
{ tag = 'td', class = "questdetails-info", content=Infobox.param('start_point'), css = auto_width }
}
:add_row{
{ tag = 'th', class = "questdetails-header", content = 'Requirements' },
{tag = 'td', class = "questdetails-info", content=Infobox.param('requirements'), colspan='2' },
}
return infobox
end
 

Revision as of 20:55, 17 November 2024

Module documentation
This documentation is transcluded from Module:QuestDetails/doc. [edit] [history] [purge]
This module does not have any documentation. Please consider adding documentation at Module:QuestDetails/doc. [edit]
Module:QuestDetails's function details is invoked by Template:QuestDetails.

local p = {}

function p.details(frame)
	local args = frame:getParent().args
	
	local params = {}
    params['start_point'] = 'value1'
    params['requirements'] = 'value2'
    
    mw.smw.set(params)
	
	local div = mw.html.create( 'div' )
	div:wikitext( "Testing" )
	if (args[1]) then
		div:wikitext( args[1].tostring() )
	end
	if (args[2]) then
		div:wikitext( args[2].tostring() )
	end

	return div
end

return p