Summary: Discussion of Licenses
Version: 20180415
Status: Stable
Maintainer: Petko (original author: Pm)
Categories: Markup PHP72

This is a talk page for improving Licenses.

These updates were contributed by other developers.

Easy 3.0 update + icons for the individual license conditions

in response to Lighans' suggestion below, a new recipe is not required in order update PM's current recipe - rather, one need only add their own up-to-date $LicenseTypeFmt array to their config before loading the licenses.php recipe. In fact, here's a version of $LicenseTypeFmt that includes the possibility of quickly changing the location, version, and size, and also includes the display of icons for the individual license conditions:

$LicenseDefault = 'by-sa-nc';
$LicenseLoc = "/us";  # location is not necessary - the following works without it
$LicenseSize = "88x31";	# regular size
#$LicenseSize = "80x15";  # smaller
$LicenseVersion = "3.0";  # change or update the version

$LicenseTypeFmt = array(
   # main licenses
   'by' => "[[$LicenseVersion/ |$LicenseVersion$LicenseLoc/$LicenseSize.png\"Creative Commons License\"]]",
   'by-nd' => "[[$LicenseVersion/ |$LicenseVersion$LicenseLoc/$LicenseSize.png\"Creative Commons License\"]]",
   'by-nc-nd' => "[[$LicenseVersion/ |$LicenseVersion$LicenseLoc/$LicenseSize.png\"Creative Commons License\"]]",
   'by-nc' => "[[$LicenseVersion/ |$LicenseVersion$LicenseLoc/$LicenseSize.png\"Creative Commons License\"]]",
   'by-nc-sa' => "[[$LicenseVersion/ |$LicenseVersion$LicenseLoc/$LicenseSize.png\"Creative Commons License\"]]",
   'by-sa' => "[[$LicenseVersion/ |$LicenseVersion$LicenseLoc/$LicenseSize.png\"Creative Commons License\"]]",
   'pd' => "[[ |$LicenseSize.png\"Public Domain Dedication\"]]",

   # individual license condition icons
   'by-icon' => "[[ |\"Creative Commons - Attribution\"]]",
   'sa-icon' => "[[ |\"Creative Commons - Share Alike\"]]",
   'nd-icon' => "[[ |\"Creative Commons - No Derivative Works\"]]",
   'nc-icon' => "[[ |\"Creative Commons - Noncommercial\"]]",
   'pd-icon' => "[[ |\"Creative Commons - Public Domain\"]]"

As a result, one can call (:license nc-icon:) and get the non-commercial icon to appear... overtones99 August 04, 2009, at 10:42 PM

An updated license recipe, incorporating all of the above!

licenses-2009-08-04.phpΔ - So, this may be a little too complex for such a simple recipe, but I went ahead and created another recipe that takes the modifications mentioned above - the ability to declare a location, to display a license-condition icon, to change the size - and makes them possible at the markup level. This only makes sense for a site where individual users may want to declare different creative commons licenses for different groups or pages; for sites that only need one site-wide license, I recommend just using the original licenses.php by PM.

To start, simply include the file:


... and then use any of the following markup to indicate license-type, size, and location (optional):

(:license type=by-nc-nd size=large loc=us:)
(:license by-nc-nd size=small:)

This version of the license recipe also incorporates the individual license-condition icons for each aspect of a CC license, i.e. Share Alike, No Derivatives, etc. These are accessed the same as above, but without any size or location arguments, using one of the following arguments - by-icon, sa-icon, nc-icon, nd-icon, pd-icon - as in:

(:license by-icon:)
(:license type=by-icon:)

The recipe also permits the following default variables in config.php:

  • $LicenseDefault - i.e. 'by-nc-nd', 'by-icon', ... - used if no type is supplied
  • $LicenseLoc - not required - otherwise enter one of the following two-letter country codes: at, cz, de, ec, es, gr, gt, hk, hr, lu, nl, no, nz, ph, pl, pr, ro, rs, sg, th, us
  • $LicenseSizeDefault - 'large' or 'small' - determines which size license to post if no 'size' argument is provided
  • $LicenseSizeArray - defaults sizes for the two kinds of icons on the creativecommons site - 'large'=>'88x31', or 'small'=>'80x15' - this only applies to the main licenses, not the individual license-condition icons
  • $LicenseVersion - easily update the version your using - default is '3.0'
  • $LicenseBaseLinkURL - base link for most (not all) of the CC-deed link urls - default is
  • $LicenseBaseImgURL - base link for most (not all) of the CC-image urls - default is

overtones99 August 04, 2009, at 10:42 PM


  • 2009-08-04: added a new receipe, based on the original, that permits markup of the type: (:license type=by-nc-sa size=small loc=es:), along with markup to show individual license-condition icons.
  • 2009-08-04: added an example of a $LicenseTypeFmt array containing v.3.0 icons, PLUS the ability to display the various individual license-condition icons
  • 2007-03-07: This version is for the new creative license 3.0. It also ads nice 80X15px buttons when entering the code. Not sure if I could remove the other one. licenses30.phpΔ Lighans

You can also create a creative commons licence this way[1]

(:comment The default licence:)
(:div179 class='frame' style='width:24em; font-size:x-small;':)
%rel="license" lfloat%[[|"Creative Commons License"]]
These works are licensed under a Creative Commons %rel="license"%[[ | Attribution-Noncommercial-No Derivative Works[[<<]]3.0 New Zealand License]].

Creative Commons License

These works are licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works
3.0 New Zealand License

  • change licence link as required
  • include into wiki pages as required (possibly using a group footer)

I am looking into putting a more complete CC license into my wiki, which include several non-standard attributes that allow for Semantic web information. The license text if you get it from CC, looks as follows:

 <a rel="license" href="">
 <img alt="Creative Commons License" style="border-width:0" src="" /></a>
 <span xmlns:dc="" href="" property="dc:title" 
 rel="dc:type">Tamara Temple’s Wiki</span> 
 by <a xmlns:cc="" href="" 
 property="cc:attributionName" rel="cc:attributionURL">Tamara Temple</a> 
 is licensed under a <a rel="license" href="">
 Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License</a>.
 Based on a work at 
 <a xmlns:dc="" href="" rel="dc:source"></a>.

As you can see, there are a few non-standard attributes:

In the first <span>, xmns:dc and property.

In the second <a>, xmlns:cc and property.

In the fourth and last <a>, xmlns:dc.

There are at least a couple of ways to go about this:

  1. Do like licenses.php does and provide a single markup expression that will gather the necessary information and build the html code:
    (:cclicense type=licensetype attribname="Tamara Temple" attriblink="" workname="" worklink="":)
  1. Set up a wikistyle for links and spans and add the attributes for each to that, in a recipe or in config.php
    %xmlns:dc="" href="" property="dc:title" 
rel="dc:type"% Tamara Temple&rsquo;s Wiki%% 
I have no idea if you can set an attribute for xmlns:dc via setting $WikiStyleCSS[]="xmlns:dc". It appears putting:
 ## Add WikiStyleCSS attributes for above:
into config.php does not do the trick, I'm guessing because of the ":" in xmlns:dc and xmlns:cc.

tamouse July 07, 2011, at 06:32 PM

Talk page for the Licenses recipe (users).