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
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`!]
" "
" "
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
>able
&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
Default: "|"
Default: ”,”
News Publisher Snippet
Snippet placeholders
Placeholder Description
separator between a document URL and parameters (for example
[+sepchar+]
[~[*id*]~][+sepchar+]param1=value1¶m2=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
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
¬ify 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)
¬ifyAuthor 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)
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
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
http://wiki.modxcms.
com/index.php/Addi
ng_TV_Widgets_wit
$table = $modx->getFullTableName( 'web_user_attributes' ); hout_hacking_the_c
ore
example link
[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.