Difference between revisions of "Template:ContentDirectory"

From Creative Commons
Jump to: navigation, search
(:= breaks links.)
(One last attempt to get directory categories working.)
 
(16 intermediate revisions by 3 users not shown)
Line 15: Line 15:
  
 
The order of the fields is not relevant. The template should be given as the ''first'' thing on a page.
 
The order of the fields is not relevant. The template should be given as the ''first'' thing on a page.
 
'''Otherwise, you can easily add articles by using a form, just go [http://wiki.creativecommons.org/Special:AddPage/Form:ContentDirectory here]'''
 
 
  
 
</noinclude><includeonly>
 
</noinclude><includeonly>
Line 24: Line 21:
 
! colspan="2" style="background: #006600; color: white" |[[Name:={{{Name|{{PAGENAME}}}}}|Content Directory]]
 
! colspan="2" style="background: #006600; color: white" |[[Name:={{{Name|{{PAGENAME}}}}}|Content Directory]]
 
|-
 
|-
! URL:
+
! URL: {{{mainurl}}}
| {{#if: {{{mainurl|}}} | [[mainurl::{{{mainurl}}}|{{{mainurl}}}]] | (none) }}
 
|-
 
! CC licensed content portal:
 
| {{#if: {{{ccportal|}}} | [[ccportal::{{{ccportal}}}|{{{ccportal}}}]] | (none) }}
 
 
|-
 
|-
! CC licensed content feed:
+
! CC licensed content portal: {{{ccportal|}}}
| {{#if: {{{ccfeed|}}} | [[ccfeed::{{{ccfeed}}}]] | (none) }}
 
 
|-
 
|-
{{#ifeq:{{{apiportal|}}}|||{{Tablerow|Label='''Developer API:'''|Value=[[apiportal:={{{apiportal}}}]]}}}}
+
! CC licensed content feed: {{{ccfeed|}}}
 
|-
 
|-
! Formats:
+
! Formats: {{{format|}}}
| {{#if: {{{format|}}} | {{#arraymap:{{{format|}}}|,|x| [[format::x]]}} | (unknown) }}
 
 
|-
 
|-
{{#ifeq:{{{size|}}}|||{{Tablerow|Label='''Approximate Size of the CC-licensed collection'''|Value=[[size:={{{size}}}]]}}}}
+
! Approximate size of the CC-licensed collection: {{{size|}}}
 
|-
 
|-
 
|}
 
|}
 
[[Category:Content_Directory]]
 
[[Category:Content_Directory]]
 +
[[Category:{{{format|Other}}}_Directories]]
 
</includeonly>
 
</includeonly>

Latest revision as of 00:13, 25 June 2015

This template simplifies the creation of articles about Content Directories. When inserted in a directory's page, it creates a decorative table with information about the content provided. It also takes care of annotating the given data semantically, so that users can easily find it or query it in other articles. Do not try to read this page's source code for learning table syntax – there are far easier ways of creating tables in MediaWiki.

To use this template, insert the following at the beginning of your page. All fields are optional and should be omitted if no information is available. The page name should reflect the name of the Content Directory.

{{ContentDirectory|
  mainurl= The main URL of the site (ie: http://flickr.com)|
  ccportal= The URL for the CC-only portal (ie: http://flickr.com/creativecommons/)|
  ccfeed= The URL for the CC-only feed |
  apiportal= The URL for API documentation for the site (ie: http://www.flickr.com/services/api/)|
  format=Sound, MovingImage, Image
  size= Approximate size of the CC-licensed collection (ie: 1000)|
 }}

The order of the fields is not relevant. The template should be given as the first thing on a page.