Module:LuaTemplateBlueprint: Difference between revisions

// via Wikitext Extension for VSCode
// via Wikitext Extension for VSCode
Line 439: Line 439:
                     args,
                     args,
                     TEMPLATE_TITLE_CLASS_PREFIX .. string.lower(templateId),
                     TEMPLATE_TITLE_CLASS_PREFIX .. string.lower(templateId),
                     titleText
                     titleText,
                    template.titleId
                 )
                 )
                 end,
                 end,
Line 1,206: Line 1,207:
function p.renderTemplate(template, frame)
function p.renderTemplate(template, frame)
     template.current_frame = frame -- Store frame on template instance
     template.current_frame = frame -- Store frame on template instance
   
    -- Generate a unique ID for the title element for ARIA
    local pageId = TemplateHelpers.getCurrentPageId() or '0'
    template.titleId = 'template-title-' .. template.type .. '-' .. pageId


     -- Check recursion depth to prevent infinite loops
     -- Check recursion depth to prevent infinite loops
Line 1,245: Line 1,250:
         tableClass = tableClass,
         tableClass = tableClass,
         blocks = {},
         blocks = {},
         containerTag = template.features.fullPage and "div" or "table"
         containerTag = template.features.fullPage and "div" or "table",
        ariaLabelledBy = template.titleId
     }
     }