Module:T-Campaign: Difference between revisions
// via Wikitext Extension for VSCode |
// via Wikitext Extension for VSCode |
||
| Line 183: | Line 183: | ||
end | end | ||
-- | -- Get the title from the central configuration | ||
local titleText = template.config.constants.title or "Campaign" | |||
local | -- Replace placeholder and process links | ||
bannerContent = bannerContent:gsub("%$CAMPAIGN_NAME%$", titleText) | |||
-- | |||
bannerContent = bannerContent:gsub("%$CAMPAIGN_NAME%$", | |||
bannerContent = WikitextProcessor.processWikiLinksToHTML(bannerContent, context) | bannerContent = WikitextProcessor.processWikiLinksToHTML(bannerContent, context) | ||
| Line 402: | Line 387: | ||
-- Always show campaign content fields (they'll show placeholder text when empty) | -- Always show campaign content fields (they'll show placeholder text when empty) | ||
for _, fieldDef in ipairs(campaignData.field_definitions) do | for _, fieldDef in ipairs(campaignData.field_definitions) do | ||
table.insert(fields, { | -- CRITICAL: Skip 'title' as it is not a content field | ||
if fieldDef.key ~= "title" then | |||
table.insert(fields, { | |||
key = fieldDef.key, | |||
label = fieldDef.label, | |||
type = fieldDef.type | |||
}) | |||
end | |||
end | end | ||