PubKit E1.0 parameters
These are the parameters of the main PubKit snippet (updated for v.E1.0). Default values are set in the main snippet code, and conversions required to standardize format etc. are carried out there also. You can view the code directly via Elements > Manage Elements > Snippets in the Manager.
Specialized item types may define further parameters of their own, using properties in their PHP class definition. Simple values (strings and numbers) for these can be set from the snippet call using the property name as a parameter.
- &class
- type of item: news/blog post, event, custom record...
defined in class file, e.g. pubkit/classes/post.class.inc.php
default = `post` - &snipFolder
- name of folder containing include files
default = `pubKit` - &uploads
- set this if forms include uploads (works, but no example in the package yet)
- &folder
- ID of folder where posts are stored
- default = resource where snippet is located
- (Mandatory for record-based items)
- &postid
- document ID to load after posting news item.
default = page created
may be single ID or set of tag => ID pairs `tag1 ID1, tag2 ID2` - (Mandatory for record-based items)
- tag to use for navigation can be selected using colon + tag name at the end of the list, otherwise first tag is used
- &prefix
- string prefix for HTML anchors formed from pagetitle prefixed by doc ID;
default = `N` - &canpost
- comma delimited list of web groups that can create posts
leave blank for public posting - &template
- name of template to use for resource-based item
default = site's default template - &formtpl
- form template: chunk name or `@FILE:name`
of file in pubKit/chunks/chunk.<name>.html - Mandatory, there is no default.
- &formName
- name of HTML input form element
Default = pkForm - &secureForm
- default empty; set to `1` to require token in hidden field, using setSecurityToken snippet
- &token
- name of placeholder & session variable created for security token;
default = 'smersh' - &rtcontent
- name of a richtext template variable for item content
change in E1.0+ ~~ form field is now a placeholder using this name, e.g. [+pkRichText+] - &tags
- name of (checkbox/radiobutton) TVs containing tags as semicolon-delimited list,
with fieldname and optional format class, thus:
tag1, fieldname1, format1; tag2, fieldname2, format2; ... - (no longer any need to set &tags=`noTags`if not using any)
- &reqTags
- comma-delimited list of field names of required tags
- &labelPos
- placement of radio|checkbox labels: 'R' (default) = right, 'L' = left, other value for no label
- &tvs
- comma-separated list of text TVs to associate with item
- value may be set using double-colon: tv1,tv2::value2
- &docFields
- extra MODX document fields associated with item
- &<item-property>
- override default value of scalar properties built into item type's class
- &validate
- override built-in validation for item type (creates array):
- `field1:datatype,Req/Opt,message;field2:...`
- main types: string|date|time|token;
- 'err_' prepended to error message for lang file lookup (see class files for examples)
- &showinmenu
- sets whether or not item shows in menus.
default = `0` (do not show) - &permalinks
- create aliases from title, prefixed by doc ID?
- default = `1`
- &permaLength
- max length of alias (but doc ID will be added to it)
default = `35` - &updatePermalinks
- change permalink when title is updated
default = `1` (change of name and default from earlier versions) - &cacheItem
- make resource cacheable or not (e.g. for Ditto/PHx clash)
default = `1` - &clearcache
- clear the site cache after publishing an article
default = `1` - &debug
- `1` = dump form variables at top of form display ($_GET + $_POST)
`2` = dump params as well
`3` = dump whole of $_SESSION vars as well (big list!)
default = `0`