Home  

Random  

Nearby  



Log in  



Settings  



Donate  



About Wikipedia  

Disclaimers  



Wikipedia





Module:POTD titletext





Module  

Talk  



Language  

Watch  

View source  





For example, compare the result from {{subst:POTD/YYYY-MM-DD|texttitle}} with {{subst:#invoke:POTD titletext|main|YYYY-MM-DD}}

-- this module may be used by [[Template:POTD row]] to allow for substitution of the
-- [[Template:POTD texttitle]] created when substituting a [[Template:POTD/YYYY-MM-DD]]
-- template with the texttitle parameter.
--
-- For example, compare the result from
--   {{subst:POTD/YYYY-MM-DD|texttitle}}
-- with
--   {{subst:#invoke:POTD titletext|main|YYYY-MM-DD}}
--
local p = {}
function p.main(frame)
 local date = frame.args[1]
 local success, result = pcall(frame.expandTemplate, frame, {title = 'POTD/' .. date, args = { 'texttitle'}})
 if success then
  local t = mw.ustring.gsub(result, '[%s]', ' ')
  t = mw.ustring.gsub(t, '.*|[%s]*texttitle[%s]*=', '{{subst:#switch:texttitle|texttitle=')
  success, result = pcall(frame.preprocess, frame, {text = t})
  if success then
   return result
  else
   return '??'
  end
 else
  return '?'
 end
end

return p

Retrieved from "https://en.wikipedia.org/w/index.php?title=Module:POTD_titletext&oldid=1120136504"
 



Last edited on 5 November 2022, at 10:18  


Languages

 


Oʻzbekcha / ўзбекча
 

Wikipedia


This page was last edited on 5 November 2022, at 10:18 (UTC).

Content is available under CC BY-SA 4.0 unless otherwise noted.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Terms of Use

Desktop