Module:T-TLD: Difference between revisions
// via Wikitext Extension for VSCode |
// via Wikitext Extension for VSCode |
||
| Line 99: | Line 99: | ||
template.config.blocks = template.config.blocks or {} | template.config.blocks = template.config.blocks or {} | ||
template.config.blocks.title = { | template.config.blocks.title = { | ||
feature = 'title', | feature = 'title', | ||
render = function(template, args) | render = function(template, args) | ||
return Blueprint.protectedExecute( | |||
template, | |||
'CustomBlock_title', | |||
function() | |||
local titleText = (args._type == 'ccTLD') and 'ccTLD' or 'gTLD' | |||
return TemplateHelpers.renderTitleBlock( | |||
args, | |||
'template-title template-title-tld', | |||
titleText, | |||
template.config.meta and template.config.meta.titleOptions or {} | |||
) | |||
end, | |||
'', | |||
args | |||
) | |||
end | end | ||
} | } | ||
-- PIC/RVC | -- === PIC/RVC Link Processor === | ||
template.config.processors.RVC = function(value, args) | template.config.processors.RVC = function(value, args) | ||
local val = tostring(value) | local val = tostring(value) | ||
| Line 162: | Line 162: | ||
end | end | ||
-- Field Processors | -- === Field Processors === | ||
template.config.processors = template.config.processors or {} | template.config.processors = template.config.processors or {} | ||
template.config.processors.tld_type = function(value, args) | template.config.processors.tld_type = function(value, args) | ||
| Line 183: | Line 183: | ||
end | end | ||
-- Category Provider | -- === Category Provider === | ||
Blueprint.registerCategoryProvider(template, function(template, args) | Blueprint.registerCategoryProvider(template, function(template, args) | ||
local cats = {} | local cats = {} | ||