Difference between revisions of "Sandbox"
 (→1)  | 
				|||
| Line 55: | Line 55: | ||
{{#dpl: category=Pseudo_Namespace:Foobars|resultsheader=%TOTALPAGES% %VERSION%|noresultsheader=none|mode=userformat}}  | {{#dpl: category=Pseudo_Namespace:Foobars|resultsheader=%TOTALPAGES% %VERSION%|noresultsheader=none|mode=userformat}}  | ||
  [[Special:Call/:Call extension,Hello world!| good morning! ]]  |   [[Special:Call/:Call extension,Hello world!| good morning! ]]  | ||
| + | |||
| + | == <nowiki>{{PAGENAME}}</nowiki> DPL Invoking Example ==  | ||
| + | |||
| + | {{Test2}}  | ||
Revision as of 13:03, 27 September 2009
feel free to play around
Playground
You must create valid syntax for the gallery extension if you want to use it within DPL; add debug=5 at the beginning of your statement and check what the Template Template:Infobox Country or territory dpl produces. Gero 10:34, 4 April 2008 (CEST)
1
{{#arraydefine:x|
follow the link in the headline .. ° In the standard configuration DPL registers the <DynamicPageList> tag. This is needed to be downward compatible with extension 'Intersection'.
In the transition phase you may want to install DPL in PARALLEL to 'Intersection' for testing. DPL offers a second entry point for that purpose. Instead of require_once("DynamicPageList.php") you have to use require_once("DPLMigration.php"). DPL will then ONLY register a tag called <Intersection>
In this constellation you can change some of your existing calls of 'Intersection' (which use the <DynamicPageList> tag) to the <Intersection> tag. Once you are convinced that this produces identical results and works with equal efficiency you can change to require_once("DynamicPageList.php"). Don't forget to change the statements back to the <DynamicPageList> tag!. Of course you must also remove the require_once() for the Intersection extension. °
- loop detection
 -  The output of a query will never contain the page which contains the query.
This prevents loops, but in some very rare cases it might not be what you expect.- This is a documented feature; use skipthispage = no to include the page which contains the query. Gero 12:43, 4 December 2009 (UTC)
 
 
- TOC generation
 -  When using mode=category DPL will switch off TOC generation.
Place a manual TOC pragma in your article if you want to get a table of contents 
- SECTION editing
 -  When using mode=category DPL will switch off section editing generation.
Place a manual EDITSECTION pragma in your article if you want to get a table of contents 
°°° The code of this extenstion uses some MySQL-specific functions which don't exist in PostgreSQL. In order to avoid patching each new version of DyanmicPageList, I suggest to run the following script on your postgres Database (from the postgres account). This simply emulates the MySQL functions.
create schema mysql;
grant usage on schema mysql to public;
alter user wikiuser set search_path to mediawiki, public, mysql;
create or replace function mysql.concat(text, text) returns text
as $function$
  begin
    return $1 || $2;
  end;
$function$ language plpgsql immutable strict;
create or replace function mysql.if(boolean, text, text) returns text
as $function$
  begin
    if $1 then
      return $2;
    else
      return $3;
    end if;
  end;
$function$ language plpgsql immutable strict;
create or replace function mysql.ifnull(text, text) returns text
as $function$
    select coalesce($1, $2) as result
$function$ language 'sql';
°
  {{#dplnum:text}}
° The following example would probably be used directly on an article page, but could also be included as part of a template. Parser extensions define a specific tag (in this case <DPL>) and a corresponding end tag (</DPL>). The text between these tags is handed over to the extension module just as it is.
- Example syntax
 
<DPL> category = cat1|cat2 # only pages which contain a link to myPage linksto = myPage </DPL>
- Parsing procedure
 
Wiki markup expansion does not take place before the commands are handed over to the extension module.
- This may be useful if you want to pass wiki syntax elements to DPL2 as arguments (see the format option, for example).
 - Magic words like {{PAGENAME}} or {{CURRENTDAY}} cannot be used.
 - Template calls like {{{some template}}}, cannot be used as parameters.
 - Parser function calls like {{#if:...|...|...}} cannot be used within arguments.
 - To pass wiki syntax elements to DPL as parameters it is sometimes necessary to enforce a line break. The reason is that wiki syntax depends on line breaks. Instead, use \n or ¶ for that purpose.
 
- Syntax features
 
- Every parameter assignment (=command) has to be on a separate line.
 - Lines starting with a # will be ignored (comment).
 - Generally the syntax looks fairly simple and intuitive as it doesn't contain special characters (except for the two embracing tags).
 - Tag case doesn't matter, so it can also be written <dpl>.
 - In many cases there is no need to have macro expansion within the parameter list. Note that in the example above, the pipe character (which is used to define a logical OR between the two categories) can be written as it is. The name of the page (myPage), however, must be a hardcoded constant.
 
°°
 {{#dplchapter: text | heading | limit | page | linktext }}
°|°}} {{#arraysort:x|random}} {{#arrayindex:x|0}}
3
- Cameroon
 - Align=right
475,442
 - Align=right
923,768
 - Align=right
637,657
 - Align=right
2,505,813
 
2
| Country | Official Name | Capital | Dial Code | 
|---|---|---|---|
| DPL Example 007 main page 1 (%COUNT%) | Template:Country dpl.default | ||
| Nigunda (%COUNT%) | Republic of Nigunda | Bamitogoo | 237 | 
| Nigunda Test (%COUNT%) | Republic of Nigunda Test | Bamitogoo Test | 237 | 
| Somango (%COUNT%) | Somango Island | Aaaabququque | 224 | 
Number of data = 1
| No | Name | Languages | Government | Area | Population | GDP | Independence Day | 
|---|---|---|---|---|---|---|---|
| 1 | Republic of Cameroon | French,English | Republic | 183,568 sq mi | 17,795,000 | $43.196 billion | 01/10/1961 | 
- Template:Main
 - Template:Country
 - Template:Country dpl
 - Template:(!
 - Template:!)
 - Template:!
 - Template:!-
 - Template:Sortable Tables
 - Template:Infobox Country or territory dpl
 - Template:Infobox Country or territory dpl2
 - Template:See also
 - Template:Linkedimage
 - Template:CurrentUsers
 - Template:Infobox Country or territory
 - Template:Articles
 - Template:Person.ref.Person
 - Template:Friend
 - Template:DPL parameter
 - Template:DPL parameter.overview
 - Template:Type Manual.overview
 - Template:Type Manual
 - Template:Schnittstellen Übersicht Mini
 - Template:Schnittstellen Übersicht Mini dpl
 - Template:LoadTestChapter
 - Template:LoadTest
 - Template:Way up
 - Template:Is to come
 - Template:Todo
 - Template:High
 - Template:Todo.dpl
 - Template:Low
 - Template:None
 - Template:Todo.pri
 - Template:CalendarSingle
 - Template:Calendar/MonthStartThu
 - Template:Calendar anchor
 - Template:Calendar link
 - Template:Calendar/MonthStartMon
 - Template:Calendar/MonthStartTue
 - Template:Calendar/MonthStartWed
 - Template:Calendar/MonthStartFri
 - Template:Calendar/MonthStartSat
 - Template:Calendar/MonthStartSun
 - Template:DPL Count
 - Template:Event
 - Template:Calendar month
 - Template:Event template
 - Template:African Country
 - Template:Painter
 - Template:Is friend of
 - Template:Wgraph edgetype
 - Template:Wgraph node
 - Template:Is friend of.dpl
 - Template:Wgraph edgetype.dpl
 - Template:Wgraph node.dpl
 - Template:Wgraph
 - Template:Wgraph node.dpl.default
 - Template:Is friend of.dpl.default
 - Template:Catlist
 - Template:Catlist1
 - Template:Export.dpl.default
 - Template:Category with count
 - Template:Todo2
 - Template:Nosigr
 - Template:For page size test page 2
 - Template:Page size test page 1
 - Template:Catgraph
 - Template:Wgraph defaults
 - Template:Links 1
 - Template:Links 2
 - Template:Links 2.1
 - Template:LinksToWithRedirect
 - Template:Catlist/zh
 - Template:Population Checker
 - Template:Population Check
 - Template:Population
 - Template:Population.dpl
 - Template:Country Population
 - Template:Test Country Population
 - Template:Population.dpl1
 - Template:Population Check1
 - Template:Population Checker1
 - Template:Some Template
 - Template:Some Template.dpl
 - Template:Some Template.dpl2
 - Template:CatTree
 - Template:CatTreeSub
 - Template:Step.dpl
 - Template:Catlist zh
 - Template:LinksTo
 - Template:Create Event
 - Template:Nachkommen
 - Template:Paar
 - Template:Issue
 - Template:Wgraph Command
 - Template:Cmdref headline
 - Template:Cmdref menu
 - Template:Wgraph Command.default
 - Template:Alias Wgraph
 - Template:See Wgraph
 - Template:TempTree
 - Template:Symbols
 - Template:!!
 - Template:CategoryGallery
 - Template:Catlist/zh 2
 - Template:Listing Redirects and Location Sub
 - Template:DT Article Edit (Form)
 - Template:DT Article Header
 - Template:DT Article Help (Form)
 - Template:DT Article Intro (Form)
 - Template:DT Article Wiki (Form)
 - Template:DT Article XML (Form)
 - Template:DT Article copy
 - Template:DT Article copy (Intro)
 - Template:DT Article show Refs
 - Template:DT Articles list Wiki
 - Template:DT Articles list Wiki (Form)
 - Template:DT Articles list XML
 - Template:DT Articles view (Form)
 - Template:DT Category
 - Template:DT Form Field
 - Template:DT Form Field Ref
 - Template:DT Article Edit (Intro)
 - Template:DT Form Field Text
 - Template:DT Form Header
 - Template:DT Scripts index
 - Template:DT Type (Form)
 - Template:DT Article
 - Template:DT Type create
 - Template:DocTypes
 - Template:DT Article Edit (Intro).de
 - Template:DT Article Edit (Syntax)
 - Template:DT Article Edit (Syntax).de
 - Template:DT Article Help (Intro)
 - Template:DT Article Help (Intro).de
 - Template:DT Article Intro (Intro)
 - Template:DT Article Intro (Intro).de
 - Template:DT Article Wiki (Intro)
 - Template:DT Article Wiki (Intro).de
 - Template:DT Article XML (Intro)
 - Template:DT Article XML (Intro).de
 - Template:DT Article copy (Intro).de
 - Template:DT Articles list HTML
 - Template:DT Articles list HTML (Form)
 - Template:DT Articles list Wiki export.default
 - Template:DT Articles view (Intro)
 - Template:DT Articles view (Intro).de
 - Template:DT Form Field Link
 - Template:DT Form Field Newline
 - Template:DT Language
 - Template:DT Link
 - Template:DT Meta
 - Template:DT Ref
 - Template:DT Ref.report
 - Template:DT Report create
 - Template:DT Report create (Form)
 - Template:DT Report create (Intro)
 - Template:DT Report create (Intro).de
 - Template:DT Type create (Form)
 - Template:DT Type create (Intro)
 - Template:DT Type create (Intro).de
 - Template:DT XML Field Text
 - Template:Location
 - Template:Location.edit
 - Template:Location.help
 - Template:Location.intro
 - Template:Location.report.barchart inhabitants
 - Template:Location.report.geoplot inhabitants
 - Template:Location.text
 - Template:Location.view
 - Template:Location.xml
 - Template:Location.report.piechart inhabitants
 - Template:Trip.edit
 - Template:Trip
 - Template:Trip.view
 - Template:Trip.ref.Location
 - Template:Trip.text
 - Template:Trip.help
 - Template:Trip.intro
 - Template:Location.report.inhabitants.data
 - Template:DT Form Header.meta
 - Template:DT Ref.report.default
 - Template:Person.ref.Location
 - Template:Person.edit
 - Template:Person
 - Template:Person.view
 - Template:Trip.ref.Person
 - Template:Person.help
 - Template:Person.intro
 - Template:Person.text
 - Template:DT Articles list csv
 - Template:Person.csv
 - Template:DT Article csv (Form)
 - Template:Trip.csv
 - Template:DT Article csv (Intro)
 - Template:DT Article csv (Intro).de
 - Template:DT csv
 - Template:Location.csv
 - Template:Calendar month zh-tw
 - Template:CalendarSingle zh-tw
 - Template:Calendar navigation
 - Template:Calendar link zh-tw
 - Template:Create Event zh-tw
 - Template:Event template zh-tw
 - Template:Event zh-tw
 - Template:DPL Calendar code generater zh-tw
 - Template:Invalid page
 - Template:Type?.intro
 - Template:Type?.text
 - Template:Test subgoal
 - Template:ECP number maker
 - Template:ECP Issue
 - Template:ECP
 - Template:Type Test
 - Template:Is a
 - Template:Student
 - Template:Ask is a
 - Template:Type?.help
 - Template:Flickr code generater
 - Template:Topic group.dpl
 - Template:Topic group
 - Template:Topic
 - Template:PoI
 - Template:GoogleMap
 - Template:PoI gm
 - Template:+
 - Template:-
 - Template:.cat definition
 - Template:.cat make
 - Template:.cat show
 - Template:.class browse
 - Template:.class create
 - Template:.class definition
 - Template:.class description
 - Template:.class inheritance
 - Template:.class instances
 - Template:.class intro
 - Template:.class menu
 - Template:.class parents
 - Template:.class parents 2
 - Template:.class parents 3
 - Template:.class parents 4
 - Template:.class preload
 - Template:.class properties
 - Template:.class properties 2
 - Template:.class properties 3
 - Template:.class properties 4
 - Template:.class references
 - Template:.class references.ask
 - Template:.class summary
 - Template:.form field
 - Template:.form header
 - Template:.instances export wiki
 - Template:.instances list html
 - Template:.instances list html (form)
 - Template:.model class
 - Template:.model extends
 - Template:.model graph
 - Template:.model meta graph
 - Template:.model meta show
 - Template:.model prop
 - Template:.model show
 - Template:.obj create
 - Template:.obj create with form
 - Template:.obj data template make
 - Template:.obj get
 - Template:.obj getMy
 - Template:.obj getMyText
 - Template:.obj getText
 - Template:.obj intro
 - Template:.obj intro Location
 - Template:.obj intro Musical Instrument
 - Template:.obj intro Student
 - Template:.obj intro Subject
 - Template:.obj intro ask
 - Template:.obj intro make
 - Template:.obj intro top
 - Template:.obj is a
 - Template:.obj is instance of
 - Template:.obj is referenced by
 - Template:.obj is referenced by.ask
 - Template:.obj preload Location
 - Template:.obj preload Musical Instrument
 - Template:.obj preload Student
 - Template:.obj preload Subject
 - Template:.obj preload make
 - Template:.obj set
 - Template:.prop assigned by
 - Template:.prop built-in
 - Template:.prop create
 - Template:.prop definition
 - Template:.prop derived from
 - Template:.prop describes
 - Template:.prop intro
 - Template:.prop mandatory
 - Template:.prop preload
 - Template:.prop refers to
 - Template:.prop reverse
 - Template:.prop unique
 - Template:.report
 - Template:.type built-in
 - Template:Belongs to
 - Template:Coordinates
 - Template:Group
 - Template:Is part of
 - Template:Placement
 - Template:Born in
 - Template:Has team mate
 - Template:Plays
 - Template:Studies
 - Template:Studies in
 - Template:Invented in
 - Template:Born at
 - Template:Musical Instrument
 - Template:.prop scope
 - Template:Print as one piece
 - Template:Has document part
 - Template:Part of master document
 - Template:Continue with part
 - Template:Print whole text
 - Template:.obj intro Freshman
 - Template:.obj intro Game
 - Template:Game
 - Template:Subject
 - Template:.obj intro Person
 - Template:Freshman
 - Template:.obj preload Game
 - Template:.obj preload Person
 - Template:.obj preload Freshman
 - Template:Game.list
 - Template:Freshman.list
 - Template:Person.list
 - Template:Subject.list
 - Template:Location.list
 - Template:Musical Instrument.list
 - Template:.obj preload
 - Template:.list
 - Template:Student.list
 - Template:ECP-00055
 - Template:DPL Page Name S/N Maker
 - Template:Test
 - Template:Abc/x123
 - Template:Tl
 - Template:List articles on people by last name
 - Template:My special article lister
 - Template:Datetest.dpl
 - Template:Datetest
 - Template:Amp
 - Template:Test get chapter
 - Template:DPL Cache Warning
 - Template:Bulk Update
 - Template:Teaser
 - Template:Example
 - Template:Country.phantom-004
 - Template:DPL Example 007 sub
 - Template:DPL Example 007 sub 2
 - Template:DPL Example 009 sub
 - Template:DPL Example 010 tpl
 - Template:DPL Example 010 sub
 - Template:DPL Example 102 piechart
 - Template:DPL Example 103 barchart
 - Template:DPL Page Name S/N Maker test
 - Template:DPLSNMakerSF
 - Template:Test Amp3/Template
 - Template:Test Amp3/Template2
 - Template:UsageCount
 - Template:Index
 - Template:Index.dpl1
 - Template:Index.dpl2
 - Template:DPL Example 018 sub
 - Template:Comma
 - Template:Extension DPL
 - Template:Extension DPL scroll
 - Template:Extension DPL cache
 - Template:DPL stable version
 - Template:Country.listByCapital
 - Template:ExportTransitive
 - Template:ExportTransitive.img
 - Template:ExportTransitive.sub
 - Template:Dpl.pfunc.default
 - Template:Dpl.pfunc
 - Template:.+.pfunc.default
 - Template:.+.pfunc
 - Template:Extension DPL continue
 - Template:Dpl.tag.default
 - Template:Dpl.tag
 - Template:Set Template Parameter
 - Template:DummyTemplate
 - Template:TOCright
 - Template:UsesTest
 - Template:ShortenString
 - Template:Short
 - Template:ShortURL
 - Template:Templink
 - Template:ShortURL/Examples
 - Template:ShortURL/Examples/List
 - Template:ShortLink/Examples
 - Template:ShortLink
 - Template:ShortLink/Examples/List
 - Template:Infobox Country or territory.dpl
 - Template:Template.edit
 - Template:Infobox Country or territory.edit
 - Template:Car
 - Template:.obj intro car
 - Template:.obj preload car
 - Template:Vehicle
 - Template:.obj intro vehicle
 - Template:.obj preload vehicle
 - Template:Vehicle.list
 - Template:Car.list
 - Template:Test2
 - Template:Googlemap.*.dpl
 - Template:Tmp2
 - Template:Goglemap.*.dpl.default
 - Template:Goglemap.*.dpl
 - Template:RP.dpl.default
 - Template:DPL/Navi/3
 - Template:DPL/ImgUsed/ResNum
 - Template:DPL/ImgUsed/LinkedFrom
 - Template:Siblings
 - Template:ActivitySummary
 - Template:Activity Description
 - Template:Sandbox
 - Template:Sandbox2
 - Template:Some Template.dpl3
 - Template:Redirs
 - Template:Translation
 - Template:Translation.table
 - Template:Magazine
 - Template:Book
 - Template:Publication
 - Template:Publication.default
 - Template:Magazine.published.default
 - Template:Book.published.default
 - Template:Book.published
 - Template:Magazine.published
 - Template:About
 - Template:Basepage subpage
 - Template:Category handler
 - Template:Category handler/blacklist
 - Template:Category handler/numbered
 - Template:Citation/core
 - Template:Citation/identifier
 - Template:Citation/make link
 - Template:Citation needed
 - Template:Cite book
 - Template:Cite encyclopedia
 - Template:Cite web
 - Template:Column-count
 - Template:Commons
 - Template:EB1911
 - Template:Fix
 - Template:Fix/category
 - Template:Greenwood&Earnshaw2nd
 - Template:Harvard citation/core
 - Template:Hatnote
 - Template:Hide in print
 - Template:If pagename
 - Template:Ifsubst
 - Template:Infobox
 - Template:Infobox/row
 - Template:Infobox mineral
 - Template:Jewellery
 - Template:Namespace detect
 - Template:Navbox
 - Template:Only in print
 - Template:Other uses
 - Template:Px
 - Template:Reflist
 - Template:Sfn
 - Template:Side box
 - Template:Silica minerals
 - Template:Sister
 - Template:Transclude
 - Template:=
 - Template:Audio
 - Template:Cite journal
 - Template:Cite news
 - Template:Column-width
 - Template:Convert
 - Template:Convert/LoffAoffDbSoff
 - Template:Convert/LoffAonSoff
 - Template:Convert/kg
 - Template:Convert/lb
 - Template:Convert/numdisp
 - Template:Convert/outsep
 - Template:Convert/test/A
 - Template:DMCA
 - Template:Dated maintenance category
 - Template:Doi
 - Template:FULLROOTPAGENAME
 - Template:Link GA
 - Template:Ns has subpages
 - Template:OEtymD
 - Template:Redirect
 - Template:Str left
 - Template:Use dmy dates
 - Template:Wikisource
 - Template:Commons category
 - Template:Overline
 
%TOTALPAGES%
{{#dpl: category=African_Union_member_states¦Cities|resultsheader=%PAGES%|noresultsheader=none|mode=userformat
9
{{#dpl: category=African_Union_member_states¦Cities|resultsheader=%TOTALPAGES%|noresultsheader=none|mode=userformat
9
1 3.2.1
good morning!
{{PAGENAME}} DPL Invoking Example
LOL!!!
the {{PAGENAME}} is Sandbox