LW:Help:Macros

Login login / register
littlewiki
 
Help:Macros
Popup
 
 Read   history 
Print View

Wiki Macros

Macros provide a quick and easy method for substituting a short function name (macro) with dynamic content. The following list provides information regarding the macros that are currently supported. All macros begin with an "at symbol" (@) and may contain 0 or more arguments enclosed in parenthesis after the macro name.

  • tableOfContents
    • tableOfContents will insert a table of contents at the macro location. The table is generated with the names of all of the heading tags in the article. The table of content items are also hyperlinked to the section that they reference.
    • Example: @tableOfContents()
  • slurp
    • slurp will get the text from another wiki article and insert it where the macro is. It will only pull from public articles.
    • Syntax: @slurp(''''' article name''''')
      • article name - name of existing wiki article to insert.
    • Example: @slurp(User:bob)
  • popular
    • popular will add links to the N most popular articles.
    • Syntax: @popular( number of articles)
      • number of articles - number of popular articles to insert.
    • Example: @popular(5)
  • articleName
    • articleName will insert the current wiki article name.
    • Example: @articleName()
  • timeAndDate
    • timeAndDate will insert the specified time and date. The format of the time and date is specific to each users local time and date format.
    • Syntax: @timeAndDate( seconds )
      • seconds - number of seconds since January 1, 1970 (UTC) that the time represents.
    • Example: @timeAndDate(1117056350)
    • Due to the fact that the argument is specified in seconds, this macro is difficult to use and mostly used for internal use. For help converting dates to seconds, see this conversion article.
Watch this guide 

Email this to a friend
Rate this Article:

Click on a star to vote.
Article started by 
scott
last updated by 
scott