Welcome to the Lylat Wiki, all about the Star Fox series! If you'd like to help out, please take a look at our community portal.

Difference between revisions of "Template:PrevNext"

From Lylat Wiki, your source on Star Fox information. By Fans, for Fans.
Jump to navigationJump to search
(Created page with "local p = {} --p stands for package function p.prevnext(frame) -- A passthrough that gets args from the frame and all mArguments = require('Module:Arguments') args = mArguments.getArgs(frame) return p._prevnext(args) end function p._prevnext(args, options) if args["prev"] ~= nil then prev = "<-- " .. args["prev"] else prev = "First of the series" end if args["next"] ~= nil then next = args["next"] .. " -->" else next = "Last of the...")
 
(Replaced content with "{{#invoke:PrevNext | prevnext }}<noinclude>{{doc}}{{autocat2|Series templates|Navigation templates}}</noinclude>")
Tag: Replaced
 
Line 1: Line 1:
local p = {} --p stands for package
{{#invoke:PrevNext | prevnext }}<noinclude>{{doc}}{{autocat2|Series templates|Navigation templates}}</noinclude>
 
function p.prevnext(frame)
-- A passthrough that gets args from the frame and all
mArguments = require('Module:Arguments')
args = mArguments.getArgs(frame)
return p._prevnext(args)
end
 
function p._prevnext(args, options)
if args["prev"] ~= nil then
prev = "<-- " .. args["prev"]
else
prev = "First of the series"
end
if args["next"] ~= nil then
next = args["next"] .. " -->
else
next = "Last of the series"
end
if args["series"] ~= nil then
series = args["series"]
end
local prev_cell = mw.html.create( 'td' )
    :css( 'width', '33%' )
    :wikitext( prev )
   
    local series_cell = mw.html.create( 'th' )
    :wikitext( series )
   
    local next_cell = mw.html.create( 'td' )
    :css( 'width', '33%;' )
    :css( 'text-align', 'end;')
    :wikitext( next )
   
local row = mw.html.create( 'tr' )
    :wikitext( tostring(prev_cell) .. tostring(series_cell) .. tostring(next_cell)  )
   
   
local t = mw.html.create( 'table' )
    t:addClass( "wikitable")
    t:css( 'width', '100%' )
    t:css( 'margin-bottom', '0px;')
    t:css( 'margin-top', '0px;')
    t:wikitext( tostring(row)  )
 
return tostring( t )
end
 
return p

Latest revision as of 00:28, 6 January 2024

First of the seriesLast of the series

Template:PrevNext/docTemplate:Autocat2