Special page

Difference between pages "Module:Excerpt/portals" and "Module:Excerpt/portals/sandbox"

(Difference between pages)
Page 1
Page 2
(Creation (as this is needed))
 
(Module Creation)
 
Line 111: Line 111:
 
}
 
}
  
local Transcluder = require("Module:Transcluder")
+
local Transcluder = require("Module:Transcluder/sandbox")
 
local escapeString = require("Module:String")._escapePattern
 
local escapeString = require("Module:String")._escapePattern
 
local yesno = require('Module:Yesno')
 
local yesno = require('Module:Yesno')
Line 346: Line 346:
 
--Certain positional elements may need to apply to the containing infobox, and not the file itself, so we should check that here
 
--Certain positional elements may need to apply to the containing infobox, and not the file itself, so we should check that here
 
if is(image.caption) and allowFancy then --Will be displayed like an infobox
 
if is(image.caption) and allowFancy then --Will be displayed like an infobox
local isleft = string.find(image.args, "|left") and "y" or "" --We care if its positioned to the left, so track this
+
local alignment =
local iscenter = (string.find(image.args, "|center") or string.find(image.args, "|centre")) and "y" or "" --Same for center
+
(string.find(image.args, "|left") and "left")
 +
or (string.find(image.args, "|center") or string.find(image.args, "|centre")) and "center"
 +
or "right"
 
modifyImage(image, "none") --Remove all positioning elements from the image
 
modifyImage(image, "none") --Remove all positioning elements from the image
 +
modifyImage(image, "frameless")
 
local args = image.args
 
local args = image.args
 
args = string.gsub(args, "|thumb", "") --Don't allow using |thumb in this mode
 
args = string.gsub(args, "|thumb", "") --Don't allow using |thumb in this mode
local upright = string.match(args, "|upright[= ]?([0-9.]*)") --Extract any value for upright (nil if none is present)
 
if upright == "" then upright = "1" end --An upright of nothing is considered bad syntax
 
args = string.gsub(args, "|upright[= ]?[0-9.]*", "") --And then remove it from the args list
 
 
 
 
return mw.text.unstrip(mw.getCurrentFrame():expandTemplate({
 
return mw.text.unstrip(mw.getCurrentFrame():expandTemplate({
title="Infobox file display",
+
title = "Image frame",
args={image.file..args,image.caption,left=isleft,center=iscenter,upright=upright}
+
args = {
 +
content="[[File:"..image.file..args.."]]", caption='<div class="center">'..image.caption.."</div>",
 +
align=alignment, ["max-width"]=300, mode="scrollable"
 +
}
 
})) .. "\n"
 
})) .. "\n"
 
else
 
else