Module:Odot control
Appearance
Implements {{Odot control}}
local p = { } --Package to be exported
function p.url(frame)
local pframe = frame:getParent() --get arguments passed to the template
local args = pframe.args
local county = args['county'] or '' --this string holds the raw county name
local countyProcessed --this string holds the processed county name to be added to the URL
--Le Flore and Roger Mills need special treatment to handle the spaces.
--Everything else just gets converted to lower case.
if county == "Le Flore" then
countyProcessed = "leflore"
elseif county == "Roger Mills" then
countyProcessed = "rogermills"
else
countyProcessed = county:lower()
end
--Shove the county name in the URL and call it good
return "http://www.odot.org/hqdiv/p-r-div/maps/control-maps/" .. countyProcessed .. ".pdf"
end