Anonymous
Not logged in
Talk
Contributions
Create account
Log in
Search
Editing
DPL3/Parameters: Controlling output format
(section)
From KB42
Namespaces
Page
Discussion
More
More
Page actions
Read
Edit
Edit source
History
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Control the way article names are displayed == ===shownamespace=== {{DPL parameter |name = shownamespace |purpose= To restrict the appearance of the namespace name of a page before the page. As the switch is ''true'' by default it should be set to ''false'' if you want to avoid namespaces to be shown in the output. }} Syntax: {{DPL syntax|shownamespace=false}} Example: <!-- originally, category=Africa, namespace=Talk --> <pre><nowiki> <dpl> category = Help namespace = Help_talk shownamespace = false </dpl> </nowiki></pre> This list will output all Talk pages in [[:Category:Help]], listed without the 'Help talk:' prepended to page names.<br/> The namespace 'Talk' refers to talk pages within the main namespace; all other talk namespaces, such as 'Help' or 'Guide' talk pages, would need the format '''namespace''_talk'.<br/> Only talk pages that have been added to the category (by placing <nowiki>[[Category:Help]]</nowiki> on the talk page) will be listed. <dpl> category = Help namespace = Help_talk shownamespace = false </dpl> Note that in {{dpl3|mode|=userformat}} there is a different way to decide whether you want to output the title with or without namespace. In {{dpl3|mode|=userformat}} two built-in variables are provided which contain the page name including the namespace ({{tt|%PAGE%}}) and the base title name ({{tt|%TITLE%}}). ===escapelinks=== {{DPL parameter |name = escapelinks |purpose= Regarding ''images'' and ''categories'' this parameter allows you to decide whether * you want to see a link to the image or to the category page ({{dpl3|escapelinks|=true}}, this is the default) * you want to see the image or make the page which contains the DPL statement part of the categories which are returned by DPL ({{dpl3|escapelinks|=false}}) }} Syntax: {{DPL syntax|escapelinks=false}} Note: You can use this parameter to show images; another way to do this is to use the gallery extension in combination with DPL; there is an {{dpl3|Test escapelinks|example}} for this on the dpldemo website. ===titlemaxlength=== {{DPL parameter |name = titlemaxlength |purpose= To limit the number of characters of the title to display. If the page title (this does not include the namespace or any other prefix before the title) is bigger than the {{dpl3|titlemaxlength}} value, the title is truncated and ended by '...'. }} Syntax: {{DPL syntax|titlemaxlength=''number of characters''}} ===replaceintitle=== {{DPL parameter |name = replaceintitle |purpose= execute a string replacement operation on the {{tt|%TITLE%}} var }} Syntax: {{DPL syntax|replaceintitle=''search for,replacement''}} The ''search for'' argument must be an expression which can be used in a php preg_replace() function call. Example: to remove the string "demo" in article names, you must write : <code>replaceintitle=/demo/,</code> Note that standard regexp rules apply. The regexp must start with a non-alphanumeric character -- but not with a backslash! It is good habit to use a '/' if this character is not needed within the regexp itself. Read the php manual to understand the details of regular expressions.
Summary:
Please note that all contributions to KB42 may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
KB42:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
DONATE
Wiki tools
Wiki tools
Special Pages
Categories
Import Pages
Cargo data
Page tools
Page tools
User page tools
More
What links here
Related changes
Page information
Page logs