Vous êtes sur la page 1sur 47

Copyright, 2009, by Brandon Booth. All rights reserved.

Permission is granted to make copies of this spreadsheet for priva


Please visit my website at: www.lucidgreen.net
This document applies to Modx 0.9.6. More documentation can be
PLEASE NOTE:
found at the following links:
Official Docs: http://svn.modxcms.com/docs/display/MODx096/Home
Wiki: http://wiki.modxcms.com/index.php/Main_Page

Site Settings Tags


These may be used in templates, documents, snippets, chunks and in snippet calls (e.g. [[Wayfinder?
&startID=`[(site_start)]`]]
[(site_start)] Document ID of the site's starting page
[(site_url)] the url to the site: http://www.mysite.com/modx
[(base_url)] sites relative base url i.e. /modx/

Template Variables
Template Variables (aka TVs) can be used in templates, and directly in documents. They can also be
called within snippets and chunks
Built in "Document Specific
http://svn.modxcms.com/docs/display/MODx096/Document-Specific+Resource+Field
Resources"
[*pagetitle*] Page title from manager

[*longtitle*] Long title from manager

[*description*] Description form manager

[*introtext*] Intro text from manager


[*#content*] Document content, the # allows this variable to edited with Quickedit.
ID of parent document (e.g. link to parent document with:
[*parent*]
[~[*parent*]~])
[*id*] current page's id
[*type*] Whether document, folder or weblink
[*alias*] document alias
[*link_attributes - The Link Attributes of the page, eg. rel=, target= etc.
[*published - [0|1] Whether or not the document is published.
- Date the document is to be published. This is not a "normal" date,
[*pub_date
and must be processed by a script for meaningful output.
[*unpub_date - Date the document is to be unpublished. See 'pub_date'.
[*parent - The ID of the document's parent.
[*isfolder - [0|1] Whether or not the document is a folder.
- [0|1] Whether or not a RichText Editor is to be used when editing the
[*richtext
document.
[*template - The ID of the template to used for the document.
[*menuindex - The order in which the document is to be listed in the menu.
[*searchable - [0|1] Whether or not the document is to be searchable.
[*cacheable - [0|1] Whether or not the document is to be cached.
[*createdby - The user ID of the creator of the document.
[*createdon - The date the document was created. See pub_date.
[*editedby - The ID of the user who last edited the document.
[*editedon - The date the document was last edited. See pub_date.
- [0|1] Whether or not the document has been deleted (but not yet
[*deleted
completely removed from the database by emptying the trash).
[*deletedon - The date the document was deleted. See pub_date.
# deletedby - The ID of the user who deleted the document.
# menutitle - The title to be shown in the menu. If empty, the pagetitle is used.
# donthit - [0|1] Disable page hit count for the document.
# haskeywords - [0|1] Whether or not the document has links to keywords.
# hasmetatags - [0|1] Whether or not the document has links to meta tags
- [0|1] Whether or not this document has been assigned to a private
# privateweb
web document
- [0|1] Whethergroup.
or not this document has been assigned to a private
# privatemgr
manager document
- [0|1] Whether group.
the document's content-disposition is attachment or
# content_dispo
inline.
# hidemenu - [0|1] Whether or not the document is to be hidden in the menu.

Custom template variables


Calling TVs in a snippet
[*custom
$TVarray name*]
= $modx- Any custom template variable
>getTemplateVarOutput(array('TV Data Sourcesofcan
The content the beTVtied (or “bound”)
is now in the array to a$TVarray['TV
Template Variable
NAME']for by
NAME')); formatting
default content
character. and displaying
(e.g. cascades
$TVarray['TV in document.
fromNAME'][1] these
parent document's can
is the secondbe used to fill ain the
tv. character
@BINDINGS
template
string. thevariable
Binds variable(even a default
to a folder, wherevalue) with externalisdata,
path_to_folder_ otherto the
the path
@DIRECTORY path_to_folder documents from the document tree, etc.
folder.
This
Binds It returns
binding
the takes
variable thetolist of files
advantage
a file, in
of
where the
the specified
hierarchical
file_path folder.
is the structure
path andof the of
name
@INHERIT
document
the file. The tree by allowing
return value is Template Variable content
a string containing to "cascade"
the content of the file.
@FILE file_path Binds the variable
downfile
The the path is the to
document a document.
tree.
abosulte WhatpaththisWhere
from thedocument_id
means is that
root is the
youserver
of the can ornumeric
apply your
@DOCUMENT document_id id of
Binds the
the document.
whole sections of your site by editing just one TV. the
variable
content toinstallation.
particular toThe
a returned
document. value
Where is a string
chunk_name containing
is the name of
@CHUNK chunk_name content
the
Bindschunk.
theof variable
the
Thedocument.
returned value is a
to a database stringthat
query containing
returns athe content of the
recordset.
@SELECT sql_statement chunk.
Where sql_query is the actual database query.
Evaluates a string of php codes and process the returned value The return value from
is a
@EVAL php_code recordset.
the code. Where php_code is the actual php code to be evaluated.
The returned value can be either a string, array or a recordset.

Snippets
[[snippetname]] Cached format (output only updated when page is re-cached)
Calling a snippet in code for another snippet or module
[!snippetname!] Uncached format (output is updated on every page call)
EXAMPLE:
[[snippet? $dittoOutput
A snippet call=with
$modx->runSnippet(
a setting variable.
&settingVariable=`value`]] "Ditto",
$modx->runSnippet( snippetName, array(
array($params)); "tpl" =>
"<post><title>[+title+]</title><summary>[+summary+]</summary></po
st>"
Chunks );
)
Chunks can contain basic text, HTML, or template data for snippets. They cannot contain PHP code, but
they can contain calls to snippets see: http://wiki.modxcms.com/index.php/API:runSnippet
{{chunkname}} Basic format
$modx->getChunk('chunkName');
manipulate chunks with API in snippet
$modx->putChunk('chunkName');

links
[~#~] links to document whose ID = #, e.g. [~3~]
f this spreadsheet for private use only.

t-Specific+Resource+Fields
http://wiki.modxcms.com/index
.php/Adding_TV_Widgets_wit
hout_hacking_the_core
MaxiGallery scroll right
Wayfinder Snippet
->
http://www.lucidgreen.net/modxGuides/wayfin
complete documentation ver. 6
der200_docs_v6.html
Useful Sample Calls
[!Wayfinder? &startId=`0`!] Minimum call; start id 0 index from site root
[!Wayfinder? &startId=`0` &level=`1`
&outerClass=`nav`!]

Parameters list This is theWayfinder only parameter thatthe is always


Normally
Parameters That Determine Which Documents to List only lists
required (it can be
descendants of the document specified in set inline in
Parameter Description
the snippet Value Type
This
&startId. parameter Butcall, when or in
tells you a configuration
Wayfinder the maximum
set this parameter file, but to
&startId either
number
This
TRUE, way
parameters
and it's
of levels required).
if &startId of hierarchy
tells Wayfinder
is list all levels the of all integer
Normally
This parameter Wayfinder specifies will the ID of the
&level that
maximum
set
Normally it may
to a value include
number
Wayfinder other in its
ofstarting
items
than
does output.
zero,
notthat A
it may
then
include value of
Wayfinder
in its 0 integer
descendants
document whose of the descendants will be
&limit (zero),
include or
in the
theany absence
list of
will
listings
document.
listed
use documents But
inorWayfinder's by or
template sub-list.
whose
setting
generated
"show
this Aparameter
value in of 0to
output.
integer
&displayStart this
(zero),
specified
menu" parameter, the
in
checkbox the leaves
absence
parameter
has thethis
of
been amount
&startItemTpl
unchecked. unlimited.
Butto boolean
TRUE you can change this behavior
&ignoreHidden parameter,
display
setting
so that this information
Wayfinder leaves only
parameter theabout amount
to the unlimited.
TRUE
displays the boolean
&hideSubMenus This
start
overrides
immediate will show
document. this a This
menu
behavior
children of
(ifisany)and only
particularly the documents
causes
of the useful
Wayfinder boolean
you
when
to include
currently wantusing included
these
displayedWayfinder and
documents
page. nogenerate
to others.
This in has the effect, Comma-separated
&includeDocs
a
its
as subsidiary
listings.
you clickWayfindermenu
down through whose header
a documents or title list.
By
block default
needs to display lists all
information that
menu hierarchy,
MODx thinks should of only showing the path
be visible
from the
from the starting
top down document.
to the current user.toBut theif current
there are certain
level and then comma separated
&excludeDocs documents youone don't levelwant further.
list.
listed under any condtion, then you can list
them in this parameter and
Wayfinder will exclude them from its output.
By default Wayfinder sorts lists and sub-lists
Parameters That Specify The Order inbyWhich the value to List of the Documents
By
menuindexdefault Wayfinder
documentsorts field.each But with list andthis sub- Value Type
Parameter Description
list in ascending order. With
parameter you can choose from a one of the following
&sortBy this parameter
variety of other you fields can to change
sort by. to Note descending
that all predefined terms.
One of the following
&sortOrder order.
lists and Note sub-liststhat in(all either case
predefined terms.
the
levels)
By sortwill
default order is the same
be sorted
Wayfinder by
uses thefor allmenutitle
field
the lists andfield
you choose sub-
Parameters That Determine the Valueslists
here.
of of (all levels)Placeholders
Certain in the
By "Ifeach
default
[generated weblinks document
Wayfinder
are used
output.
as uses thein the the pagetitle field
output,
visible
of eachname
Wayfinder willofoutput
document each as HTMLthe linklink it outputs.
Parameter Description
This
valueparameter
specified of the in the lets
titleweblink
attributeyou instead
specify
of eachof a HTML the normal link it Value Type
&textOfLinks different
outputs.
MODx field
This as the
parameter source of this text. If you one of the following
If you'relink.
- Wayfinder writing To use
allows custom the to
you preload all
templates andofneed the terms.
predefined termsone
&titleOfLinks create
lets youyou're specify ownofdifferent
standard
parameters
an unique display and atemplates
identifier weblinks
for each field
you (likeasany the other
source
of the following
&useWeblinkUrl templates,
of this
document) text. the
Ifgiven
set youfield
this specified
create
to FALSE." by this boolean
row,
If
By
if"ifwant
this
set then for
parameter
Default
to TRUE aWayfinder
this isWayfinder
isoutputs
the parameter
set tovalue
inserts
the TRUE, call
fullits for
url into
then
output you.afor
instead single
For
into of a predefined terms.
&fullLink parameter
you'reset own
to TRUE becomes
templates,
the the
link the field
specified of the
specified
in the by boolean
configuration
each
the
relative document
location path. file.
within thatThen
Wayfinder by
Wayfinder
the current by
will fill
[+wf.linktext+]
this
weblink parameterwill beplaceholder.
becomes
output the
toin[!wayfinder?
the
&rowIdPrefix the calling
lists,
page's placeholder Wayfinder
thetemplate
value you with
set
[+wf.subitemcount+]
from which thisit parameter
was withwill
called. the text string
value
placeholder of the [+wf.link+]
&config=`filename`!] [+wf.title+] you placeholder.
--- What all the heck do boolean
&showSubDocCount be prepended
number
That
By is, the
default of Wayfinder to thecall
immediate
snippet isget
document
children
includes in setits output
these
of the
IDyour thenuse
that
replaced descriptions,
parameters
placed
document.
byofthe and
insnippet's
the copiedtemplates
This[+wf.id+]placeholdfrom
output. canatbe
placeholder.
This isonce. a
used
the
Some Utility Parameters If
any line breaks Wayfinder's
present in output
the requires
other
This
CSS
in -
normal So,
any documentation,
if this
placeholder
stylesheet
custom
behavior parameter
youcan
row-level
of mean???]
then
canthe
snippets. existsbe
do the then Wayfinder
Parameter JavaScript
Description
templates you
from can
which do the output is produced. Value Type
When
will
used
following
template.
But by inyou
interpret anytoset
including thethis
row-level
insure value
this parameter
that template.
the CSS
parameter to in
JavaScriptTRUE,
is theavailable:
call
is then to
&removeNewLines However
given assetting
immediately the following
part this parameter
athe normal boolean
Wayfinder,
available:
to "TRUE" you
will canof
cause tell Wayfinder
Wayfinder to strip out all
&ph output
configuration Wayfinder a file, will
where add a long, detailed text string
1. Createthe
Wayfinder
those line breaks
CSS
name and
file,
oftoandathe full name
place
placeholder all your of
(a
&debug listing
style
name the of
file all
defintions
1. Create that mustyou the beinternal
.config.php
within. into
create)
a JavaScript file,whichand
and itplace the fileall boolean
&config deliver
settings,
must be it's
in output
values,the in a long,
templates,
directory unbroken
etc. that line.
were text string
your 2. Create
should instead
JavaScript a chunk,
place
within. and place within
its output. This allows it the
&cssTpl used
URL
you 2. to in
Create the
the
placeathe generation
/assets/snippets/wayfinder/configs/.
of CSS chunk, file.
call to of its
and place within it the text string
&jsTpl output.
-
3. If
Wayfinder you
Set specify
the in
URL of the JavaScript file. &cssTpl
one a file that
parameter
location Wayfinder
within tothe the can't
name
page's text string
find,
of the
template,
3. then
Set chunk.
the it will
and tolook
&jsTpl have it's
parameter to the name of
Parameters That Assign CSS Classnames instead
output
the chunk. appearfor the in default
a different config [or file:
even
Parameter Description Value Type
Then,
multiple?]
The CSS when Wayfinder
location(s).
class name runs, it will
specified in this place a link
The following apply to output generated by "row" templates:
/assets/snippets/wayfinder/configs/default.co
to the CSSwill
parameter file appear
in the HEAD in the
&rowClass nfig.php.
section of the current webpage. text string
Then when Wayfinder
[+wf.classes+] runs it willThe
and [+wf.classnames+] place linka willlink
&firstClass look
to -the
If like
placeholdersWayfinderthis: of
JavaScript . can't filefirst
every find
in the
row. either of these files, "
the row of each
then
HEAD it
list andsection will ignore
sub-listof(i.e. the
theatcurrent every level) webpage. in theThe
link &config
generated will look parameter.
like this: .
output.
- See the Configuration File section below
for more details.
The CSS class name specified in this
parameter will appear in the
[+wf.classes+]
The CSS classand name [+wf.classnames+]
specified in this
placeholders
parameter
The CSS class name will of the
appear row(s)in the
specified in this
corresponding
[+wf.classes+]
parameter to: the
and
will appear current
in the document, and
[+wf.classnames+]
&lastClass its
placeholders
[+wf.classes+]parent, andofand itsthe grandparent,
last row of each
[+wf.classnames+] "
&selfClass etc.
The
list and sub-list
placeholders all
CSS way up
class toname
of (i.e. the
the row atlevel
specified
each justlevel)
corresponding below
in this
in thethe "
starting
parameter
generated
to the current document.
willdocument.
output. appear ByThis inallows
defaultthe
Thus it can only
&hereClass "
you
[+wf.classes+]
Wayfinder
appear to applyonce sets aindistinctive
and
any [+wf.classnames+]
this parameter
instance set of oftostyle rules to
"last".
&parentClass The CSS class "
the
placeholders
Wayfinder chain ofoutput.of name
documents every specifiedrow that in this
&levelClass [I
parameter
that
corresponds don'tleads know willto
from what
appear
the this
topin
a document does.]
ofthe thethat menu parent "
is astructure
&webLinkClass [+wf.classes+]
downhas
(i.e. to the current
children). and [+wf.classnames+]
document "
placeholders
-- no matter how of all many rowslevels that represent
deep it might
The following apply to output generatedThe
web
-be. If the CSS
links
Note
by class
rather
&displayStart
that
"container" thesename
thanare specified
web thepages.
parameter
templates: same in
is this
set to
parameter
The
TRUE,
documents CSS then will
class appear
Wayfinder
that name
would inwill
be the
specifiedlisted in
in this
a
&outerClass "
[+wf.classes+]
parameter
need a template
breadcrumb willtrail.andfor
appear [+wf.classnames+]
in the
displaying information
&innerClass placeholders ofand the &outerTpltemplate. "
[+wf.classes+]
from the starting [+wf.classnames+]
document.
Parameters That Tell Wayfinder Whatplaceholders Templates
Wayfinder to
of Use
the &innerTpltemplate.
Parameter This
-Description
If templatehas
specified, will
then
abe default
this usedwill be
template
for usedthe row built in
as the Value Type
(as
corresponding shown below), to for but
theevery you
current can
These are the row-level templates: (1) generic optionally template create your own.
document,
row and its parent, and its
&startItemTpl This - Note
grandparent, isshown
thethat, in
default
etc.
every
if &displayStart
template
all way
sub-menu.
up toparameter
used the for all row- is set text string
&rowTpl -level
to -
The If
TRUE, not
items specified
&outerTplthen
except then
template
Wayfinderthe &rowTpl
start is one willlevel
of thebetwoused. "
just
Same
[I
templates below
assume as for the&hereTpl,
that starting
all
are thealways document.
except applies This to allows
all
&innerRowTpl item.
you will to place
apply thea output
distinctive of &outerTpl
set (which "
submenus.
foregoing
required. If
This this
isentire
true template
regardless
template is
provides of whetherthe outer
&hereTpl contains
If
of defined,
style the
rules then to this
the menu
template
chain of will
documentsdefine the
that "
defined,
&innerTpl
"container" thenisfor the
specified?]
the &hereTpl
rows that template will only
output
leads structure!) for rows
from the into top the
that of [+wf.wrapper+]
(a) the are
&innerHereTpl -If
be Ifcomprise
a
usedgiven
defined,
- Even and for document
the
then
if specified,
the highest
this
menu has
template
this
-- which children,
template will and
define
are all if
the
willplaced
be "
placeholder
parents,
menu structure ofthatthedown(b)&startItemTpl,
have
to the nocurrent
associated document
&parentRowTpl those
level
overriden
output
in so ofchildren
the
for
of
thisbetemplate's menu
rows
by
all are
other
rows that into are appear
hierarchy.
row-level
the If this template is "
document
-- nodefined, sure
matter to include
template
how many or this
(c)
levelshaveplaceholder in
&parentRowHereTpl not in
parents.
"here" the
templates
[+wf.wrapper+] output,
chain then
where
that thenthe
are aabove
sub-menu
appropriate.
placeholder the (so must
last/lowest
don't be
forget "
your
their
deep custom
link
it mightattributestemplate!
be.the Notefields setthese to rel="category".
&activeParentRowTpl
created
&hereTpl
level
to
??? (i.e.
include forfor them
template
it). all below will that
bethe parent
used forare all the
rows. "
same document.
parents).
- Wayfind documents has that
Thea&innerTplbuiltwould in isbe
template usedthat as the
&categoryFoldersTpl This
listed
"container" isinuseful
a because
breadcrumb
for the rows sometimes
trail.
in this web it uses "
These are the row-level templates: (5) to construct
designers use its "empty"
default, parents to
sub-menu.
unordered list output.
&outerTpl provide
-- If category header information then itfor it a set "
of If the
you &innerTpl
subsidiary do not pages, define is specified,
and anyou &innerTpl, then used
the
&innerTpl for
&outerTpl all the sub-menus
will be used "
don'tWayfinder'swant activeoutput, links tono these header pages
Placeholders That Can be Used Withinin Wayfinder
wherever Templates matter how
The following are placeholders that that deeply have nothe
nested, web &innerTpl
and page the
would otherwise be
Parameter A SPACE-separated
Description
used. list&outerTplis
of any CSSused classonly Comments
Wayfinder "inherits" from the page names template.
for- Remember
the highest level of the menu structure.
that apply within
that theused the
&innerTpl context
in Any template variable by theand row-
current
of
level -the Ontemplates
the other
current hand,
template
nest ifwill
inside thebe this&innerTpl
placed within is not
[+template_variable_name+] Most
web
Any (all?)
page's
standard oftemplate
the
documenttemplates can be
field potentially
can be have
which it's called: specified
this template. then the
Which CSS
[+document_field_name+] template,content.
subsidiary
referenced so make
from within ForsureWayfinder
that you've template.
The following are the additional placeholders &outerTpl
classnames
designed
example, will
apply
defined
your
the be
&outerTpl,
&outerTpl usedaused
depend
and as onthe by
&innerTpl,
template container
threethe things:for
normally
template.
all levels of the menu
Wayfinder snipppet: The and
contains row-level
content all the of this templates
rows that make
placeholder to work is thetogether
result to of
[+wf.wrapper+] structure.
1.the What is the
create
up
this code: correct
menu. isnature
ItHTML thewhen of the they
[+wf.wrapper+] current
[+wf.classnames+] -template
This
nest inside placeholder
(container-level is intended or that to be used to
placeholder
class="[+wf.classnames+] ineacheachother. template . This is isused
just a
[+wf.classes+] -provide
row-level)?
This
tells
the value of
placeholder
Wayfinder where is theintended
to place to
the be template's to
list2.
provide of
"href"
"title" the
Which the applicable
attribute
attribute
CSS
text of
of
class
that an
an CSS
is HTML
HTML
names link.
link.
have you
[+wf.link+] subsidiary
classnames, content.
pre-packaged into
[+wf.title+]
-displayed
specifiedThe URL &titleOfLinks
with on of athe
Wayfinder's document
webpage parameter for anan HTMLlink.
corresponding
determines
HTML
"class"
to
the this
value attribute.
row
-class-defintion
The of will
this
&textOfLinks be placed
placeholder.
parameters?parameterin determines
[+wf.linktext+] The number of immediate children (0 or a
the this
It
3.
positive And
valueplaceholder.
defaults of to
what
integer), this the
are pagetitle
ofthe theproperties
placeholder. document field of the self,
(parent,
[+wf.subitemcount+] document
here, It etc.)
defaults corresponding
of to thethe relevant
menutitle to field of the in
corresponding to this row, will be placed
this
document
document row.
this placeholder. (if in
corresponding a row template)?
to
this row.
0, or a positive
The ID of the current - This parameter
integer
Legal Values Default Value
document (i.e. of the Comments
was added in
corresponding to the
web page in which Wayfinder 2.0.
ID or
0, of aa positive
document in
the Wayfinder 0 - This parameter
the
0, orMODx
integer. a positive call occurs). 0 must be used in
document
integer. tree.
TRUE, FALSE FALSE concert with the
Positive
TRUE, FALSE integers FALSE &startItemTplparam
that
TRUE, FALSE are the FALSE eter.
document IDs of the - This parameter is
(empty)
documents you wish ignored if &startId is
to
Positive integers 0 (zero).
-have
random (on each
included.
that are the
run, randomizes the This parameter was
document IDs of the
order of the output) (empty) added in Wayfinder
documents you wish
[why isn't 2.0.
to
this in
have excluded. ???
&sortOrder ???]
- id
- menutitle
- menutitle
- pagetitle
- menutitle
- pagetitle
Legal Values Default Value Comments
- longtitle
- pagetitle
- ASC introtext
(for an
description
-- longtitle menuindex
ascending menuindex
introtextsort)
-- description ASC
published
DESC (for a
id
-- introtext
descendinghidemenusort)
- menuindex
- id
parent
- parent [what kind
- menuindex
isfolder
of
Legal - values
parent
Valuesdoes
[whatthis kind Default Value Comments
- description
return?]
of
any values
short does
text this
string:
- alias menutitle
- alias
return?]
- longtitle pagetitle
-- published
alias
That contains no
TRUE, - type FALSE FALSE
- hidemenu
spaces
any
TRUE, - published
template
short or text string
FALSE FALSE
- isfolder
hidemenu
punctuation?
[that contains no
- That's
- type [returns
isfolder not in a
use (empty)
spaces or
value
TRUE,
as - the
type ofname
"document",
[returns
FALSE of anya FALSE
punctuation?]
???
valueorplaceholder
other of???]
"document",
or
within
Legal -???]
template
the same
Values [what Default Value Comments
kind - of values
template
template? does
[what
TRUE,
this FALSE
return?] FALSE
kind of values
- That's not thedoes
this return?] (empty)
name of any of
TRUE,
the
Wayfinder's FALSE
initial partinternal
of a FALSE This parameter was
configuration
the
variables? name of a chunk file's default added in Wayfinder
the
filename.
that name
contains of athechunk (empty) 2.0.
- That's not the
that
URL contains CSSthe
nameofofaany file. (empty)
URL of a JavaScript
template variable
file.
used
Legalby the current Default Value
Values Comments
the page's
nametemplate?
of a CSS
class - That's
that notyouthehave
name offora standard (empty)
defined this web
"page.
document field? "
" "
" "
" "
" "
" "
" "

" "
" "

The
Legal name of the
Values Default Value There can be at
Comments
chunk that contains most one instance of
the corresponding output from this
-2
template. (See note template per
"(6) for additional -3 Wayfinder
"
options.) (empty) Call.
" (empty)
" (empty)
" (empty) -7
" (empty) -7
" (empty) -7
" (empty) (7)?

" -4
" (empty)
MaxiGallery Snippet
http://wiki.modxcms.com/index.php/MaxiGallery
[[MaxiGallery?
[[MaxiGallery? &pics_per_row=`3`
&display=`embedded`
Useful Sample calls:&max_pic_size=`400`
&max_thumb_size=`110`
&embedtype=`slimbox` &pics_per_row=`3`
&keep_bigimg=`1` &big_img_linkstyle=`popup`
&max_thumb_size=`110` &max_pic_size=`0`
&thumb_use_watermark=`1`
[!MaxiGallery? &gal_query_ids=`67,23,4`
&thumb_use_dropshadow=`1`]]
&thumb_watermark_txt=`Some
&display=`embedded` watermark!`
&embedtype=`slimbox`
[!MaxiGallery? &pic_query_ids=`32,42,52,61`
&pic_use_watermark=`1`
&order_by=`date` &limit=`5`!]
&display=`embedded` &embedtype=`smoothgallery`!]
&pic_watermark_type=`image`]]
Parameter Lists
Parameter
&admin_webgroups
&admin_webusers
&bigimg_linkstyle
&big_mask_bgcolor
&big_mask_img
&big_mask_position
&big_shadow_bgcolor
&big_shadow_path

&big_use_dropshadow

&big_use_imagemask
&big_use_watermark
&big_watermark_font
&big_watermark_halign

&big_watermark_img

&big_watermark_txt
&big_watermark_txt_color
&big_watermark_txt_hmargin
&big_watermark_txt_vmargin
&big_watermark_type
&big_watermark_valign
&childgalleries_ids
&childgalleries_level_limit
&childgalleries_limit
&childgalleries_order_by
&childgalleries_order_direction
&childgalleryTpl
&clearerTpl
&css
&debug
&disable_js_libs
&disable_rightclick
&display
&draggableTpl
&embedtype
&ftp_base_dir
&ftp_pass
&ftp_port
&ftp_server
&ftp_user
&gal_query_ids
&galleryOuterTpl
&galleryPictureTpl
&gtable
&is_target
&js
&keep_bigimg
&keep_date
&lang
&limit
&manage_gallery
&manage_target
&manageOuterTpl
&managePictureTpl
&manager_webgroups
&manager_webusers
&manageButtonTpl
&manageUploadTpl
&max_big_size
&max_pic_number
&max_pic_size
&max_thumb_size
&offset
&order_by
&order_direction
&pageNumberTpl
&pic_mask_bgcolor
&pic_mask_img
&pic_mask_position
&pic_query_ids
&pic_shadow_bgcolor
&pic_shadow_path
&pic_use_dropshadow
&pic_use_imagemask
&pic_use_watermark
&pic_watermark_font
&pic_watermark_halign
&pic_watermark_img
&pic_watermark_txt
&pic_watermark_txt_color
&pic_watermark_txt_hmargin
&pic_watermark_txt_vmargin
&pic_watermark_type
&pic_watermark_valign
&pics_per_page
&pics_per_row
&picture_target
&pictureTpl
&pictureview_start_id
&pictureview_start_pos
&quality_big
&quality_pic
&quality_thumb
&query_level_limit
&random_filenames
&smoothgallery_carouselMaximizedOpacity
&smoothgallery_carouselMinimizedHeight
&smoothgallery_carouselMinimizedOpacity
&smoothgallery_delay
&smoothgallery_embedLinks
&smoothgallery_fadeDuration
&smoothgallery_height
&smoothgallery_id
&smoothgallery_preloader
&smoothgallery_showArrows
&smoothgallery_showCarousel
&smoothgallery_showInfopane
&smoothgallery_slideInfoZoneOpacity
&smoothgallery_textShowCarousel
&smoothgallery_thumbHeight
&smoothgallery_thumbSpacing
&smoothgallery_thumbWidth
&smoothgallery_timed
&smoothgallery_width
&thumb_mask_bgcolor
&thumb_mask_img
&thumb_mask_position
&thumb_shadow_bgcolor
&thumb_shadow_path
&thumb_use_dropshadow
&thumb_use_imagemask
&thumb_use_watermark
&thumb_watermark_font
&thumb_watermark_halign
&thumb_watermark_img
&thumb_watermark_txt
&thumb_watermark_txt_color
&thumb_watermark_txt_hmargin
&thumb_watermark_txt_vmargin
&thumb_watermark_type
&thumb_watermark_valign
&upload_field_count
&use_ftp_commands
&view_gallery
llery
Basic call with parameters: displays the gallery in
slimbox style with 3 pictures per row, a auto created
thumbnail size of 110pixs wide, and thumbnails use
With
drop Watermark
Query on thumbnails
other galleries
shadow. by id and show latest 5 images
from each.
Displays pictures with id 32,42,52 and 61 in a
smoothgallery
Web usergroup names that have admin user privileges
Description
and who are allowed to manage all pictures in the Possibledelimited
Comma values list of web Default value
gallery. usergroup names
Web usernames that have admin user privileges and -Comma
- slidebox
top
delimited list of web
Display user names.
who aretype for big
allowed images that
to manage are opened
all pictures in thefrom
gallery. -- lightboxv2
topleft external
assets/snippets/
browse
Mask mode.
background color for big pictures. It should be -- popup
topright
RGB Hexadecimal
-- external FFFFFF
maxigallery/
the same
Path to thecolor
imageas that
the page background
you wish color.as an
to be applied left
path imagemask/
imagemask to the big pictures.
The Imagemask position. The resize option resizes the - center demomask–
resize
imagemask to the size
Shadow background of the
color forpicture.
big pics. This should be - right assets/snippets
frame2.png
RGB Hexadecimal
- bottom FFFFFF
the same
Path color
to your as theimages,
shadow page background
if you do notcolor.
want to use /
path - bottomleft
the default shadow images. maxigallery/dropsha
- bottomright dow/
- resize
-0
Use a dropshadow on big pictures. 0
-1

-0
Use an imagemask on big pictures. 0
-- 1-1
0
Watermark big images. -- 2 0
1
Font size for the watermark text. -3
- left 5
Horizontal alignment of the watermark. 4
- center right
5
- right assets/snippets/
Path to the watermark image. It can be a transparent
maxigallery/waterma
png. Make the margins of the watermark as path
rk/
transparent areas.
For text watermarks, this is the text that will be applied watermark.png
text Copyright
to the picture.
Color of the watermark text. RGB Hexadecimal FFFFFF
Horizontal margin of the watermark text (in pixels). Number (px) 15
Vertical margin of the watermark text (in pixels). Number (px) 15
Type of watermark to use: a text watermark or an - image
- top text
image watermark . (user provided image). - text delimited list of
- Comma
Vertical alignment of the watermark. - center bottom
document
- bottom ID's to search for
Parent documents to search,looking for childgalleries. Current document
Defines how many levels deep to list childgalleries from childgalleries.
Number
- "all" to list all galleries. 0
parent document.
Defines how manyZero for unlimited,
childgalleries eg.Zero
to list. all levels.
for
Number 0
unlimited
The number.
field name to use to order the childgalleries @FILE:assets/snipp
MODx document object field. menuindex
display.
The display direction for the childgalleries: ascending - ASC ets
@FILE:assets/snipp
- Chunk ASC
The
or
The path to link
descending.
template a css
used forfile that gallery
a child styles this gallery,
element or
(image) - DESCname /
ets
chunk name overview. - - @FILE:
Chunk name
in
Thethetemplate
gallery to use when using &pics_per_row maxigallery/template
/
containing theacss, - @CODE:
@FILE:
parameter as rowor css as a string.
clearer. - Chunk name assets/snippets/max
smaxigallery/template
@CODE:
- path to a file igallery/
Used when MooTools, Prototype or Scriptaculous - 0- template string s/childgallerytpl.html
Examples:
Shows some
javascript debug
libraries information in the MaxiGallery
are css/default.css
/clearertpl.html 0
assets/css/gallery.css
page. - 0- 1
linked (feature
in the head not of
fully
the site template and you want to 0
Enables a
MaxigalleryCss
implemented javascript
yet). to disable 'right clicking' on page -0 -1
normal @FILE:assets/snipp0
prevent MaxiGallery
to save
from the
calling images.
them also. -1 embedded
-- slidebox ets
Select the gallery display mode. Chunk name normal
-- childgalleries
lightboxv2 /
The template used for drag sort popup.
If &display mode is set to "embedded", this defines the - pictureview - @FILE:
-- slimbox maxigallery/template
gallery display @CODE:
- smoothgallery s
type. External will open the image in a new window. /draggabletpl.html
- popup
- external
Path to go from FTP root to MODx installation root. Eg.
if your FTP root path
directory
FTP account is password password
number 21
Port number for the FTP service. FTP address
FTP address to the server running MODx. -username
Comma delimited list of @FILE:/assets/snip
document ID's @FILE:/assets/snip
pets
FTP account username
ID's of the documents from which you want to retrieve - Chunk - "all" toname
get pictures from pets
/
pictures. all- galleries
- Chunk@FILE: name /maxigallery/template
The outer template for the gallery overview. @CODE:
- @FILE: maxigallery/template
The template for each picture element (thumbnail) in s
text - @CODE: smaxigallery
/galleryoutertpl.html
the
Name gallery
of the overview.
database table for the gallery (modx table - 0
Determines
Link to an if thejavascript
extra document fileissupporting
to be the target for or
a gallery - path / 0
prefix is added) -1 gallerypicturetpl.html
picture browsing
chunk name or mode or - chunk name
picture manager
javascript code asmode. text. - 0- text 0
Keep an additional larger or original size version of the - 0- 1
Sets
image. the gallery language. 1
When modifying an image title or description, keep the - en -1
original upload date. en
Maximum- fi number of rows for
Note:
ID of the Language
gallery to filesbeare not fullyThe
managed. implemented
ID of the yet. 9999999
query. @FILE:/assets/snip
Feel
Limitof free
document
ID value to(page)
the document add
to useyour forthat
that the
has query
the
will resultfor
be used set.
managing the Document id @FILE:/assets/snip
pets
language(s).
gallery call.
pictures. Use the same (See
Use thislang_en.php
to avoid for
going examples.)
to the gallery page. -Document id pets
Chunk name /
Set the same
snippet call in that target document and add the - @FILE: /maxigallery/template
- Chunk name
parameters
parameter:
The outer template as usedfor
&is_target=`1` in gallery
the gallery itself.
management. @CODE: maxigallery/template
s
@FILE:/assets/snip
- @FILE:
The
to thetemplate
call. for a single picture element in the gallery Comma delimited list of web s/pets
Comma delimited web groups that can post pictures to - @CODE: @FILE:/assets/snip
management. groups. delimited list of web
Comma //manageoutertpl.html
this gallery
Comma and can
delimited web user names that can post -users.
Chunk name pets
managepicturetpl.ht
maxigallery/template
manage to
pictures theirthisowngallerypictures.
and - @FILE: /
- Chunk name ml
s
can manage
The templatetheir for the own pictures.
manage pictures button. - @CODE: maxigallery/template
- @FILE:(px)
Number
The template for the file upload rows in gallery s/
Size of the big image. Pixel size of largest dimension, @CODE:
- WidthxHeight (px) (eg. 1024
management. /managebuttontpl.ht
or zero to use
Maximum number of images allowed in this gallery. -200x400)
Number
Number (px) manageuploadtpl.ht0
ml
original
Use
Maximumzeroimage for
sizeandimensions.
inunlimited
pixels of the normal picture. (largest - Number - WidthxHeight
(px) (px) (eg. ml 450
number of images.
dimension). Zero for -200x400)
date
- WidthxHeight (px) (eg. 130
Maximum
unlimited size in pixels of the thumbnail pictures.
size. - pos of rows to skip.
The database field name to use to order the pictures 200x400)
Number 0
(largest dimension) - filename
Offset value
by. If “random” is usedto use for the query result set. @FILE:/assets/snip
pos,date
- title
maxigallery will show pictures in a random order or will -- ASC top
Chunk name
pets
DESC
id
- DESC /
display
Sort order a random
direction: ascending or descending. -- topleft
@FILE: assets/snippets
The template to display page numbers in the gallery random
picture
Mask in the childgalleries
background color for display mode.
normal pics. This should be RGB - topright
@CODE:
Hexadecimal /maxigallery/template
FFFFFF
overview. - left smaxigallery/imagem
the same color as the path /pagenumbertpl.html
Path
page to the image color.
background to be applied as an imagemask to - center ask
The Imagemask
the normal pictures. position. The resize option resizes the resize
/demomask-
Comma- right delimited list of
imagemask to the size frame2.png
- bottom
picture ID's assets/snippets
of
ID'sthe
Shadow ofpicture.
single picturescolor
background to retrieve.
for normal pics. This should RGB Hexadecimal FFFFFF
- bottomleft /
be thetosame
Path the shadow color asimages to be used, if you don't path - bottomright
page to background color. -0 maxigallery/dropsha
wish use the default - resize 0
- 0- 1 dow/
shadow
Apply images.
a dropshadow to normal pictures. 0
-- 1
0- 1
Apply an imagemask to normal pictures. -- 2 0
1
Watermark normal images. -3
- left assets/snippets 3
Font size for text watermarks. 4
- center /right
Horizontal
Path alignment image.
to a watermark of the watermark.
Use a png image with a path -5right maxigallery/waterma
transparent background text rk
Copyright
alphathat
Text layer.will be applied to the images as a watermark. RGB Hexadecimal /watermark.png
FFFFFF
Color of the watermark text. Number (px) 10
Horizontal margin in pixels of the watermark text. Number (px) 10
Vertical margin - image
Determines the in typepixels of the
of the watermark
watermark to betext.
used, - top text
- text
either text or image. - center bottom
(image
Vertical
The isalignment
number user of supplied.)
of the watermark.
thumbnail pictures to show per page in Number - bottom 0
the
ID gallery
ofnumber overview.
the document that will be used for browsing the Number @FILE:/assets/snip4
The
Zero for unlimited of thumbnail
pictures.pictures to show in a row in -Document pets
pictures. Use
the gallery overview. the same Chunk name id Current document
snippet call in that target document and add the /
- @FILE:
parameter: &is_target=`1` maxigallery/template
The
If template
pictureview for the picture
display mode isview.used, this parameter can Picture - @CODE:id
to the call. s
be used to define /picturetpl.html
the picture id from which to start automatically.
If pictureview display mode is used, this parameter can Picture number to start from First picture
be used
The to define
quality of the big picture. A percentage between 0- Number (%) 100
the position
100 from which to start automatically.
for the big Number (%) 70
The quality. Percentage between 0-100 for the normal
images.
images. Number (%) 70
The quality percentage between 0-100 for the
Defines
thumbnail how many levels deep to go from the parent in
images. Number 1
Opacity value
gal_query_ids for the carousel when it is maximized. -0
0
If enabled, this will apply generated random filenames
documents. -1
to uploaded pictures. Number 0.7
Where:
Opacity value for the carousel when it is minimized. Number (px) 20
Height
0 in pixels of (not
= is transparent the minimized
visible) andcarousel.
1.0 = is totally Number 0.4
Where:
opaque
Open picture by clicking on the slide. Number (ms) 9000
Delay in milliseconds for the timed slideshow picture - true
0 = is transparent (not visible) and 1.0 = is totally
change. TRUE
- false
NOTE:
opaqueif you remove this parameter, also remove the Number (ms) 500
Height
link tagsinfrom
Duration pixels
in for the smoothgallery
milliseconds div. Overflow will
of the fade effect. Number (px) max_pic_size
be hidden, so this
galleryPictureTpl
Individual
should be id theforheight
the smoothgallery instance.
of biggest picture This allows
(eg. same as Text Gallery id
to have multiple - true
max_pic_size). TRUE
smoothgalleries in one page. - false
- true
Preload the pictures. TRUE
Opacity value - false
- true
Show the nextin- back
% forarrows
the infoinpane. This determines
the slideshow. TRUE
Show the thumbnails
the visibility of the in carousel mode when using - false
- true
slideshow. TRUE
Show
infopane.the info pane (this is the picture title and - false
description). Number 0.7
'pictures' text from
Where: text
the the language file
Text that is shown in the carousel. Number (px) 75
Height of the thumnails, in pixels, in the SmoothGallery
0 = is transparent (not visible) and 1.0 Number (px) 10
carousel.
Space in pixels between thumbnails in =the
is totally
opaque
SmoothGallery carousel. Number (px) 100
Width in pixels of the thumbnails in SmoothGallery - true
Width
carousel.in pixels, for the smoothgallery div. Overflow (of - top FALSE
- false assets/snippets
Change
the the will
picture) image in a timed slideshow mode. (px)- topleft max_pic_size
be hidden,
Mask so this should
background color forbethumbnail
the maximum width
pics. It of the
should be RGB - topright
Hexadecimal /FFFFFF
biggest
the same picture (eg.as
as color - left maxigallery/imagem
path
Path
same
the toasan
page imagemaskcolor.
max_pic_size).
background image that is to be applied to - center ask
Imagemask
the thumbnail position.
pictures. The resize option resizes the resize
/demomask-
- right assets/snippets
imagemask
The shadowtobackground
the size of color for thumbnail pics. This RGB Hexadecimal FFFFFF
frame1.png
The path to the dropshadow images. If you do not wish - bottom /
the picture.
should be the same path
to useasthe
color pagedefault
background color. - 0- bottomleft maxigallery/dropsha
shadow images, set this to the path to your shadow - bottomright dow/ 0
Apply a dropshadow to thumbnail pictures. - 0- 1
images. -- 1- resize 0
Apply an imagemask to thumbnail pictures. 0- 1
-- 2 0
1
Watermark the thumbnail images. -3
- left assets/snippets 1
Font size of the watermark text. -4center /right
Horizontal
Path alignment image.
to a watermark of the watermark.
Use a png image with a path-5right maxigallery/waterma
transparent background text rk
Copyright
alphathat
Text layer.
will be applied to the images as a watermark. RGB Hexadecimal /watermark.png
FFFFFF
Color of the watermark text. Number (px) 2
Horizontal margin of the watermark text. Number (px) 2
Vertical margin of the watermark text. - image
- top text
Type of the watermark to use. Either text or a user - text
supplied image. - center bottom
Vertical alignment of the watermark. - bottom
Number 10
The
If numberMaxiGallery
enabled, of upload fields
uses to show
PHP FTP in commands
the manager to -0
Show 0
createafilesystem
view. childgallery from a document (page) other than
folders -1
the gallery
for the parent
gallery pictures. This is needed in certain server Document ID
document.
environments. Use the ID of the document that contains
the childgallery call of
the childgallery you wish to use.
Aggregates documents to create blogs, article/news
Ditto Snippet collections, and more,with full support for templating. These
lists were pulled from the modx wiki
[!Ditto? &startID=`183` &sortBy=`createdon` &display=`5`
EXAMPLE CALL &tpl=`story_summary`!]

Parameters description
&config Load a custom configuration

&dateFormat Format the [+date+] placeholder in human readable form

&dateSource Source of the [+date+] placeholder

&debug Output debugging information


&depth Number of levels deep to retrieve documents , 0 is infinite
&display Number of documents to display in the results
&ditto_base Location of Ditto files
&documents IDs of documents for Ditto to retrieve
&extenders Load an extender
Removes items notwhich
meetingaddsa functionality
critera. Thus,to ifDitto
pagetitle == joe
&filter then it will be removed. Use in the format "field,criteria,mode"
Holds
with the both the custom
comma filters
being the array
local for configs or extenders to
delimiter
&filters
add to and the parsed filters array.
&format Output format to use
&globalFilterDelimiter Filter delimiter used to separate filters in the filter string
Allow Ditto to retrieve fields its template parser cannot handle
&hiddenFields
such as nested placeholders and [fields]
&hideFolders Don’t show folders in the returned results
Don’t show documents the guest or user does not have
&hidePrivate
permission
Unique ID for to this
see Ditto instance for connection with other
&id
scripts (like Reflect) and unique URL parameters
&IDs Internal variable which holds the set of IDs for Ditto to fetch
&idType type of IDs provided; can be either parents or documents
&item[x] Individual items rendered output
Enable fetching of associated keywords for each document
&keywords
Can be used as [+keywords+] or as a tagData source
&language language for defaults, debug, and error messages
Delimiter used to separate individual parameters within each
&localFilterDelimiter
filter string
&noResults Text or chunk to display when there are no results
&orderBy An array that holds all criteria to sort the result set by.
&orderBy Sort the result set
&paginate Paginate the results set into pages of &display length.
&paginateAlwaysShowLinks Determine whether or not to always show previous next links
&paginateSplitterCharacter Splitter to use if always show is disabled
IDs of containers for Ditto to retrieve their children to &depth
&parents
depth
&phx Use PHx formatting
Initialize custom placeholders array for configs or extenders to
&placeholders
add to of documents to retrieve from the database, same as
Number
&queryLimit
MySQL LIMIT
&randomize Randomize the order of the output
Name of chunks to be stripped from content separated by
&removeChunk
commas
Saves the ditto object and results set to placeholders for use
&save
by other
See snippets
through unpublished folders to retrive their children Used
&seeThruUnpub
when depth is greater than 1
&showInMenuOnly Show only documents visible in the menu
&showPublishedOnly Show only published documents
set the template variable or document attribute to sort by,
&sortBy
default is publish date
&sortDir change sort direction. DESC or ASC. default is DESC
&start Number of documents to skip in the results
&total Number of documents to retrieve
&tpl User defined chunk to format the documents
&tplAlt User defined chunk to format every other document
&tplCurrentDocument User defined chunk to format the current document
&tplFirst User defined chunk to format the first document
&tplLast User defined chunk to format the last document
&tplPaginateCurrentPage Template for the current page link
&tplPaginateNext Template for the next link
&tplPaginateNextOff Template for the inside of the next link
&tplPaginatePage Template for the page link
&tplPaginatePrevious Template for the previous link
&tplPaginatePreviousOff Template for the previous link when it is off
&where Custom MySQL WHERE statement
depreciated (I think) number of documents to show in list, use
&summarize
&display instead.
News Publisher scroll right -> http://wiki.modxcms.com/index.
php/Ditto
”default” default blank config file
possible values Example Usage Helpful links
CONFIG_NAME Other configs
installed in the configs folder or in
any
any folder
strftimewithin
formatthestring
MODx base
see link
path via->@FILE http://www.php.net/strftime
to right

# of documents to display or "all"


for all documents

Any extender in the extenders


folder or in any folder within the
MODx base path via @FILE http://ditto.modxcms.com/files/s
nippet-ditto-php.html#filter

Any character not used in the filters

Default: "|"

Any combination of characters a-z,


underscores, and numbers 0-9

Any character not used in the filter


itself

Default: ”,”
News Publisher Snippet

&folder folder id where blog posts are stored


set to 1 to automatically convert the parent document to a folder.
&makefolder Defaults
to 0
document id to load after posting news item. Defaults to the page
&postid
created
comma delimited web groups that can post comments. Leave blank for
&canpost public
posting
&badwords comma delimited list of words not allowed in post
&template name oftemplate
header template(chunk
to use name)
for news post
to be inserted at the beginning of the
&headertpl news
footer
contenttemplate (chunk name) to be inserted at the end of the news
&footertpl
content
&formtpl form template (chunk name)
&rtcontent name of a richtext content form field
&rtsummary name of a richtext summary form field
sets the flag to true or false (1|0) as to whether or not it shows in the
&showinmenu
menu. Defaults to false (0)
&aliastitle set to 1 to use page title as alias suffix. Defaults to 0 - date created.
when set to 1 the system will automatically clear the site cache after
&clearcache
publishing an article.
NewsManager
Display all owned articles in a table together with buttons that permit to
edit/delete/hide/publisch etc. every single article in a blog. !!! Use only one snippet per
page !!!
Parameter Description
&folder folder id where documents are stored
&makefolder set to 1 to automatically convert the parent document to a folder.
&postid document id to load after working with a news item.
document id used to modify an article ($_REQUEST['editid'] will hold
&editformid
the id of the document to modify)
&template name of template to use for news post
header template (chunk name) to be inserted at the begining of the
&headertpl
news
footer content
template (chunk name) to be inserted at the end of the news
&footertpl
content
&rowtpl template used to display a single post (chunk name)
when set to 1 the system will automatically clear the site cache after
&clearcache
updating an article
&nrposts number of posts to show per page
&paginate paginate
&prv chunk to be used inside the previous link
&nxt chunk toshow
always be used inside
previous orthe next
next link
links (if enabled, hyperlink will be
&alwaysshow removed when prev/next page is not available, | delimiter will not be
character
inserted) delimiter to use to separate previous next links if
&prevnextsplitter
alwaysshow is 0
&show chunk to be used for the show action
&edit chunk to be used for the edit action
&delete chunk to be used for the delete action
&refresh chunk to be used for the "move on top" action
&publish chunk to be used for the publish action
&unpublish chunk to be used for the unpublish action
&showinmenu chunk to be used for the "Show in menu" action
&hideinmenu chunk to be used for the "Hide in menu" action
&emptytext text to use when no news items are found

Request variables (via GET, POST, or COOKIE)


Request variables Description
deleteid id of post to delete
id of post for whic the 'createdon' property is set to now, thus
refreshid
effectively putting it at the top of the list
hidemenuid id of post for which the 'hidemenu' property must be changed
hidemenuvalue value to which 'hidemenu' must be set
publishid id of post for which the 'published' property must be changed
publishvalue value to which 'published' must be set

Snippet placeholders
Placeholder Description
separator between a document URL and parameters (for example
[+sepchar+]
[~[*id*]~][+sepchar+]param1=value1&param2=value2)
[+editformid+] Id of page to use for editing a post
[+pagetitle+] current post's page title
[+longtitle+] current post's article title
[+id+] current post's id
[+edit+] text for edit action
[+delete+] text for delete action
[+show+] text for show action
text for refresh action (update the creation date to now so the post is
[+refresh+]
first
text in
forthe list)
hide menu action or show menu action (dependent of the
[+hidemenu+]
current state
text for publish of action
the post)
or unpublish action (dependent of the current
[+pubish+]
state of the post)
[+next+] text for next action
[+previous+] text for previous action
[+prevnextsplitter+] splitter if always show is 0
[+pages+] page list
[+totalpages+] total number of pages
[+start+] the # of the first item shown
[+stop+] the # of the last item shown
[+total+] the total # of items on the page
NewsEditor
http://lucidgreen.net/modxGuides/new
sManagerDocs.html

Default value Parameter Description


&folder folder id where comments are stored
set to 1 to automatically convert the parent
0 &makefolder
document to a folder
current page &postid document id to load after posting news item.
comma delimitted web groups that can post
&canpost
comments.
comma leave list
delimited blank for public
of words not posting
allowed in
&badwords
post
&template name of template to use for news post
header template (chunk name) to be inserted at
&headertpl
the begining
footer template of the news
(chunk content
name) to be inserted at
&footertpl
the end of the news content
&formtpl form template (chunk name)
10 &rtcontent name of a richtext content form field
0 &rtsummary name of a richtext summary form field
sets the flag to true or false (1|0) as to whether
"< Previous" &showinmenu
or not it shows in the menu.
"Next >" &aliastitle set to 1 to use page title as alias suffix
when set to 1 the system will automatically clear
0 &clearcache
the site cache after publishing an article
"|" &dateformat format to use for the dates
"Show"
"Edit" Placeholders
"Delete" Placeholder Description
"Move on top" editid Id of news document
"Publish" pagetitle News page title
"Unpublish" longtitle News title
"Show in menu" description News description
"Remove from menu" introtext News summary
"<p>No entries
alias News page alias
found.</p>"
parent News parent folder (the folder with the blog)
createdon Date in which the news was first created
createdby User id of creator
published News is published (0|1)?
Data on which the news must be published
pub_date
(format
Data on%d-%m-%Y %H:%M:%S)
which the news must be unpublished
unpub_date
(format %d-%m-%Y %H:%M:%S)
hidemenu News isn't displayed in menu (0|1)?
If hidemenu == 0, gived the place of the news in
menuindex
theofmenu
Id template for this news (note: not the name
template
of the template)
content News content
Default value

0
Id of page created
or edited
''

'content'
'introtext'
0
0
0
'%d-%m-%Y %H:
%M:%S'
Jot template parameters -->
optio - default (form & comments)
parameter value
- count-comments
&action
nal
yes - count-subscriptions
&docid yes (docid- comments
as integer)
&tagid yes (tagid- form
as string [A-Za-z0-9])
- 0 (default)
&subscribe yes
- 0- (default)
1
&moderated yes - 0- 1
&notify yes - 1 (default)
&subjectSubscribe yes -2
(string)
&subjectModerate yes -(string)
0 (default)
&captcha yes -1
(comma delimited list of words not
&badwords yes 0- 2
-allowed in post)
&bw yes - 1 (default)
(comma
-2 seperated list of extra form
&customfields yes
fieldnames)
&authorid yes (id of source author)
&title yes (title of source)
-0
&css yes
- 1 (default)
(relative path from modx root to CSS
&cssFile yes
file)
&sortby yes (comma seperated sort string)
-0
&numdir yes
- 1 (default)
&validate yes (comma seperated validate string)
&guestname yes (string)
&postdelay yes (seconds as integer)
&pagination yes (number of comments per page)
-0
&placeholders yes
- 0- 1
&output yes
- 0- 1
&debug yes
-1
&trusted yes (comma delimitted web groups)
&canpost yes (comma delimitted web groups)
&canview yes (comma delimitted web groups)
&canedit yes (comma delimitted web groups)
&canmoderate yes (comma delimitted web groups)
- 0 (Default)
&notifyAuthor yes
-1
&subjectAuthor yes (string)
Jot Template Parameters
optio
description parameter
Controls what to display &tplForm
nal
yes
Link instance to this document, defaults to parent
&tplComments yes
document
Extra tag toid.use when two instances use the same
&tplModerate yes
docid.
- 0 = new
Notify disable
moderators subscriptions.
comments will be published
specified by *&canmoderate* by &tplNav yes
email - 1 = enable
new subscriptions.
comments will be unpublished a
syntax: fieldname:message(:validation) &tplSubscribe yes
moderator/manager user can
best practise is to create a chunk with bad words &tplNotify yes
a-review
ifSubject
seperated
0field
= do before
for by
publishing.
not notify
name aiscomma
enteredand
subscription in validate email.
notification it automatically &tplNotifyModerator yes
call 0- 1
becomes
-Subject =Jot= notify
disable
like:
on new unpublished
a required
captcha
for moderator when posting.
notification
reply
email. &tplNotifyAuthor yes
field. -- 2
1= =if notify
validation
enable oncaptcha
every new
is omitted
when reply
it posting.
assumes "required". other
When aenable
word specified by *&badwords* &cssRowAlt yes
validations
- 2 =this
&badwords=`{{MyBadwordsChunk}}`
Using commandcaptcha willwhen
saveposting, butisdisable
the specified
detected:
fields itwhen
for
are:
logged in users. &cssRowMe yes
posting.
to-allow 0 = do nothing.
central administration of your badwords list. &cssRowAuthor yes
1 = do not publish the comment.
- number
defaults 2 the to "name,email".
= reject
- email the comment. (Note: Be sure not to have
Use
defaults
spaces in author
*&bw*
tocomma
longtitle value
valuefor
parameter tothe
for thecurrent
specify thedocument.
current required
document. action
on - detection.
custom regular expression
separated
-used0 = do list of custom fields in the Jotincall.)
syntax: for not auto-include
subject when leftjot stylesheet
empty. header
-
examples: 1 = auto-include jot stylesheet in header
default to location of the included jot.css
fieldname:a (for ascending) or fieldname:d (for
0- required
-descending)
= first comment field:
defaults lowest
to number.
- 0- = 1- "MyRequiredField:This
nofirst
= placeholders
comment are created
highest field is(default)
number. required!"
The -1toanonymous
"createdon:d".
=validate
placeholders an authorname
emailarefield:
created to use when debug
for every none isvalue
specified.
number of seconds
(see- *&debug*parameter) there must be
"MyEmailField:Not a valid e-mail address.:email" between posts from
the -same
- to no user.
ifvalidate
tagida is number:
specified the placeholders are
defaults
created to: anonymous.
- 0 =- "MyNumberField:Not
disable,
like show all comments
this: on one page (default)
a number.:number"
Enter -1 0 to
to>validate
enabledisable,
paging
an defaults
hyphen to: 15. US
withseperated
specified number.
phonenumber
-Comma
by0 using
=[+jot.html.form+]
hidedelimitted
output regular
custom (can
webbegroups
used in combination
that are trustedwith and
*&placeholder*parameter)
have their comments
- 0expression:
= disable output
- 1- if"MyPhoneField:Not
= show output of jot "hidden"
(default) variables. (default)
- 1 = the enabletagid is specified
output a "hidden"
of groups
jot valid phonenumber:^[2-
the placeholders
variables. are
Comma
published delimitted
9]\d{2}-\d{3}-\d{4}$" bythis: web
default when that can
*&moderated* post
is set 1.
created like
comments.
Comma
Badwords delimitted
- Combinations also does ofweb
notgroups
multiple that can view
validations:
comments.
Comma
apply delimitted web
for trusted webgroups.field
- "MyRequiredField:This
[+jot.html.form.tagid+] groups that
is canusers
Manager edit their
moderateare OWN
Leave
always
comments. blank
trusted. for public
required!,MyEmailField:Not a valid posting.
Leave blank
e-mail for public viewing.
address.:email,MyNumberField:Not a
Send
Leave the
number.:number"blank author
for no of webuser
the document
editing bymoderation
users.an email notification
(=moderation
when
by using someone
manager posts a
comment
Subject
account). for(v 1.1.3+)
author notification email (v 1.1.3+)
defaults to "content:You forgot to enter a comment."
plate Parameters
description
Template (HTML) for user form.
Template (HTML) for comment. This templates
Template (HTML)
gets repeated for moderation
for each comment. block. This
templates (HTML)
Template gets included once bar. This
for navigation
(top) in
templatescomment
gets view
included twice (top block. This
Template (HTML) for subscriptions
and bottom)
templates in default
gets included comment
once view.
Template (TXT) for
(top) in comment notification email for
view
subscribers.
Template (TXT) for notification email for
moderators.
Template (TXT) for notification email for author (v
1.1.3+)
CSS style classname for alternate row.
CSS style classname for current user row.
CSS style classname for author row.
WebLoginPE 1.3.1 http://www.lucidgreen.net/modxGuide
WebLoginPE documentation s/wlpedocs/index.html
Eform
Required parameters
Sample call
&formid
&tpl
&report
Optional parameters
"autoSenderName (new in 1.4.4) (optional)
&allowhtml (Optional)
&automessage (Optional)
&autosender (Optional)
&bcc (Optional)
&category (Optional)
&cc (Optional)
&ccsender (Optional)
&cssStyle (optional)
&debug (Optional)
&from (Optional)
&fromname (Optional)
&gotoid (Optional)
&invalidClass (optional)
&jScript (optional)
&keywords (Optional)
&language (Optional)
&mailselector (Optional)
&mobile (Optional)
&mobiletext (Optional)
&noemail (Optional)
&postOverides (optional)
&protectSubmit(optional) defaults to 1 (on)
&replyto (Optional)
&reportAbuse (optional)
&requiredClass (optional)
&runSnippet (new in 1.4.4) (optional)
&sendAsHtml (optional)
&sendAsText (optional)
&sendirect (Optional)
&sessionVars (optional)
&snipFolder (new in 1.4.4) (optional)
&subject (Optional)
&submitLimit (optional) off (0) by default
&thankyou (Optional)
&to (Optional)
&vericode (Optional)

PHP Event Functions:


&eFormOnBeforeFormMerge (optional)
&eformOnBeforeFormParse (optional)
&eFormOnBeforeMailSent (optional)
&eFormOnMailSent (optional)
&eFormOnValidate (optional)
chunk name (non-numeric) or document id (numeric) to use as a form template (new in
Description
[!eForm?
1.4.4)This Youis&formid=`ContactForm`
acan
unique
now also id used usetoa identity &subject=`[+subject+]`
snippet aasform
the during
template &to=`you@youremail.com`
postbacks.
source. NoThis is useful inare
parameters cases where
forwarded
&ccsender=`1`
more
to the than
snippetonecall &tpl=`ContactForm`
form in exists on a page.
this version. For&report=`ContactFormReport`
Your
the form template
regular form fields should
you do &gotoid=`1`
either have a hidden
not normally !]need to field
add
with the same they
placeholders, formid <input type="hidden"
automatically get inserted name="formid"
by eForm. The value="formName"
esception to this rule /> orare (fromin the
eForm
case chunk
of1.4.x) name
event you (non-numeric)
can set
functions the the
where youoriddocument
in thetoform
want set id specific
(numeric)
tag itself: to useSpecial
<form
values. when generating
id="formName"...>;
placeholders reports.
available
Tags: Same as for &tplplus [+fieldname+], where
are: [+validationmessage+], [+postdate+],[+verimageurl+] & [+debugText+]. You should fieldname stands for the name of eachhave form
field you wish to include.
the [+validatiomessage+] placeholder in all your forms. The others you may need depending
Nameparameters.
on other to display as sender of the auto-respond message.
chunk
Set to 1 nameto allow (non-numeric)
user to enter or html
document id (numeric)
tags. Defaults to 0 to use as an auto-responder
message Can include [+form fields+].
Adds a style declaration to the <head> section of the page E.g. [+firstname+] - tags:
when [form_fields],[postdate]
either the form is displayed - note:
eForm
or the will send
thank you page the auto-respond message to the email address specified inside the [email]
form email
field.toiddisplay as is displayed
sender of the (only if the &thankyou
auto-respond message parameter is set). Values can be a
e.g. no-reply@mydomain.com
document (numeric), chunk name or (relative or absolute) url to css file. Multiple values can
Same as &emailbut for Bcc:
be separated
Category ID by or a comma
name used (in fact all three values
to categorize eForms. canIfbe mixed).is not found a new category
category
will beb created This will appear in the subject of the email sent to the user
Same
[!eForm as &emailbut for Cc:
&cssStyle=`assets/site/forms.css,chunkName` ... !]Defaults to 0 eForm will look for
Set to 1 to send the user a copy of the submitted form.
[!eForm &cssStyle=`chunkName`
the user's email address inside a field called email. ... !]
[!eForm &cssStyle=`http://mysite.com/assets/styles/forms.css` ... !]
Set to 1 for extended error messages in form validation. Mostly for debugging #LIST and
#SELECT
Chunks validation.
Sets(and the emaildocuments address if atodocappear id is in given)
the From can returnsection a values in the form of:
of the email
1. an inline style block, eg. <style type="text/css">/some
Sets the name of the sender in the From section of the email styles/</style>
2. a link to stylesheet(s), eg. <link href="assets/site/forms.css" rel="stylesheet"
document id to load after sending message. See also &thankyou
type="text/css">
Css class name. Will add class in invalid form fields on validation. Existing classes will be
3. aSimilar
commatoseparated
preserved. &cssStylelist butoffor urls, eg. javascript to the <head> of the page document.
adding
assets/site/forms.css,assets/site/more.css,assets/site/gone_overboard.css
Currently Javascript
Comma delimitediskeywords only added or when the form used
[+formfields+] is displayed.
when searching databank E.g.
[+firstname+],
Support
Sets the forname[+lastname+],
multilingual [+email+]
validation to and error messages. Uses asame language names the as
Prevents eformof fromthe sending
form field emails usee.g.as a selector to select
no-reply@mydomain.com single email
Set to 1from to disable
MODx.
comma (,) delimited emails assigned the &toparameter. This selector field will act like a
emails. Defaults to 0
numeric
Mobile index email to address.
select an This email. emailIt will is start
usedatto1send for the first email
a short and ends
notification at N for
message to the last
a mobile
email
device. in the
Textexample:
For list.
message&to to send to mobile device Can include [.form fields.]. E.g. Order for
=`sales@me.com,support@me.com,billing@me.com`
Protects against submitting a form multiple times with the same data. Submitting the form
[.firstname.]
&mailselector=`topic`
becomes
Used in disabled
combination after the first successfulNormally
of &sessionVars. submit while session the value
variables fromwill keyoveride
form fields posted
remains
On the
values. the same.
web form
By setting This is achieved
the topic fields isposted
&postOverides=`1` by setting
actuallyvalues (and comparing)
a dropdownwill take menu. a session variable
when the user selects
precedence. with ana
md5 hash
topicEmail from
from address these
the list the key fields.
value 1,2 or Which fields
3 will be email are compared
sent toaddress eForm which depends
willemail on the
then address value
be used to toofappear
select in
Css class
&protectSubmit.Possible name. or Will
fieldname
add
values containing
classare in 0 (empty)
(off), required
1 (all 'required' formSets the
fields
fields onused)
are validation.
or you Existing
canaddress
set a
one
the of the
ReplyTo three
sectionemails assigned to the &toparameter. This email address will be the
Setting
classes
comma will &reportAbuse=`1`
to separated
usedExpects send be the listofofthe
preserved.
email field
to.
email will send
names. Toanensure
email that to the thesystem
session specified
variableemail worksaddressseparatedly if
email injection a snippet
attempts name. Snippetbywill
are noticed be run(Use
eForm. before any eForm handling. One parameter,
sparingly...)
for different forms the session variable name is based on &formid ({formid}_hash).
the If&&formid
you have will be passed
already set a to the snippet.
class for a fieldAny returnand
or label valueyoufrom the snippet is
get unexpected css discarded.
results
This can
Force beemailused to
messagesinsert functions
to be in as
Html. an alternative
Possible
check the order in which you have declared the classes. The &requiredClass is added to
values: declaring a
&sendAsHTML=`1`- separate snippet
send intothe
all the
document.
Comma
messages
Force email
beginning of Sadly
as delimited
html,
any eForm
message listwill
of silently
to$_SESSION ignore
&sendAsHTML=`report,autotext,mobile`-
classes be inset.
already plain text. a Possible
snippet
variable names.that does
values:These not
send willexist due messages
be added
specified
&sendAsText=`1`- to tothe the
sendway listasof
all
$modx->runSnippet
field
html valuesas
messages before
text only, handles
the form issnippet
displayed returnandvalues.
&sendAsText=`report,autotext,mobile`- can for instance besend usedspecified
to populate messages(hidden)as
This
fields.
text For will
When use
using the form
this field
parameter called make email sure to
onlythose that want to keep different versions of eForm active. You can now save supply
you are the
not email address
disclosing to
sensitive send the
information message from
to. Set
the to 1 to(a
session!! activate
hiddensend field direct.
is not all Defaults
that hidden to 0 afterall) all of
eForm's files in a different directory and set the &snipFolder accordingly. You can for instance
saveEnforces
Asversion
eForm
a timeinlimit
1.4.4 (in
theparse minutes) between form submits.
'assets/snippets/eform/1.4.4' folder After
and you the form has been
set
Subject
submitted to does
appear
successfully
&snipFolder=`eform/1.4.4`.
not init email
canThe the
Can
not complete
be
value include
submitted
of
form
[.form
&snipFolder
1st
again time
fields.].
for
is
around
E.g. Purcase
&submitLimit
added to the
will havefor
Order
minutes
basic
to [.firstname.]
have the of
irrespective
snippets folder [!
same placeholders
[.lastname.]
the form data. When inused
the form in template sowith
combination the &protectSubmit
form can receivesubmitLimit the values. So for
takes example:
precedence,
'assets/snippets/'.It
eForm &sessionVars=`jobID` should not include
... !]and a closing slash
<input type="hidden" (/)! value="[+jobID+]" />
meaning
chunkthat name when the time limit
(non-numeric) orhasdocumentexpired idthe form cantobe
(numeric) usesubmitted
as a thank again
youregardless
message of
the Email
settingaddress
displayed toofthe&protectSubmit
user after a (it will
successful unset the
submit. session
Tags: variable).
same
to send eForm information to For multiple recipients separate emails with as As
for with
&tpl &protectSubmit this a
parameter
comma Enables uses a
(,) If verification session
omitted the code. variable
site settings with
The template a variable
email addresscontain willname based on &formid.
be usedfield and a [+vericode+]
a vericode
placeholder

Expects a function name. This function will only be called whenever the form is displayed
andExpects a function
just before name. The
all placeholders arefunction
merged. is The
called after the
function templates
should are loaded
accomodate and the
the following
formid is
parameter: found valid.
&$fields The
- (as function
reference) should accomodate
an associative the following
array after
of field parameter: &$templates -
Expects
Expects a
(as reference)a function
function name. This
This function
name. array
an associative function
of loaded will be
be called
willtemplates
calledwith
directlytheand
form
after
indexes
placeholder
the
'tpl', form
values.
has'report','thankyou'
been validated
validation has&
and
takenbefore
place.the report and thankyou templates have been parsed and anyhasemails have been
'autotext'.
sentExpects
out.
Be
SeeaYou
aware canthat
function
this
use
name.
example
this
the
on
event
latter
This
how
to add
three
function
to use the
your
will is
only own
have
called extra
after
events. allvalidation
a value if the
templates logic.
form haveThe function
been
been posted!
parsed and
should accomodate
any emails were sent. the following parameters

o &$fields - (as reference) an associative array of field and placeholder values.


o &$vMsg - (as reference) a numeric array of validation error messages.
o &$rMsg - (as Reference) a numeric array of missing required fields.
<p><input name="name" id="cfName" class="text" type="text" eform="Your Name::1:" /></p></label>
<label for="cfEmail">Your Email Address:
<p><input name="email" id="cfEmail" class="text" type="text" eform="Email Address:email:1" /></p> </label>
<label for="cfRegarding">Regarding:
<p><input name="subject" id="cfRegarding" class="text" type="text" eform="Form Subject::1" /></p> </label>
<label for="cfMessage">Message:
<p><textarea name="message" id="cfMessage" eform="Message:textarea:1"></textarea></p>
<p>This is </label>
a response sent by <b>[+name+]</b> using the feedback form on this website. The details of the message follo
basic required chunks
<label>&nbsp;</label><p><input type="submit" name="contact" id="cfContact" class="button" value="Send This M
<p>Name: [+name+]</p>
basic contact
</fieldset> form
<p>Email: [+email+]</p> chunk: copy and past below
</form>
<p>Regarding: [+subject+]</p>
Basic Report Chunk
<p>Comments:<br : copy and paste below
/>[+message+]</p>
<p>You can use this link to reply: <a href="mailto:[+email+]?subject=RE: [+subject+]">[+email+]</a></p>
Handy plugins/snippets that aren't installed by default
Name Description
Hides the content editor when using a template that doesn't
Hide Editor Finds and
contain thegives every element of the document. such as
content-variable
DocInfo "Pagetitle"(default),
Used to hide, change, "alias", "longtitle"
or inherit documentand etc.
objectvery convenient
fields in the
Customize Manager fields to find
manager. the template
Can change, variables
hide, (TVs)
or inherit based on specific
Inherit
Allows
This Selected
youortoreturns
snippet hide, Template
change
theuser isand
contanta replacement
inherit forwhose
document
of the Chunk theobject
"Inherit
namefields
is
ManagerManager templates
Page Template" managerplugin. By roles.
default newly created child
plus
This a whole
build isfrom
a lot
snippet more.
the concatenation
to output a of the name
certain string of
or the
chunkcurrent
when it
GetChunkTemplate documents willtheinherit the parents template (asby with
template
meets and
certain parameter
criteria, such chunk,
as separated
the current document thethe
id is listed
Inherit Selected Template original
underscor plugin) However,
character: selecting a template in the parent
on
container's 'Inherit Template' TV will make all new childlisted
$id parameter, or the current document parent id is
CurrDocOut
on $parent
Returns
documents anyparameter.
field
(of that It can
orparent)
template react
variable
inherit to $notid
the from any
selectedor template
$notparent
document or
getField Grab the
parameter events
as well, fromwhichyourisGoogle
the Calendar
opposite from and
the display
previous them
any of
instead.
Tableau its parents.
This
works works
like recursively through theasdocument tree.
GoogleEvents as a list and
example.
FileDownloadPE or a other
in (Pirate list-makers
Calendar.
Edition) Supposedly
is a
such
secure canDitto
file even ormash
downloading
Wayfinder,
multiple but is designed
calendars together to build tables. This is ideal for
Tableau snippet for the MODx CMS/F. FileDownloadPE
PHx (Placeholders
product category Xtended)
pages such willas addWeb
on stores is
the capability secure
where youas it
of output
FileDownloadPE
PHx (Placeholders hides
modifiersthe actual
when path
using to your file.
placeholders, FileDownloadPE
template
want, say, a 3x3 grid of products, with prev/next page controls. keeps
variables and track
Extended of how many
settings tags. times each file parser
The recursive has been downloaded
allows for nestedand lets
tags.
Create
you display
Custom amodifiers
filethat
archive canorbe
number output
wherever
added filebyinformation
you for a supplied in
want."mini-snippets"
creating file
File Details
path.
A snippet (a PHx
the MODx resource manager. extension) and a plugin to use phpThumb
phpThumb Package
within MODx.

Possibly handy plugins/snippet


Specify in the parent container, the templates you want to use
Automatic Template for your documents. Stop teaching your client what a template
is :)
lled by default
Direct Link Possible use
http://modxcms.com/Hide-Editor-
1410.html
http://modxcms.com/DocInfo-
2266.html
http://modxcms.com/Customize-
Manager-Fields-1342.html
http://modxcms.com/ManagerMana Could potentially avoid the use of template variables
ger-1565.html
http://modxcms.com/GetChunkTem which parent
Allow can betemplate
confusingtoto
beend users,from
different but since it is
the default
plate-2031.html
http://modxcms.com/Inherit- template
inherited specific
templatesthis
ofmight tempt you toThis
child documents. create
waymore
Selected-Template-2248.html
http://modxcms.com/CurrDocOut- templates thanneed
clients do not you to
need.
think about templates and a
556.html
http://modxcms.com/getField- document tree can be much cleaner.
667.html
http://modxcms.com/Google-
Events-1301.html
http://modxcms.com/Tableau-
1568.html
http://modxcms.com/FileDownload
PE-2088.html
http://wiki.modxcms.com/index.php/
PHx
http://modxcms.com/FileDetails-
580.html
http://modxcms.com/phpThumb- Allows for image resizing on the fly. Users can upload
Package-0.2-1524.html pictures and the pictures will be resized on the fly.

http://modxcms.com/automaticTpl-
2155.html
Handy
Code
API calls
$modx->getTemplateVar('TVName')
$modx->documentObject['documentfield/TVname'] )
$TVarray = $modx->getTemplateVarOutput(array('TV
NAME'));
working with tables
$modx->getFullTableName()

Database API
Code
db->connect()
$modx->db->delete()
$modx->db->disconnect()
$modx->db->escape()
$modx->db->getAffectedRows()
$modx->db->getColumn()
$modx->db->getColumnNames()
$modx->db->getHTMLGrid()
$modx->db->getInsertId()
$modx->db->getLastError()
$modx->db->getRecordCount()
$modx->db->getRow()
$modx->db->getTableMetaData()
$modx->db->getValue()
$modx->db->getXML()
$modx->db->initDataTypes()
$modx->db->insert()
$modx->db->makeArray()
$modx->db->prepareDate()
$modx->db->query()
$modx->db->select()
$modx->db->update()
Description
Get'st the value of a template variable for current document
Get's the value of a document field (e.g. 'created' on or
'introtext'),
Calling TVscanin aalso return template variable, but returns them
snippet
as an array with its value in second slot. i.e. $value[1]
The content of the TV is now in the array $TVarray['TV NAME']
by character.
Returns (e.g.
the full $TVarray['TV
table name basedNAME'][1] is the second
on db settings.
character in the string.

Description

mixed makeArray(Array $rs )


string prepareDate(integer $timestamp, string $fieldType =
'DATETIME')
mixed query(String $sql)
This function
resource takes a recordset
select([string $fields [, and turns
string it into
$from a multi-
[, string $where [,
dimensional
string associative
$orderby [, string array, which is much easier to work
$limit]]]]])
boolean update(String $fields, String $table, String $where)
with in your scripts. Each array element represents a row in the
recordset, in the form of Key => Array( FieldName => Value ).
example Link

http://wiki.modxcms.
com/index.php/Addi
ng_TV_Widgets_wit
$table = $modx->getFullTableName( 'web_user_attributes' ); hout_hacking_the_c
ore

example link

function show_members() { http://wiki.modxcms.


global
function $modx; $date ) {
getEvents( com/index.php/API:
$output$output
global = '';
= '';$modx; DBAPI:makeArray
http://wiki.modxcms.
$result$table
$output= = =$modx->getFullTableName(
'';
$modx->db->query(
$res = $modx->db->select("id", 'SELECT id,'members'
name, joined ); FROM
$table_prefix.".modx_web_users", com/index.php/API:
$fulldate
`user_table` =
GROUP
"username='$username' $modx->db->prepareDate(
BY
function update_username( $id, $username ) {`member_type`
AND $date,
ORDER 'DATE'
BY name
password='".md5($password)."'"); ); //Converts
ASC' ); DBAPI:query
http://wiki.modxcms.
$result = $modx->db->select(
the timestamp into a human-readable 'id, name,
DATE. picture', $table, '', 'name
global $modx; com/index.php/API:
ASC',
while( ''$row
); = $modx->db->getRow( $result ) ) {
$table = $modx->getFullTableName( 'user_table' ); DBAPI:update
$members
$result
$output = $modx->db->makeArray(
=.=$modx->db->select(
'<br 'event_name',
/> ID: ' . $row['id'] $result
. '<br /> ); ' . $row['name']
'events',
Name: 'timestamp.
= ' . intval(
'<br /> Joined:$date ' . ) );
$row['joined']
$result = $modx->db->update( 'username = "' . $username . '"',
foreach(
.while(
'<br $row$members as $p_val ) {
= .$modx->db->getRow(
/>---------<br $result ) ) {
$table, 'userid = "' $id />';
. '"' );
foreach(
$output $p_val
.= as $m_key => .$m_val
$row['event_name'] ' on ){
} return $result; // Returns 'true' on' success,
. $fulldate . '.'; on
'false'
echo $output; //Would $outputoutput .= '<strong>'
something . $m_key
like "the . ':</strong>
Declaration ' . $m_val .
of
failure.
'<br />';
Independence was signed on 1776-7-4"
}
} }
} }
}

[edit]
Miscellaneous snippets, and or template hacks etc.
Name
formatdate snippet
includeDocContent
loginRedirect
s snippets, and or template hacks etc.
Code, hack, etc.
<?php
/*
<?php
Created by Brandon Booth: bbooth@lucidgreen.net
/*
Last updated: December 14, 2008
<?php
Created
Parameters: by Brandon Booth: bbooth@lucidgreen.net
$refresh
Last
&dateField: = '<META
updated: select http-equiv="refresh"
December
standard14,document
2008 content="5;URL='.$modx->makeUrl(6).'">
date ';
field or custom tv date field by name. Defaults to createdon date.
Parameters:
&dateFormat: set format for date in with standard PHP date formatting. Defaults to %A, %D.
if($modx->getLoginUserID()){
&docID:
*/ the document id from which to pull the fundraisers longtitle and content. Defaults to 18
Example$modx->regClientStartupHTMLBlock($refresh);
call:
}[[includeDocContent?
else { code, the rest should
//Begin &docID=`ID`]]
take care of itself.
return
*/ ' ';
}$dateField = isset($dateField) ? $dateField : 'createdon';
?>
//Begin code, =the
$dateFormat rest should take care
isset($dateFormat) of itself. : '%A, %D';
? $dateFormat

$docID
if ($date==isset($docID) ? $docID : '18';
$modx->documentObject[$dateField] ){
if(is_array($date)){
if($doc = $modx->getDocuments(array($docID), 1, 0, 'longtitle, content')) {
$dateOutput = $date[1];
return "<div class='right-content'><h4>".$doc[0]['longtitle']."</h4><ul><li>".$doc[0]['content']."</li></ul></div>";
if(empty($dateOutput)) return ''; //bail out if no value
$dateOutput = mktime($dateOutput);
} return strftime($dateFormat, $dateOutput);
return '';} else {
?> return strftime($dateFormat, $date);
?> }
}
return '';
?>
Description
This code was written to format the date the same
way whether
This code willittake
wasthetaken from and
content the standard
longtitle from
createdon
another to
Snippet field
document or from
redirect in
any a
the special
tree
logged in variable
and format
user itI created.
into a
to another
div. to be included in a template. TO BE DONE:
page. Be sure to call it uncached [!loginRedirect!]
need to make this format templateable with a
chunk or inline.