Module:TemplateHelpers: Difference between revisions
// via Wikitext Extension for VSCode Tag: Reverted |
// via Wikitext Extension for VSCode Tag: Manual revert |
||
| Line 626: | Line 626: | ||
-- - imageParams: Additional image parameters like size, alignment (default: "") | -- - imageParams: Additional image parameters like size, alignment (default: "") | ||
-- - errorContext: Optional error context for error handling | -- - errorContext: Optional error context for error handling | ||
-- @return The rendered logo block HTML or empty string if no logo | -- @return The rendered logo block HTML or empty string if no logo | ||
function p.renderLogoBlock(args, options) | function p.renderLogoBlock(args, options) | ||
| Line 633: | Line 632: | ||
local cssClass = options.cssClass or "template-logo" | local cssClass = options.cssClass or "template-logo" | ||
local imageParams = options.imageParams or "" | local imageParams = options.imageParams or "" | ||
-- Define the logo rendering operation | -- Define the logo rendering operation | ||
local function renderLogoOperation(args, cssClass, imageParams | local function renderLogoOperation(args, cssClass, imageParams) | ||
-- Get logo parameter | -- Get logo parameter | ||
local logo = args["logo"] | local logo = args["logo"] | ||
| Line 650: | Line 648: | ||
-- Format image parameters if provided | -- Format image parameters if provided | ||
local imgParams = imageParams ~= "" and "|" .. imageParams or "" | local imgParams = imageParams ~= "" and "|" .. imageParams or "" | ||
-- Render the logo image | -- Render the logo image | ||
| Line 673: | Line 662: | ||
renderLogoOperation, | renderLogoOperation, | ||
"", -- Empty string fallback | "", -- Empty string fallback | ||
args, cssClass, imageParams | args, cssClass, imageParams | ||
) | ) | ||
end | end | ||