Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Editing Module:BSW/MainPage

From the only original and legitimate Battlestar Wiki: the free-as-in-beer, non-corporate, open-content encyclopedia, analytical reference, and episode guide on all things Battlestar Galactica. Accept neither subpar substitutes nor subpar clones.
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision Your text
Line 217: Line 217:
function p.photolab( frame )
function p.photolab( frame )
     local args    = frame.args
     local args    = frame.args
     local content  = mw.text.trim( args.content or '' )
     local content  = args.content   or ''
     local prev_url = mw.text.trim( args.prev_url  or '' )
     local prev_url = mw.text.trim( args.prev_url  or '' )
     local prev_lbl = mw.text.trim( args.prev_label or '‹' )
     local prev_lbl = mw.text.trim( args.prev_label or '‹' )
    local caption  = mw.text.trim( args.caption    or '' )
     local next_url = mw.text.trim( args.next_url  or '' )
     local next_url = mw.text.trim( args.next_url  or '' )
     local next_lbl = mw.text.trim( args.next_label or '›' )
     local next_lbl = mw.text.trim( args.next_label or '›' )
    -- Caption: use the parent frame's raw (unexpanded) argument to avoid
    -- double-processing strip markers from nowiki/apostrophe markup.
    -- frame.args values are already expanded by MW before Lua sees them,
    -- which corrupts complex markup. Getting via expandTemplate on the
    -- raw caption transclusion gives a clean single-pass expansion.
    local caption_page = mw.text.trim( args.caption_page or '' )
    local caption = ''
    if caption_page ~= '' then
        caption = frame:preprocess( '{{' .. caption_page .. '}}' )
    else
        -- Fallback: use already-expanded value as-is (may have strip markers
        -- in complex captions, but simple text captions will be fine)
        caption = args.caption or ''
    end


     -- Hide if today's PotD subpage doesn't exist yet
     -- Hide if today's PotD subpage doesn't exist yet
     if isRedlink( content ) then return '' end
     if isRedlink( content ) then return '' end
    -- The Potd: subpage stores just the bare filename without "File:" prefix.
    local rendered_content = content
    if content ~= '' and not content:match( '%[%[' ) and not content:match( '<' ) then
        local filename = mw.text.trim( content )
        if filename ~= '' then
            rendered_content = frame:preprocess(
                '[[File:' .. filename .. '|center|frameless|400px]]'
            )
        end
    end


     local hd =
     local hd =
Line 263: Line 238:
         '<div class="bsw-photo-nav">' ..
         '<div class="bsw-photo-nav">' ..
         prev_link ..
         prev_link ..
         '<span class="bsw-photo-caption">' .. caption .. '</span>' ..
         '<span class="bsw-photo-caption">' .. e(caption) .. '</span>' ..
         next_link ..
         next_link ..
         '</div>'
         '</div>'


     return '<div class="bsw-card">' .. hd .. rendered_content .. nav .. '</div>'
     return '<div class="bsw-card">' .. hd .. content .. nav .. '</div>'
end
end


To edit this page, please enter the words that appear below in the box (more info):

Refresh
Cancel Editing help (opens in new window)

  [] · [[]] · [[|]] · {{}} · · “” ‘’ «» ‹› „“ ‚‘ · ~ | ° &nbsp; · ± × ÷ ² ³ ½ · §
     [[Category:]] · [[:File:]] · [[Special:MyLanguage/]] · <code></code> · <nowiki></nowiki> <code><nowiki></nowiki></code> · <syntaxhighlight></syntaxhighlight> · <includeonly></includeonly> · <noinclude></noinclude> · #REDIRECT[[]] · <translate></translate> · <languages/> · {{#translation:}} · <tvar|></> · {{DEFAULTSORT:}} · <categorytree></categorytree> · <div style="clear:both;"></div> <s></s>


Your changes will be visible immediately.
  • For testing, please use the sandbox instead.
  • On talk pages, please sign your comment by typing four tildes (~~~~).

Page included on this page: