Difference between pages "Module:Excerpt/portals" and "Module:Excerpt/portals/sandbox"
(Difference between pages)
(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 | + | local alignment = |
− | + | (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 | ||
− | |||
− | |||
− | |||
return mw.text.unstrip(mw.getCurrentFrame():expandTemplate({ | return mw.text.unstrip(mw.getCurrentFrame():expandTemplate({ | ||
− | title=" | + | title = "Image frame", |
− | args={image.file..args,image.caption, | + | args = { |
+ | content="[[File:"..image.file..args.."]]", caption='<div class="center">'..image.caption.."</div>", | ||
+ | align=alignment, ["max-width"]=300, mode="scrollable" | ||
+ | } | ||
})) .. "\n" | })) .. "\n" | ||
else | else |