Module:T-LibraryInterview: Difference between revisions
// via Wikitext Extension for VSCode |
// via Wikitext Extension for VSCode |
||
| (16 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
--Module:T-LibraryInterview | --Module:T-LibraryInterview | ||
-- | -- Makes use of ICANNWiki's "Template Blueprint Framework" to render the "Internet & Digital Governance Library" template | ||
local p = {} | local p = {} | ||
| Line 7: | Line 7: | ||
local Blueprint = require('Module:LuaTemplateBlueprint') | local Blueprint = require('Module:LuaTemplateBlueprint') | ||
local ErrorHandling = require('Module:ErrorHandling') | local ErrorHandling = require('Module:ErrorHandling') | ||
-- ========== Helper Functions ========== | -- ========== Helper Functions ========== | ||
-- Create error context for the module | -- Blueprint default: Create error context for the module | ||
local errorContext = ErrorHandling.createContext("T-LibraryInterview") | local errorContext = ErrorHandling.createContext("T-LibraryInterview") | ||
-- ========== | -- ================================================================================ | ||
-- Initialize the standard configuration | -- IMPORTANT! TEMPLATE BLUEPRINT FRAMEWORK INSTRUCTIONS | ||
-- CONTROL OF TEMPLATE FEATURES: THIS LIST SPECIFIES IN AN EXPLICIT MANNER WHAT FEATURES ARE TO BE CALLED/RENDERED BY THE TEMPLATE. EXTENSIVE TESTING WAS PERFORMED SO THAT THIS CAN BE TOGGLED AT ANY TIME WITH A TRUE/FALSE BOOLEAN CHOICE FROM THIS MODULE, AS IT CAN BE DONE IN ANY OTHER MODULE USING ICANNWIKI'S THE TEMPLATE BLUEPRINT FRAMEWORK | |||
local template = Blueprint.registerTemplate('LibraryInterview', { | |||
features = { | |||
title = true, | |||
fields = true, | |||
semanticProperties = true, | |||
categories = true, | |||
errorReporting = true | |||
} | |||
}) | |||
-- Blueprint default: Initialize the standard configuration | |||
Blueprint.initializeConfig(template) | Blueprint.initializeConfig(template) | ||
-- | -- ================================================================================ | ||
-- | -- TEMPLATE-SPECIFIC CALLS AND CODE | ||
-- ========== Preprocessors ========== | -- ========== Preprocessors ========== | ||
-- | -- Basic preprocessors | ||
Blueprint.addPreprocessor(template, 'setPageIdField') | Blueprint.addPreprocessor(template, 'setPageIdField') | ||
-- ========== Main Render Function ========== | -- ========== Main Render Function ========== | ||
-- | -- Blueprint default: Render | ||
function p.render(frame) | function p.render(frame) | ||
return ErrorHandling.protect( | return ErrorHandling.protect( | ||
errorContext, | errorContext, | ||
| Line 91: | Line 46: | ||
return template.render(frame) | return template.render(frame) | ||
end, | end, | ||
ErrorHandling.getMessage("TEMPLATE_RENDER_ERROR"), | |||
frame | frame | ||
) | ) | ||