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(
        return Blueprint.protectedExecute(
        template,
            template,
        'CustomBlock_title',
            'CustomBlock_title',
        function()
            function()
            local titleText = (args._type == 'ccTLD') and 'ccTLD' or 'gTLD'
                local titleText = (args._type == 'ccTLD') and 'ccTLD' or 'gTLD'
            return TemplateHelpers.renderTitleBlock(
                return TemplateHelpers.renderTitleBlock(
                args,
                    args,
                'template-title template-title-tld',
                    'template-title template-title-tld',
                titleText,
                    titleText,
                template.config.meta and template.config.meta.titleOptions or {}
                    template.config.meta and template.config.meta.titleOptions or {}
            )
                )
        end,
            end,
        '',
            '',
        args
            args
    )
        )
end
    end
}
}


-- PIC/RVC link processor
-- === 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 = {}