Difference between revisions of "Image galleries with DPL"

From Organic Design wiki
m
(Change source-code blocks to standard format)
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
This is an example of how to create image galleries from specific selections of images using DPL. The Resulting lists of articles selected by DPL are rendered through [[Template:DPLGallery]] which simply renders the image within a div with a title below it and CSS then does the layout and style for the gallery look and feel.
 
This is an example of how to create image galleries from specific selections of images using DPL. The Resulting lists of articles selected by DPL are rendered through [[Template:DPLGallery]] which simply renders the image within a div with a title below it and CSS then does the layout and style for the gallery look and feel.
  
== All article in Category:Caterpillars ordered by date ==
+
== Example 1: All articles in [[:Category:Caterpillars]] ordered by date ==
 
The following wikitext...
 
The following wikitext...
{{code|<pre>{{#dpl:category=Caterpillars|namespace=File|ordermethod=firstedit|order=descending|format=,²{DPLGallery¦%TITLE%}²,,}}</pre>}}
+
<source>
 +
{{#dpl:category=Caterpillars|namespace=File|ordermethod=firstedit|order=descending|format=,²{DPLGallery¦%TITLE%}²,,}}
 +
</source>
  
  
Line 9: Line 11:
 
{{#dpl:category=Caterpillars|namespace=File|ordermethod=firstedit|order=descending|format=,²{DPLGallery¦%TITLE%}²,,}}
 
{{#dpl:category=Caterpillars|namespace=File|ordermethod=firstedit|order=descending|format=,²{DPLGallery¦%TITLE%}²,,}}
 
<div style="clear:both"></div>
 
<div style="clear:both"></div>
== Only green caterpillars ordered by name ==
+
 
This is a variation of the query which restricts the results to only images containing the word "green" in the title, and uses the default alphabetical order.
+
== Example 2: Green/Yellow caterpillars ordered by name ==
{{code|<pre>{{#dpl:category=Caterpillars|namespace=File|titleregexp=green|format=,²{DPLGallery¦%TITLE%}²,,}}</pre>}}
+
These are a variation of the above query which restricts the results to only images containing the word "green" and another with only images containing "yellow" in the title, and uses the default alphabetical order.
 +
<source>
 +
{{#dpl:category=Caterpillars|namespace=File|titleregexp=green|format=,²{DPLGallery¦%TITLE%}²,,}}
 +
</source>
  
  
 
{{#dpl:category=Caterpillars|namespace=File|titleregexp=reen|format=,²{DPLGallery¦%TITLE%}²,,}}
 
{{#dpl:category=Caterpillars|namespace=File|titleregexp=reen|format=,²{DPLGallery¦%TITLE%}²,,}}
 +
<div style="clear:both"></div>
 +
{{#dpl:category=Caterpillars|namespace=File|titleregexp=[Yy]ellow|format=,²{DPLGallery¦%TITLE%}²,,}}
 +
 +
[[Category:Examples]]

Latest revision as of 18:11, 22 May 2015

This is an example of how to create image galleries from specific selections of images using DPL. The Resulting lists of articles selected by DPL are rendered through Template:DPLGallery which simply renders the image within a div with a title below it and CSS then does the layout and style for the gallery look and feel.

Example 1: All articles in Category:Caterpillars ordered by date

The following wikitext...

{{#dpl:category=Caterpillars|namespace=File|ordermethod=firstedit|order=descending|format=,²{DPLGallery¦%TITLE%}²,,}}


produces this gallery...

Example 2: Green/Yellow caterpillars ordered by name

These are a variation of the above query which restricts the results to only images containing the word "green" and another with only images containing "yellow" in the title, and uses the default alphabetical order.

{{#dpl:category=Caterpillars|namespace=File|titleregexp=green|format=,²{DPLGallery¦%TITLE%}²,,}}