Shortcode Reference

This page needs editing

The basic shortcode for the insertion of a wppa+ display in a page or post is: [wppa][/wppa].
The shortcode allows attributes that specify the type of wppa+ display as well as the specification of albums, photos or special selection of photos.

The basic structure is: [wppa attr1="value1" attr2="value2" ...][/wppa] The sequence order of attributes is irrelevant.

Important note: Make sure you do not accidently create the shortcode by a copy from an example text or an email. The double quotes might be "texturized" i.e. opening and closing quotes in stead of simple double quotes. This will result in unwanted behaviour!

The following attributes are recognized:

Attrubte Description Remarks
type The type of the display Default: generic
album The album spicification
photo The photo specification
size The width ( if not the default )
align The horizontal alignment
taglist Tags to use Used in type="multitag" and type="tagcloud"
cols
sub
root
calendar
all
reverse
landing
admin

Possible values for all recognized attributes: (Note: n and m stand for any positive integer number, x stands for any real number in the range 0 < x < 1.)
The album number n may also be ( a combination of ) an enumeration (e.g 2.5.6) or a range (e.g. 5..8) or combination of both (e.g. 2.6.7..10 ).

Attrubte Value Remarks
type generic This is the default value and generates a generic albums display: a list of album covers that have their parent set to ---none---, or the display as requested by the querystring that calls for the page involved.
landing Same as generic, except that it only displays that what is requested in the querystring.
cover The requested display type is the cover of an album. The album must be specified in the album attrubute.
album
content
Displays sub-album covers and thumbnail images of photos in the album as specified in the album attribute.
thumbs Displays thumbnail images of photos in the album as specified in the album attribute.
covers Displays sub-album covers in the album as specified in the album attribute.
slide Displays a slideshow of the photos in the album as specified in the album attribute.
slideonly A slideshow without supporting navigation boxes.
slideonlyf A slideshow with the filmstrip only.
photo A single photo as specified by the photo attibute.
mphoto A single photo displayed with the wp caption.
slphoto A single photo in the style of a slideshow, but without navigations.
The following type specifications produce wppa+ supporting boxes rather than photo displays:
upload Creates a frontend upload box like the upload widget. An album spec can be given to restrict the uploads to the supplied album(s). If the visitor has no rights to upload here, the box will not be displayed.
multitag Creates a multitag selection box like the tags filter widget. An optional taglist spec can be given to restrict the tags shown, a cols spec to specify the number of columns. Example: [wppa type="multitag" taglist="Bird,Duck,Owl" cols="3"][/wppa]
tagcloud Creates a tagcloud box like the tagcloud widget. An optional taglist spec can be given to restrict the tags shown. Example: [wppa type="tagcloud" taglist="Bird,Duck,Owl"][/wppa]
superview Creates a box with content like the superview widget.
search Creates a box with content like the search widget. Optional arguments: sub="1" to enable subsearch (search from within current results) and root="1" to enable rootsearch (search form current album and its sub albums). To start the search from a certain album root use root="#123", where 123 is the album id. Additionally the shortcode attribute landing="123" can be used to specify a landing page id (123 in this example).
Miscellaneous type specifications:
url Returns the url of a specified photo id. Examples:
[wppa type="url" photo="4711"][/wppa] and
[wppa type="url" photo="#potd"][/wppa]

Example use in template ( php ): echo '<img src=".do_shortcode('[wppa type="url" photo="4711"][/wppa]')." />';
This is equivalent to echo '<img src=".wppa_get_hires_url(4711)." />';, but you can use 'photo="#potd"' in the shortcode version.
Example use in page content: <img src='[wppa type="url" photo="4711"][/wppa]' />. Note the single quotes in the src attribute of img.
album n The id of the album to be used for the type of display requested by the type attribute. May also be an emumeration like 2.3.7.10 or a range like 34..38 or a combination of that like 1.45.7..9.11
$albumname The name of the album to be used for the type of display requested by the type attribute. When using qTranslate make sure the name language matches the page language.
#last The most recently added (youngest) album.
#last,0,1 The most recently modified album. This is most likely the album that has the most recently uploaded photo.
#last,p,k The k most recently modified albums with parent album p. Thes are most likely the albums that have the most recently uploaded photos. Parent p may also be an album name preceded by a $ sign.
#topten[,n[,m[,medals]]] A virtual album containing the highest rated photos. May optionally include albumnumber (n, 0 for systemwide) and number of photos(m), use 0 for the default as defined in the Settings admin page; add 3rd attribute medals to display only top photos with medals.
#lasten[,n[,m]] A virtual album containing the most recently uploaded photos. May optionally include albumnumber (n, 0 for systemwide) and number of photos(m) if not the default as defined in the Settings admin page.
#comten[,n[,m]] A virtual album containing the most recently commented photos. May optionally include albumnumber (n, 0 for systemwide) and number of photos(m) if not the default as defined in the Settings admin page.
#featen[,n[,m]] A virtual album containing a random choice of featured photos. May optionally include albumnumber (n, 0 for systemwide) and number of photos(m) if not the default as defined in the Settings admin page.
#tags,tag1,tag2,tagn A virtual album containing photos that are tagged with tag1 and tag2 and tagn.
#tags,tag1;tag2;tagn A virtual album containing photos that are tagged with tag1 or tag2 or tagn.
#cat,cat1,cat2,cat3 A list of physical albums that have the categories cat1 and cat2 and cat3. Can be used to display album covers or photos in any display type.
#cat,cat1;cat2;cat3 A list of physical albums that have the categories cat1 or cat2 or cat3. Can be used to display album covers or photos in any display type.
#all A virtual album containing all photos in the system.
#related[,tags|,desc[,nn]] A virtual album containing photos that are related to the content of the page/post. Specification: tags ( default ) or desc, and optional maximum number of photos to find ( nn ). If tags is specified, wppa+ searches photos that have tag(s) equal to word(s) in the text of the page/post. If desc is specified, the description of the photos is searched for words matching words in the page/post. When using this option, it is strongly recommended to use indexed search ( Check Table IX-C5 ). Only photos will be found, no albums.
#owner,username[,parent] A virtual album containing all albums owned by username. If parent is specified, only the sub-albums of that parent will be selected, if parent is omitted, only top-level albums owned by username. This shortcode may show album covers ( type="cover" ) or photos ( type="album" ). If username is #me, the currently logged in user is assumed. Parent album may also be an album name preceeded by a $ sign or an enumeration of album numbers ( e.g. 3.5.7..11 ).
#upldr,username[,parent] A virtual album containing all photos uploaded by username. If parent is specified, only the photos uploaded by the user out of the parent albums(s) and their sub-albums are shown. If username is #me, the currently logged in user is assumed. Parent album may also be an album name preceeded by a $ sign or an enumeration of album numbers ( e.g. 3.5.7..11 ).
photo n The id of the photo to be displayed if the type attribute is photo or mphoto
$photoname The name of the photo to be displayed if the type attribute is photo or mphoto. When using qTranslate make sure the name language matches the page language.
#last
#potd
size n A number > 1: the width of the display in pixels.
x A number < 1: the fraction of the available space.
auto Uses the full 100% of the available space.
align left Indicates where the display has to be located within the available space.
center
right

Remark: If the type of display is set to a slideshow type, you can supply both an album and a photo. In this case the slideshow will start at the specified photo. The photo must be in the album, and the slideshow should be set to start still at first for this to have effect.

348(1)