Difference between revisions of "Sandbox"

From FollowTheScore
Jump to: navigation, search
(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 14: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| °° 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';

°

 {{#dplmatrix: name | yes | no | mode | '''indented_list''' }}

°

  {{#dplnum:text}}

°

 (1) {{#dplvar:set    |name1|value1|name2|value2|..|..}}
 (2) {{#dplvar:default|name|value}}
 (3) {{#dplvar:        name}}

°

ordermethod Determines what criterium (resp. criteria) is (resp. are) used to order the list.

Syntax:

ordermethod=method1,method2,... means ordered by method1 first, then by method2, etc. (like the ORDER BY clause in SQL)

methodN can be one of the following single tokens:

categoryadd
outputs list based on most recent addition to the first category (requires to include one category and one only using 'category' parameter)
counter
outputs list based on the number of times the page has been viewed (by ~popularity)
size
outputs list based on the size of the article (bytes of wiki text)
firstedit
outputs list based on first edit to the pages (creation)
lastedit
outputs list based on most recent edit to the pages
pagetouched
outputs list based on 'page_touched' timestamp. Read comment on page_touched field in Page_table to see the difference from most recent edit by an author.
pagesel
outputs list based on the names of the reference pages which are used in the selection of a linksfrom or linksto statement. pagesel only makes sense if there is more than one page mentioned in the linksfrom or linksto condition.
title
outputs list sorted by article (prefix +) title
titlewithoutnamespace
outputs list sorted by the article name regardless of namespace — (default)

methodN can also be one of the following token combinations (see also headingmode option):

category,firstedit
outputs list sorted by category, then by first edit
category,lastedit
outputs list sorted by category, then by last edit within a category
category,pagetouched
outputs list sorted by category, then by pagetouched
category,sortkey
sortkey
outputs list sorted by title and sortkey, requires at least one category statement
user,firstedit
outputs list sorted by user, then by firstedit by the user
user,lastedit
outputs list sorted by user, then by lastedit by the user
none
do not apply any ordering (except ordering by timestamp if you requested a list of revisions); this method must be used when you specify openreferences=yes.

Note: For downward compatibility reasons DPL will use 'addfirstcategory' as its default order method if called via the <dynamicPageList>

Example:

<DPL>
  category=Africa
  ordermethod=lastedit
</DPL>

This list will output pages that have [[Category:Africa]] showing most recently edited articles at the top. °°

 {{#dplchapter: text | heading | limit | page | linktext }}

° Download the ZIP archive and extract the DynamicPageList subdirectory to a directory named yourwiki/extensions/DynamicPageList. You may ignore the other extensions but it is recommended to install at least Call and Inputbox as some DPL based applications like the DPL GUI use them. °|°}} {{#arraysort:x|random}} {{#arrayindex:x|0}}

3

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

%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