Hello hello one and all! Welcome to DPL 101. I'm sure you've probably seen alot of us ranting and raving about the glory of all that is DPL and want to know how it works. And well, I may not know why it works, but I sure as hell know how, so I may as well get the knowledge out there.
This Tutorial's gonna cover three things; What DPL Is, A Simple DPL, and a Complex DPL.
This Tutorial will not cover absolutely posolutely everything a DPL is capable of doing, only what it does that is often used on the wiki. Consider everything I've not covered as your homework.
DPL is short for Dynamic Page List, it's an extension we use pretty much everywhere these days to take all the pages in a given category, and have them automatically spat and formatted onto a big table, or occasionally into a big gallery. It's useful for something like, Category: Fallout 3 characters for instance, because adding every character from Fallout 3 onto one table manually would be a massive pain in the ass.
Specifically, the flavor of DPL we use around this part of the woods is DPL3. There are two versions of DPL that preceed it; Dynamic Page List, and Dynamic Page List (Third-Party). All you really need to know about that, thanks to efforts from the extension's creators to maintain backwards compatability, instructions for one or the other are usually good for DPL3 too. Emphasis on "Usually". Don't come cryin to me if somethin don't work.
DPL doesn't just take a bunch of names and slam them into a list though (Although, it can do just that if you really want), it can also take lines from infoboxes and other templates, and put them in the table too! If you want every character in one category listed with their location beside them, so long as that information's in the template, you can put it there! Pretty neato, ain't it?
Alright, barebones stuff. So, whenever you want to do a DPL, you have to start off by putting
{{#dpl:
This shouldn't be too unfamiliar if you've ever put a template onto a page at any point. Next, is a handful of variables. Lets cover em all real quick, first up the ones that can go in basically any order (Though I have listed them in the recommended order, so that future editors don't have to try too hard to change anything about it)
First up we have Category, super simple this one, just put whatever category you want to pull from here (With the Category namespace included). If you want to include more than one category to pull from, just seperate it by a pipe escape (not a pipe). Here's an example of this one.
Example
|category = Category:Winter of Atom characters
|category = Category:Winter of Atom characters {{!}} Category:Fallout Shelter characters
However, the pipe escape functions as an OR gate, if for instance you want to use an AND gate, just put the category parameter in again.
Example
|category = Category:Winter of Atom characters
|category = Category:Fallout 3 characters
In this example; the DPL will pull pages that are from Winter of Atom chartacters and Fallout 3 characters. Or in other words, characters that feature in both Fallout 3 and Winter of Atom, but not in just one of them.
Super simple again, this one is the opposite of the one above; any categories you state in this will be excluded from the DPL. For example, if you wanted to take all the Fallout Shelter characters, but cut out every Fallout 3 character from it, you would put
Mode can apparently do a bunch of stuff that I'm sure is all really exciting, but here on the wiki, we basically only use it for Gallery. Stick Gallery in this puppy to draw every image that matches your categories, and slam them in a gallery. Doesn't get much use, but is good to know!
Okay, this is one of the parameters that doesn't actually get too much change. It determines the order in which the pages that you pull from the category will be listed. You're either gonna put "title" or "sortkey" most of the time, though there are a handful of other things you can put in there for different orderings, "firstedit" will order with the oldest created page first for instance.
Right, so this one is a bit of a way to cheat, on account that it pretty much lets you pick and choose specific pages to exclude from the DPL. Basically, just put the name of the page here and it gets cut out. If you want to list more than one page, put one of these funky things ¦ between each one. (You might wanna keep that funky thing on your clipboard because it gets alot of use later). If, however, you have a bunch of pages with roughly the same name that you wanna exclude, you can cheat inside the cheat for some beautiful cheatception by using wildcards. In this type of DPL, wildcards are the % symbol and determine anything and everything. For instance, "A%" will cut out each and every page beginning with the letter A.
Alrighty! This is where the real meat 'n' potatoes begins. The Uses parameter targets templates on all the pages in the category you selected. If you want a list of characters for instance, you'll probably be wanting to set your sights on Template:Infobox character. We get to define what specifically we want to take from the templates in just a little bit, but for now, just list the templates. Much like with the categories earlier, you need to include the namespace (in this case Template:) and if you want to pull from more than one, you'll be seperating each one with a pipe escape.
Example
|uses = Template:Infobox association {{!}} Template:Infobox faction {{!}} Template:Infobox location
You'll want to pull up a chair while typing this bit, it's a long one. So, this is where you determine what stuff you want to pull from the templates you just listed, on each of the pages. Say if your template is a list of slogans, and you wanna pull the Slogan variable and the Game variable from the Association and Faction infoboxes, you'll be wanting to put
This part can easily become spaghetti once you start calling alot of variables from alot of templates, but it's recommended for ease of reading and ease of converting to other types of table and DPL, that you keep the ordering as consistent as you can. Keep all of the first variable you want together, and all of another variable together, and so on. And in addition, make sure that each called template is kept in the same order within those groups of variables. For instance, notice how in my example, I stated Association before Faction in both instances.
In some instances, you can simplify this by ordering things a slightly different way. In this alternate ordering, you only need to say which template you want to pull from once, and then list each variable you want to pull from after it. This can be more legible in bigger templates where putting things the usual way might look pretty spaghetti, but does not always work as it should and is not as easy to convert to other types of table or DPL.
This is where you but the assorted bits and pieces that tell the DPL how to lay out all the information you've told it to get. In 99.9% of cases, you'll want it as a table. As such, here is a little excerpt for you to copy-paste that'll make it a table.
Naturally, replace "Heading 1" and so on with whatever you want for your table, just make sure that each row begins with a ! and ends with a ¶, and also that the final heading has the three commas just before it's ¶. I'll be honest, I don't know why the commas need to be there, I just know they have to be. The reason for the ¶ is pretty simple though, and is because of the next parameter
Secseparators are easy as easy can be, because it'll always be the same thing. They determine what the DPL treats as a new line for its formatting, but not for its parameters. Consider it like a <br /> when you're editing pages, except one you need to put or the line wont break otherwise.
And now for the weird part, the bit where you tell it where exactly on your table to put the information. You can sorta treat this as "Formatting 2" and it might even just be part of the formatting parameter, but it goes after the Secseparators and doesn't have an actual parameter name, so I'm treating it like this. Basically, after your secseparators, just go on down to the next line and put all this whatevers.
For each heading you've got (I used 4 in my example so I will use 4 here), make a new line and begin it with ¦ (I told you it would come back!). These are the first cell in each row. So the first ¦ you've got will be the first box for heading 1, the second ¦ you've got will be the first box for heading 2, and so-on. It seems intimidating but is quite easy; for each template you called in your #uses parameter (We covered it earlier), you'll want to put two commas. Just two commas each. And then, after the commas, top the line off with one of those ¶ we used earlier. Remember; unless you're doing something uber unique, each line should have the same amount of commas as the other lines.
Example
¦ ,,,,,,,,¶
¦ ,,,,,,,,¶
Sometimes, you'll get an exception to just putting a bunch of commas though, but they're easy.
If you want to handle images in one collumn, just put all the stuff you'd usually put down to put an image onto a page, but where you'd usually put the image name, just put all of the commas I just mentioned, like so
Example
¦ [[File:,,,,,,,,|250x250px]]¶
¦ ,,,,,,,,¶
And if you want to put the name of the pages into one collumn, just ignore commas altogether for that line and just put in
¦ {{pagename nd link{{!}}%PAGE%}}¶
¦ ,,,,,,,,¶
So, I'm not 100% sure on the why this has to be, but my working theory is do to with that #include parameter we covered earlier. Notice how we seperated each variable we're calling from the template with commas? I'm pretty sure that we have to state two commas because that's how it hones in on what we've typed there. For example in the example I used in that section ,,,, would be setting the section's sights on {Infobox faction}:slogan.
If you want to add another template or variable to an existing DPL, it's not very hard. Just go back to #uses, slam in a pipe escape, and then slam in whatever new template you want in. Then, go to that #include bit, and slam in all the variables you want in (Try to keep things orderly though for future editors!), and then go down to that bit with all the commas, and just add another two of them on each line (Unless it's like the page name line, as shown above). Naturally, if you added two new templates, add four commas, or if you added four new templates, add eight new commas, and so on.
And lastly, but not leastly, Slam in one o' these puppies to close off your DPL, and hit preview.
}}
If everything has gone down right, you should be looking at what you want and then hit publish (just to make sure you don't lose anything), if not...
Well, DPL has basically a two-step troubleshooting process for most issues. One, make sure all of the stuff is typed out properly, without any typos or shorthand or anything like that; and Two, try adding or removing commas from the comma sections, each line should still have the same amount as the last, but try just adding or removing them in sets of twos until something looks right-er. Solution 2 usually works when your issue is that everything you're wanting to pull from has been smooshed together into one cell, or the wrong cell, or one row.
Incase you want to look at an example of what a whole working DPL looks like, to compare your work to, here is an abridged version of the Slogans page;
Right! I hope you read (or already knew) that stuff from the simple DPL section, because Now we're gonna move onto Table DPLs! Now you see, what the Simple DPL section does is effectively take a DPL, and then take a Table, and smoosh them together. But what this kind of DPL does is make the DPL as a table. It's a minor difference, but one that changes how you type one up, and the stuff it can do. The primary benefit is that it lets you use #if parsers in it, which lets you do basically all of the fun and wacky stuff you can do in normal tables in a DPL, something you can't completely do in your standard DPL. The drawback however, is that it's behaves in a bit more of a peculiar manner, and you have to occasionally fight to make it put content in the right cells. Fortunately for you, and the other users on this site, I've whipped up a handful of templates that'll hopefully turn "Pulling teeth" into "just a bit tricky".
First off, certain parameters I mentioned in the simple DPL section either don't work or don't need using; Secseparator and Format especially can be tossed out the window, and we can introduce you to your new best friends, Table and Tablerow.
Table is basically your alternate universe version of #format, it contains all the same kinds of stuff, but laid out ever so slightly different. Three types of things go here; Table Class, Table Style, and Table Headings. Class and Style are easy to get, they're just the same stuff HTML uses, and the same stuff you'd punch into any table on the wiki, and the same thing you would have put into the format box in a regular DPL. The extra good news is that the wiki's got such consistant formatting, you'll probably never need to change the class from
Following that, is either your Table Style (Which isn't essential) and your Table Headings. The headings are so easy it almost doesn't require saying, it's just a comma-seperated list, HOWEVER the first variable should be
,-,
This is so that the table doesn't try to automatically start with the page name. You're welcome to skip it if you want the page name to be the first collumn, but for most uses you might wanna put it in the second collumn, or apply some kind of formatting to it, or use Template:Pagename nd to drop anything in brackets. Here's an example of a good Table parameter.
Example
|table= class="ace-table ace-table-shaded ace-table-center" ,-, Image, Name, Slogan, Game
Much like how Table is the alternate universe #format, Tablerow might as well be the alternate universe version of #Everything else you need because everything that goes a-proper in your table goes here. However don't be decieved, unlike how Format and Table are, Tablerow is laid out in an entirely different way, so for this you may as well throw out all that.... or well, MOST of that....
It's actually a little simpler than the normal DPL, instead of a couple commas, we use a couple of percentage symbols. %% is used as the placeholder for any information that goes in those cells. It'll call your template parameters, but it will call them in order, your first pair will be the first parameter, the second pair will be your second, so keeping each variable called in the recommended order is no-longer a soft recommendation, but more of a hard requirement if you're working with multiple templates.
However here's the issue, you cannot simply just string %% together until the sun explodes in this kind of DPL, that'll just cause the template to repeat the first variable over and over and over... The solution? A custom template, fresh from RurinCo! Just cram a {{¦}} between each %% and slam a comma wherever you want to move onto the next cell, and you're good to go! It's that easy!
Example
|tablerow= %% {{¦}} %% {{¦}} %%,
Aaaand you'd think that'd be it, right? Wrong! Because you get all sorts of fringe issues using the table format. Firstly, I mentioned about moving the name to a different cell earlier yeah? Well, the Table-specific formatting prefers you to explicitly call for the name from the template. It's a small issue, and thankfully it's easily resolved. In your #include section, just make sure to inlude %PAGE% as a variable, like so:
{Infobox consumable}:%PAGE%
and then after that, just go back down to where all your stuff about rows is, and slam in
{{pagename nd link{{!}}%PAGE%}}
into the appropriate cell you want the name to go into. Except that.... Doesn't work.... See, for reasons that work but I cannot explain, for this template in particular, it seems to only like being called once, but will fill itself as you would otherwise want it to, if you leave space for it to in the cell. So, instead of copying it all the times you'd need, just slam in one of those {{¦}} things, and a space for each template you're pulling a page name from, like so:
So, that's it? Wrong again, dingus! We got one more thing to deal with. See, because of how {{¦}} works, sometimes (not always) it breaks templates and other formatting, for example when using it to put images into a cell. Oh no! Buuutttttt, there's a solution! A custom template, fresh from RurinCo! {{DPLcell|}} is effectively two templates in one, but they both do the same thing. If you're doing something that causes the DPL to spit out an error code or garbage text, pull it out. It's a simple template, so that it checks if something is there before calling it.
See, because of how DPL works, it checks every page it covers for every template, but unlike Simple DPLs, this type will try and cram it into the cell even if there's nothing to cram. Usually it just causes nothing to happen; but Modules will throw big red error text out, and images will leave behind a [[File:]] whenever there's nothing to put in there. The usage of Template:DPLcell is documented on it's page, however the basics are to just put whatever template or other content you want to not throw an error for into it's second variable (Remember to use a pipe escape instead of a pipe for it!), like so
{{ DPLcell || {{Abblist{{!}}%%}} }}
And, if you want to put an image into your DPL, just use
{{ DPLcell | image |}}
with the second variable being the image dimensions.
So! With Tablerow all set up and functioning, you should end up with something that might look like this;
Okay, so, whole seperate section on this junk. Parsers! If you don't know how to do all this #if parser junk yet, I'd recommend getting fully abreast on how to do it, like by reading this here, or you can just skip over this little section if you don't have the time.
Basically, much like how you've gotta use funky alternative symbols all over, like the pipe escape, you can't just use the ol' curly bois {{ }} like we usually use, but never fear! There's a solution. DPL's got a handful of things built in to function as stuff that otherwise wouldn't behave prettily in it. I'll list the useful ones here for ease of use;
First off, we got the HTML tags, you'll see em all over like <div> and stuff. To use em in DPLs, you gotta replace the < > with « », so now you have to put «div» instead to get it to work. And naturally, the complimentary closing tag would also use the same symbols, and be «/div»
Your curly bois mentioned previously are much the same. Instead of {{#if: | | }}, you'll find yourself having to use ²{ }². I'm not actually entirely sure when they need to be used, as templates seem to work fine enough inside this version of DPL. So far as I've seen, the only thing that hard requires the fake curly bois are parser fuctions, so keep it in your brain if you plan on using those.
And lastly, our returning champion, ¦. I've seen some folks around call it the broken pipe, and it replaces your standard pipe (That would be | that thing) when even a pipe escape ({{!}}) would be weird or not work... With the exception of your category and template lists, if what you're doing is a part of DPL, you want ¦, and if what you're doing is a part of a template you're trying to put into DPL, you probably want {{!}}.
Here's an example of a working #if parser using some of these funky symbols and is read correctly by the DPL, a pretty abridged version of DPLcell;
So, much like with the simple DPL, incase you want to know what a working version of this kind of DPL looks like behind the curtain, here's once more an abridged version of the Slogans page;
Aaaand that... should be the whole shebang! Congratulations, you now know everything I can think of off the top of my head! Have fun in your miscellaneous tabulated adventures!
↑"Our motto at Bolton Greens is "Ne Plus Ultra" which translates to "Nothing Can Be Better." That's the standard we live by, and why you can be confident that your child is pampered and safe in our hands." (Bolton Greens Terminal Entries)
↑ 21.021.1Travis Miles: ""{NERVOUS} Why drink dirty, radioactive water when you could have it pure and bottled? Sheng Kawolski's Clean Water Market. Straight from the filter."" (Diamond City Radio advertisement)
↑Greeter: "{[Greeter] Shopping center greeter. Proudly reciting a marketing slogan. / Friendly} The General Atomics Galleria is the shopping center of tomorrow, today." (Greeter's dialogue)
↑Sprocket: "{[Sprocket] Formal British clerk. Repeating a slogan, with pride. / Friendly} General Atomics. For all things robotics." (Sprocket's dialogue)
↑Travis Miles: ""{NERVOUS} John and Cathy's Super Salon invites you to try out the latest innovations in hairstyles. Look good. Make people jealous."" (Diamond City Radio advertisement)
↑Josh Laurance: "{121}{}{This is the Last Gasp Saloon and Funeral Parlor. A full service establishment. Bottle to Grave is our motto.}" (Josh Laurance's dialogue)
↑Parker Quinn: "{Surprised} It is! It is. Anything IS possible. You know that used to be the Massachusetts state motto? {Happy} Come to Massachusetts! Where ANYTHING is possible!" (Parker Quinn's dialogue)
↑Travis Miles: ""A portion of this broadcast has been brought to you by the Mega Surgery Center. Now featuring facial reconstructive surgery. Why settle for less than perfection?"" (Diamond City Radio advertisement)
↑Sierra Petrovita: "Nothing beats the taste... the taste that'll knock you out! {Make up a ditty with these lyrics. Any tune. Sing it badly. Its a product slogan.}" (Sierra Petrovita's dialogue)
↑Woman: "Just off the 95 and 98, the Palace welcomes all who seek true enlightenment. Talk to a disciple today, and learn about our special discount on oil cleansings. At the Palace of the Winding Path, you can free your mind and expand your consciousness. You have nothing to lose but your pain." (Pirate radio advertisement)
↑Fallout 3 Official Game Guide Game of the Year Edition p. 61: Bannon "Bannon, 30, is a snappy dresser and a shrewd businessman. His wares are high priced, because he's got no competition. His motto is 'If you don't like the pants, go find them yourself.' Cindy Cantelli has a crush on him and sits with him in church. She also leaves when he does. Bannon is one of three city council members, along with Doctor Li and Harkness. They meet on Monday mornings for a few hours to discuss city-wide issues. He has quite the ego but was chosen by Doctor Li to sit on the city council. She seems oblivious to his flaws." (Fallout 3 Official Game Guide/Wasteland Census)
↑Mr. New Vegas: "The preceding segment was sponsored by the Silver Rush. {Slogan}Silver Rush. Feel the rush of a warm laser in your hand." (Mr. New Vegas advertisement)
↑Festus: "Our motto at Sunset Sarsaparilla is that the customer always comes first, so we have seen fit to provide an alternate reward for your Stars." (Festus' dialogue)
↑Mr. New Vegas: "Promotional consideration for this news segment has been paid for by the Ultra-Luxe. {Slogan}The Ultra-Luxe. Live life in the lap of luxury."
(Mr. New Vegas advertisement)
↑Vault Dweller: "You're about to shout out your cult motto, aren't you?" Vault 144 dweller: "No, not at all. I was going to say... uh... oh, whatever. We are Death's wake-up call!" (Quest dialogue)
↑Mr. New Vegas: "These headlines were brought to you by Vault 21. {Slogan}Vault 21. Everything's better when you experience it in a vault." (Mr. New Vegas advertisement)
↑"Are you the researchers from the Vault? Excellent!
We're the Wasteland Laser Association. Membership limited.
A laser in every hand is our motto!" (Science Cooperative!)
↑"Our motto at Bolton Greens is "Ne Plus Ultra" which translates to "Nothing Can Be Better." That's the standard we live by, and why you can be confident that your child is pampered and safe in our hands." (Bolton Greens Terminal Entries)
↑Greeter: "{[Greeter] Shopping center greeter. Proudly reciting a marketing slogan. / Friendly} The General Atomics Galleria is the shopping center of tomorrow, today." (Greeter's dialogue)
↑Sprocket: "{[Sprocket] Formal British clerk. Repeating a slogan, with pride. / Friendly} General Atomics. For all things robotics." (Sprocket's dialogue)
↑Travis Miles: ""{NERVOUS} John and Cathy's Super Salon invites you to try out the latest innovations in hairstyles. Look good. Make people jealous."" (Diamond City Radio advertisement)
↑Josh Laurance: "{121}{}{This is the Last Gasp Saloon and Funeral Parlor. A full service establishment. Bottle to Grave is our motto.}" (Josh Laurance's dialogue)
↑Parker Quinn: "{Surprised} It is! It is. Anything IS possible. You know that used to be the Massachusetts state motto? {Happy} Come to Massachusetts! Where ANYTHING is possible!" (Parker Quinn's dialogue)
↑Travis Miles: ""A portion of this broadcast has been brought to you by the Mega Surgery Center. Now featuring facial reconstructive surgery. Why settle for less than perfection?"" (Diamond City Radio advertisement)
↑Sierra Petrovita: "Nothing beats the taste... the taste that'll knock you out! {Make up a ditty with these lyrics. Any tune. Sing it badly. Its a product slogan.}" (Sierra Petrovita's dialogue)
↑Woman: "Just off the 95 and 98, the Palace welcomes all who seek true enlightenment. Talk to a disciple today, and learn about our special discount on oil cleansings. At the Palace of the Winding Path, you can free your mind and expand your consciousness. You have nothing to lose but your pain." (Pirate radio advertisement)
↑Fallout 3 Official Game Guide Game of the Year Edition p. 61: Bannon "Bannon, 30, is a snappy dresser and a shrewd businessman. His wares are high priced, because he's got no competition. His motto is 'If you don't like the pants, go find them yourself.' Cindy Cantelli has a crush on him and sits with him in church. She also leaves when he does. Bannon is one of three city council members, along with Doctor Li and Harkness. They meet on Monday mornings for a few hours to discuss city-wide issues. He has quite the ego but was chosen by Doctor Li to sit on the city council. She seems oblivious to his flaws." (Fallout 3 Official Game Guide/Wasteland Census)
↑Mr. New Vegas: "The preceding segment was sponsored by the Silver Rush. {Slogan}Silver Rush. Feel the rush of a warm laser in your hand." (Mr. New Vegas advertisement)
↑Festus: "Our motto at Sunset Sarsaparilla is that the customer always comes first, so we have seen fit to provide an alternate reward for your Stars." (Festus' dialogue)
↑Female Announcer: "See you at the Tyler County Dirt Track, where the fun comes at you head-on!" (Pirate Radio advertisement)
↑Mr. New Vegas: "Promotional consideration for this news segment has been paid for by the Ultra-Luxe. {Slogan}The Ultra-Luxe. Live life in the lap of luxury."
(Mr. New Vegas advertisement)
↑Vault Dweller: "You're about to shout out your cult motto, aren't you?" Vault 144 dweller: "No, not at all. I was going to say... uh... oh, whatever. We are Death's wake-up call!" (Quest dialogue)
↑Mr. New Vegas: "These headlines were brought to you by Vault 21. {Slogan}Vault 21. Everything's better when you experience it in a vault." (Mr. New Vegas advertisement)
↑"Are you the researchers from the Vault? Excellent!
We're the Wasteland Laser Association. Membership limited.
A laser in every hand is our motto!" (Science Cooperative!)
↑ 1.01.1Fallout 4 Vault Dweller's Survival Guide Collector's Edition p.516: "[18.06] THE GWINNETT RESTAURANT This front-of-house restaurant allowed beer aficionados to sample such fine products as Gwinnett’s Pale Ale, Peabody Pilsner, Dead Redcoat Ale, and the infamous Bunker Hill Brew. "Give a Man... a Taste of Freedom!" the slogan said. Now the place is piled high with offal and half demolished by Super Mutants. There is a main entrance, as well as a rear entrance (Advanced) for those of a stealthy disposition. The Gwinnett Brewery (Primary Location) can be accessed via the security door and large Mirelurk-infested pipes. If you aren’t competent at hacking, find the Gwinnett Brewery password, but approach from the brewery side, not via the restaurant." (Fallout 4 Vault Dweller's Survival Guide/Map)