Fandom

Wikia Developers Wiki

Global Lua Modules/Autochangecat

< Global Lua Modules

859pages on
this wiki
Add New Page
Talk0 Share

Automatically changes categories/templates after xx days based on the last date the page was saved/edited.

Syntax

  • {{autochangecat|mycat1|page2= mycat2| days=x|template = false}}
  • {{autochangecat|page1= mytemplate| page2=mytemplate2| days=x}}
  • {{autochangecat|page1= mycat1|page2= mycat2| days=x}}

 

Parameter Description
page1 Original template
page2 Target template after X days
template To change categories or templates  (set true to change template or omit to change categories)
days Number of days until template is changed

Example

CodeOutput
{{#invoke: Autochangecat | main |days=2|firsttemplate|secondtemplate|template=true}}{{{{#invoke: Autochangecat | main |days=2|firsttemplate|secondtemplate|template=true}}}}


Install

Installing modules

To get a brief introduction to lua read the basics page first. On Wikia, one can use modules by either accessing a module remotely or copying all its contents to a Wiki. Modules accessed remotely from dev.wikia are subject to change while 'correctly' copied modules are controlled by a particular wiki.

Using a module "remotely" using Module:Devmodule

Create Module:Devmodule and copy the following code to remotely access modules in dev's repository. See more details in Global Lua Modules/Devmodule.
--[[This imports modules from dev.wikia]]
return require("Dev:Devmodule")

Loading modules remotely from dev.wikia

Create Module:Autochangecat in your wiki and add the following code:
--This loads modules directly from dev.wikia.com
return require("Dev:Autochangecat")

Using Module:Autochangecat in another wiki

To use modules without depending on dev see this page. Create Template:Autochangecat in your wiki and add the following code:
{{#invoke:Autochangecat|main}}

Using template in a page

You can use this module in a page using syntax such as:
{{Autochangecat|main|arg1|arg2}}

Start a Discussion Discussions about Global Lua Modules/Autochangecat

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.