Module:T-CountryHub: Difference between revisions

// via Wikitext Extension for VSCode
// via Wikitext Extension for VSCode
Line 147: Line 147:
     'intro',
     'intro',
     'overview',
     'overview',
     'masonryWrapperOpen',
     'intelligentMasonry',
    'masonryContent',
    'masonryWrapperClose',
     'wrapperClose',
     'wrapperClose',
     'categories',
     'categories',
Line 514: Line 512:
}
}


-- MASONRY LAYOUT INTEGRATION
-- INTELLIGENT MASONRY LAYOUT INTEGRATION
-- Create masonry blocks and merge them into the template configuration
-- Single block that handles all masonry logic at render-time (Blueprint pattern)
local masonryBlocks = MasonryLayout.createMasonryBlocks(cardDefinitions, masonryOptions)
template.config.blocks.intelligentMasonry = {
for blockId, blockDef in pairs(masonryBlocks) do
    feature = 'fullPage',
    template.config.blocks[blockId] = blockDef
    render = function(template, args)
end
        return MasonryLayout.renderIntelligentLayout(template, args, {
 
            cardDefinitions = cardDefinitions,
-- Store the original block renderers for masonry to access
            options = masonryOptions,
template._blocks = {
            blockRenderers = {
    organizations = template.config.blocks.organizations,
                organizations = template.config.blocks.organizations,
    people = template.config.blocks.people,
                people = template.config.blocks.people,
    geoTlds = template.config.blocks.geoTlds,
                geoTlds = template.config.blocks.geoTlds,
    meetings = template.config.blocks.meetings,
                meetings = template.config.blocks.meetings,
    nra = template.config.blocks.nra,
                nra = template.config.blocks.nra,
    laws = template.config.blocks.laws,
                laws = template.config.blocks.laws,
    documents = template.config.blocks.documents,
                documents = template.config.blocks.documents,
    resources = template.config.blocks.resources
                resources = template.config.blocks.resources
            }
        })
    end
}
}