Jump to content
Main menu
Main menu
move to sidebar
hide
Demo tour
Main page
Museum collection
ACME Inc
Research catalog
People and life events
Features
Subjects on a page
Schemas
Subject views
RDF and ontology mappings
SPARQL queries
Developers hub
About NeoWiki
NeoWiki website
Issue tracker
This wiki
Recent changes
NeoWiki Demo
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
View source for Module:SubjectRow
Module
Discussion
English
Read
View source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
View source
View history
General
What links here
Related changes
Special pages
Page information
RedHerb
Find a subject
Appearance
move to sidebar
hide
←
Module:SubjectRow
local p = {} -- Inline styles use Codex CSS custom properties so the row picks up the -- current theme (light / dark) where Codex CSS is loaded; hex fallbacks -- reproduce the light-mode values otherwise. local style = table.concat( { 'display:flex', 'gap:8px', 'padding:16px', 'justify-content:safe center', 'overflow-x:auto', 'align-items:flex-start', 'background:var(--background-color-interactive-subtle, #eaecf0)', 'border:1px solid var(--border-color-subtle, #c8ccd1)', 'border-radius:2px', 'margin-block:1em', }, ';' ) -- Each positional argument is a subject ID, optionally followed by @LayoutName -- for a per-view layout override. The named layout= argument is the row's -- default layout when no override is present. function p.render( frame ) local rowLayout = frame.args.layout local out = { '<div style="' .. style .. '">' } for _, arg in ipairs( frame.args ) do local id, viewLayout = arg, rowLayout local at = string.find( arg, '@', 1, true ) if at then id = string.sub( arg, 1, at - 1 ) viewLayout = string.sub( arg, at + 1 ) end local view if viewLayout and viewLayout ~= '' then view = frame:preprocess( '{{#view:' .. id .. '|' .. viewLayout .. '}}' ) else view = frame:preprocess( '{{#view:' .. id .. '}}' ) end -- flex-shrink:0 keeps each infobox at its natural width so the row -- scrolls horizontally on narrow viewports instead of squishing. out[#out + 1] = '<div style="flex-shrink:0">' .. view .. '</div>' end out[#out + 1] = '</div>' return table.concat( out ) end return p
Template used on this page:
Module:SubjectRow/doc
(
view source
)
Return to
Module:SubjectRow
.