MODx Cheat Sheet

download MODx Cheat Sheet

of 47

Transcript of MODx Cheat Sheet

  • 8/14/2019 MODx Cheat Sheet

    1/47

    Copyright, 2009, by Brandon Booth. All rights reserved. Permission is granted to make copies of this spread

    Please visit my website at: www.lucidgreen.net

    PLEASE NOTE:

    Official Docs: http://svn.modxcms.com/docs/display/MODx096/Home

    Wiki: http://wiki.modxcms.com/index.php/Main_Page

    Site Settings Tags[(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

    http://svn.modxcms.com/docs/display/MODx096/Document-Specific+R

    [*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.

    [*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.

    [*pub_date

    [*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.

    [*richtext

    [*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.

    [*deleted

    [*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

    . . .

    , , , . .=` `

    Template Variables (aka TVs) can be used in templates, and directly in documents. They can also becalled within snippets and chunks

    "

    . .~ * * ~

    - . ,

    -

    -

  • 8/14/2019 MODx Cheat Sheet

    2/47

    # privateweb

    # privatemgr

    # content_dispo

    # hidemenu - [0|1] Whether or not the document is to be hidden in the menu.

    Custom template variables

    [*custom name*] Any custom template variable

    @BINDINGS

    @DIRECTORY path_to_folder

    @INHERIT

    @FILE file_path

    @DOCUMENT document_id

    @CHUNK chunk_name

    @SELECT sql_statement

    @EVAL php_code

    Snippets

    [[snippetname]] Cached format (output only updated when page is re-cached)

    [!snippetname!] Uncached format (output is updated on every page call)

    A snippet call with a setting variable.

    Chunks

    {{chunkname}} Basic format

    manipulate chunks with API in snippet

    links

    [~#~] links to document whose ID = #, e.g. [~3~]

    -

    -

    - -

    >getTemplateVarOutput(array('TV The content of the TV is now in the array $TVarray['TV NAME'] by.

    , _ _ _

    " ". ._

    id of the document. The returned value is a string containing the_the chunk. The returned value is a string containing the content of the

    Where sql_query is the actual database query. The return value is a

    the code. Where php_code is the actual php code to be evaluated.

    [[snippet?&settingVariable=`value`]]

    $modx->runSnippet( snippetName,array($params));

    array("tpl" =>

    , , . ,

    -- ' '

  • 8/14/2019 MODx Cheat Sheet

    3/47

    sheet for private use only.

    esource+Fields

  • 8/14/2019 MODx Cheat Sheet

    4/47

  • 8/14/2019 MODx Cheat Sheet

    5/47

    Wayfinder Snippet

    complete documentation ver. 6

    Useful Sample Calls[!Wayfinder? &startId=`0`!] Minimum call; start id 0 index from site root

    Parameters listParameters That Determine Which Documents to List

    Parameter Description Value Type

    &startId integer

    &level integer

    &limit integer

    &displayStart boolean

    &ignoreHidden boolean

    &hideSubMenus boolean

    &includeDocs

    &excludeDocs

    Parameters That Specify The Order in Which to List Documents

    Parameter Description Value Type&sortBy

    &sortOrder

    Parameters That Determine the Values of Certain Placeholders

    Parameter Description Value Type

    &textOfLinks

    &titleOfLinks

    &useWeblinkUrl boolean

    &fullLink boolean

    &rowIdPrefix text string

    &showSubDocCount booleanSome Utility Parameters

    Parameter Description Value Type

    &removeNewLines boolean

    &ph text string

    &debug boolean

    &config text string

    &cssTpl text string

    &jsTpl text string

    Parameters That Assign CSS ClassnamesParameter Description Value Type

    The following apply to output generated by "row" templates:

    &rowClass text string

    &firstClass "

    MaxiGallery scroll right->http://www.lucidgreen.net/modxGuides/wayfinder200_docs_v6.html

    =` `

    either way it's required).

    that it may include in its output. A value of 0

    include in any list or sub-list. A value of 0

    specified in the parameter &startItemTpl to

    setting this parameter to TRUE

    immediate children (if any) of the. -

    By default Wayfinder lists all documents thatMODx thinks should be visibleto the current user. But if there are certaindocuments you don't wantlisted under any condtion, then you can listthem in this parameter andWayfinder will exclude them from its output.

    comma separatedlist.

    order. Note that in either case

    different field as the source of this text. If you

    lets you specify a different field as the source

    document) set this to FALSE."

    lists, the value you set in this parameter will

    number of immediate children

    However setting this parameter,

    listing of all the internal

    must be in the directory

    URL of the CSS file.URL of the JavaScript file.

    . .

  • 8/14/2019 MODx Cheat Sheet

    6/47

    &lastClass "

    &selfClass "

    &hereClass "

    &parentClass "

    &levelClass [I don't know what this does.] "

    &webLinkClass "

    The following apply to output generated by "container" templates:

    &outerClass "

    &innerClass "

    Parameters That Tell Wayfinder What Templates to Use

    Parameter Description Value Type

    These are the row-level templates: (1)

    &startItemTpl text string

    &rowTpl "

    &innerRowTpl "

    &hereTpl "

    &innerHereTpl "&parentRowTpl "

    &parentRowHereTpl "

    &activeParentRowTpl ??? "

    &categoryFoldersTpl "

    These are the row-level templates: (5)

    &outerTpl "

    &innerTpl "

    Placeholders That Can be Used Within Wayfinder Templates

    Parameter Description Comments

    [+template_variable_name+]

    [+document_field_name+]

    [+wf.wrapper+]

    [+wf.classnames+]

    [+wf.classes+]

    [+wf.link+]

    [+wf.title+]

    [+wf.linktext+]

    [+wf.subitemcount+]

    placeholders of the last row of each

    placeholders of the row corresponding.

    . .

    [+wf.classes+] and [+wf.classnames+]

    - Note that, if &displayStart parameter is set

    level items except the start

    of style rules to the chain of documents that

    be used for the highestoutput for rows that are

    "here" chain that are above the last/lowest

    This is useful because sometimes web

    .-

    for all the sub-menus

    web page's template can be

    referenced from within a Wayfinder

    template (container-level or. .

    .--

    -

    ,

  • 8/14/2019 MODx Cheat Sheet

    7/47

  • 8/14/2019 MODx Cheat Sheet

    8/47

    Legal Values Default Value Comments

    0

    0

    TRUE, FALSE FALSE

    TRUE, FALSE FALSE

    TRUE, FALSE FALSE

    (empty)

    (empty)

    Legal Values Default Value Commentsmenuindex

    ASC

    Legal Values Default Value Comments

    menutitle

    pagetitle

    TRUE, FALSE FALSE

    TRUE, FALSE FALSE

    (empty)

    TRUE, FALSE FALSE

    Legal Values Default Value Comments

    TRUE, FALSE FALSE

    (empty)

    TRUE, FALSE FALSE

    default

    (empty)

    (empty)

    Legal Values Default Value Comments

    (empty)

    " "

    web page in which,

    ,

    concert with the

    Positive integersthat are thedocument IDs of thedocuments you wishtohave excluded. ???

    This parameter wasadded in Wayfinder2.0.

    --

    -

    -

    -

    -

    configuration file's added in Wayfinder

    that contains the

  • 8/14/2019 MODx Cheat Sheet

    9/47

    " "

    " "

    " "

    " "

    " "

    " "

    " "

    " "

    Legal Values Default Value Comments

    -2

    " -3

    " (empty)

    " (empty)

    " (empty)" (empty) -7

    " (empty) -7

    " (empty) -7

    " (empty) (7)?

    " -4

    " (empty)

  • 8/14/2019 MODx Cheat Sheet

    10/47

  • 8/14/2019 MODx Cheat Sheet

    11/47

    MaxiGallery Snippet

    http://wiki.modxcms.com/index.php/MaxiGallery

    Useful Sample calls:

    Parameter ListsParameter

    &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

    _ _=` ` =` `_ _ _

    &thumb_use_watermark=`1`_ _&display=`embedded` &embedtype=`slimbox`

    _ _ , , ,=` ` =` `

    _

  • 8/14/2019 MODx Cheat Sheet

    12/47

  • 8/14/2019 MODx Cheat Sheet

    13/47

    &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

  • 8/14/2019 MODx Cheat Sheet

    14/47

    With Watermark on thumbnails

    Description Possible values Default value

    external

    RGB Hexadecimal FFFFFF

    path

    resize

    RGB Hexadecimal FFFFFF

    path

    Use a dropshadow on big pictures. 0

    Use an imagemask on big pictures. 0

    Watermark big images. 0Font size for the watermark text. 5

    Horizontal alignment of the watermark. right

    path

    text Copyright

    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

    text

    Vertical alignment of the watermark. bottom

    Parent documents to search,looking for childgalleries. Current documentNumber 0

    Number 0

    MODx document object field. menuindex

    ASC

    0

    0

    0

    Select the gallery display mode. normal

    The template used for drag sort popup.

    ,

    from each. smoothgallery

    gallery.

    usergroup names

    Web usernames that have admin user privileges and--.

    imagemask/. -

    -.

    ,

    - 0- 1

    - 0- 1

    --- 3

    - centerPath to the watermark image. It can be a transparent

    png. Make the margins of the watermark astransparent areas.

    maxigallery/watermark/

    ,

    --- center

    .

    --- @FILE:

    _ _ - @FILE: - path to a file

    igallery/

    Shows some debug information in the MaxiGallery-

    -linked in the head of the site template and you want to

    -

    ---

    -- @FILE:gallery display

    -

  • 8/14/2019 MODx Cheat Sheet

    15/47

    path

    FTP account password password

    number 21

    FTP address

    username

    text maxigallery

    0

    0

    1

    en

    9999999

    Document id

    Document id

    1024

    Number 0

    450

    130

    Number of rows to skip. 0

    pos,date

    DESC

    RGB Hexadecimal FFFFFF

    path

    resize

    RGB Hexadecimal FFFFFF

    path

    0

    0

    0

    3

    right

    path

    text Copyright

    RGB Hexadecimal FFFFFF

    Number (px) 10

    Number (px) 10

    text

    bottom

    Number 0

    Number 4

    Document id Current document

    Picture id

    if your FTP root

    ' - " "- @FILE: - @FILE:

    maxigallery/template

    Determines if the document is to be the target for

    --

    chunk name or - chunk name-

    -----

    document (page) that has the

    pictures. Use the same

    - @FILE: maxigallery/template

    - @FILE:Comma delimited web groups that can post pictures to

    Comma delimited web user names that can post

    - @FILE: - @FILE:Size of the big image. Pixel size of largest dimension, - WidthxHeight (px) (eg.

    Maximum number of images allowed in this gallery.

    Maximum size in pixels of the normal picture. (largest - WidthxHeight (px) (eg.

    - WidthxHeight (px) (eg.

    by. If random is used--

    - -- @FILE:

    Mask background color for normal pics. This should be

    The Imagemask position. The resize option resizes the--

    'Shadow background color for normal pics. This should

    Path to the shadow images to be used, if you don't-

    ------ 3

    - centerPath to a watermark image. Use a png image with a maxigallery/waterma

    Determines the type of the watermark to be used,-

    -- center

    The number of thumbnail pictures to show per page in

    pictures. Use the same

    - @FILE:If pictureview display mode is used, this parameter can

  • 8/14/2019 MODx Cheat Sheet

    16/47

    Picture number to start from First picture

    Number (%) 100

    Number (%) 70

    Number (%) 70

    Number 1

    0

    Number 0.7

    Number (px) 20

    Number 0.4

    Number (ms) 9000

    TRUE

    Number (ms) 500

    Number (px) max_pic_size

    Text Gallery id

    TRUE

    TRUE

    TRUE

    TRUENumber 0.7

    text

    Number (px) 75

    Number (px) 10

    Number (px) 100

    FALSE

    (px) max_pic_size

    RGB Hexadecimal FFFFFF

    path

    resize

    RGB Hexadecimal FFFFFF

    path0

    0

    0

    1

    right

    path

    text Copyright

    RGB Hexadecimal FFFFFF

    Number (px) 2

    Number (px) 2

    text

    bottom

    Number 10

    0

    Document ID

    If pictureview display mode is used, this parameter can

    The quality of the big picture. A percentage between 0-

    -

    -Defines how many levels deep to go from the parent in

    -

    -

    --

    .

    Individual id for the smoothgallery instance. This allows-

    ------

    -.

    --

    the picture) will

    Mask background color for thumbnail pics. It should be

    Imagemask position. The resize option resizes the--

    The shadow background color for thumbnail pics. This

    . ------- 3

    - centerPath to a watermark image. Use a png image with a maxigallery/waterma

    -

    -- center

    , --

    the gallery parent

  • 8/14/2019 MODx Cheat Sheet

    17/47

    Ditto Snippet

    EXAMPLE CALL

    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 which adds functionality to Ditto

    &filter

    &filters

    &format Output format to use

    &globalFilterDelimiter Filter delimiter used to separate filters in the filter string

    &hiddenFields

    &hideFolders Dont show folders in the returned results

    &hidePrivate

    &id

    &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&keywords

    &language language for defaults, debug, and error messages

    &localFilterDelimiter

    &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

    &parents

    &phx Use PHx formatting

    &placeholders

    &queryLimit

    &randomize Randomize the order of the output

    &removeChunk

    &save

    &seeThruUnpub

    &showInMenuOnly Show only documents visible in the menu

    &showPublishedOnly Show only published documents

    &sortBy

    &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

    Aggregates documents to create blogs, article/newscollections, and more,with full support for templating. Theselists were pulled from the modx wiki&tpl=`story_summary`!]

    then it will be removed. Use in the format "field,criteria,mode"

    ,

    ,

  • 8/14/2019 MODx Cheat Sheet

    18/47

    &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

    &summarize,

  • 8/14/2019 MODx Cheat Sheet

    19/47

    News Publisher scroll right ->

    possible values Example Usage Helpful links

    http://www.php.net/strftime

    php/Ditto

    CONFIG_NAME Other configsinstalled in the configs folder or in

    any strftime format string see linkto right ->

    folder or in any folder within the. .

    - -

    - ,-

  • 8/14/2019 MODx Cheat Sheet

    20/47

  • 8/14/2019 MODx Cheat Sheet

    21/47

    News Publisher Snippet

    &folder folder id where blog posts are stored

    &makefolder

    &postid

    &canpost

    &badwords comma delimited list of words not allowed in post

    &template name of template to use for news post

    &headertpl

    &footertpl&formtpl form template (chunk name)

    &rtcontent name of a richtext content form field

    &rtsummary name of a richtext summary form field

    &showinmenu

    &aliastitle set to 1 to use page title as alias suffix. Defaults to 0 - date created.

    &clearcache

    se o o au oma ca y conver e paren ocumen o a o er.Defaults

    document id to load after posting news item. Defaults to the pagecreatedcomma e m e we groups a can pos commen s. eave an orpublic

    news

  • 8/14/2019 MODx Cheat Sheet

    22/47

  • 8/14/2019 MODx Cheat Sheet

    23/47

    NewsManager

    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.

    &editformid

    &template name of template to use for news post

    &headertpl

    &footertpl

    &rowtpl template used to display a single post (chunk name)

    &clearcache

    &nrposts number of posts to show per page

    &paginate paginate

    &prv chunk to be used inside the previous link

    &nxt chunk to be used inside the next link&alwaysshow

    &prevnextsplitter

    &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

    refreshid

    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 placeholdersPlaceholder Description

    [+sepchar+]

    [+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

    [+refresh+]

    [+hidemenu+]

    [+pubish+][+next+] text for next action

    sp ay a owne art c es n a ta e toget er w t uttons t at perm t toedit/delete/hide/publisch etc. every single article in a blog. !!! Use only one snippet pera e !!!

    _

    removed when prev/next page is not available, | delimiter will not be

    ,

    ~ * * ~ = =

  • 8/14/2019 MODx Cheat Sheet

    24/47

  • 8/14/2019 MODx Cheat Sheet

    25/47

  • 8/14/2019 MODx Cheat Sheet

    26/47

  • 8/14/2019 MODx Cheat Sheet

    27/47

    Default value

    0

    ''

    'content'

    'introtext'

    0

    00

    - -'

  • 8/14/2019 MODx Cheat Sheet

    28/47

  • 8/14/2019 MODx Cheat Sheet

    29/47

    Jot template parameters -->parameter value&action yes

    &docid yes (docid as integer)

    &tagid yes (tagid as string [A-Za-z0-9])

    &subscribe yes

    &moderated yes

    &notify yes

    &subjectSubscribe yes (string)

    &subjectModerate yes (string)

    &captcha yes

    &badwords yes

    &bw yes

    &customfields yes

    &authorid yes (id of source author)

    &title yes (title of source)

    &css yes&cssFile yes

    &sortby yes (comma seperated sort string)

    &numdir yes

    &validate yes (comma seperated validate string)

    &guestname yes (string)

    &postdelay yes (seconds as integer)

    &pagination yes (number of comments per page)

    &placeholders yes

    &output yes

    &debug yes

    &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)

    &notifyAuthor yes

    &subjectAuthor yes (string)

    - count-subscriptions

    ---

    - 1 (default)

    - 1

    - 1 (default)

    --

    --

    -----

    --

  • 8/14/2019 MODx Cheat Sheet

    30/47

    Jot Template Pdescription parameter Controls what to display &tplForm yes

    &tplComments yes

    &tplModerate yes

    &tplNav yes

    &tplSubscribe yes

    &tplNotify yes

    Subject for subscription notification email. &tplNotifyModerator yes

    Subject for moderator notification email. &tplNotifyAuthor yes

    &cssRowAlt yes

    &cssRowMe yes

    &cssRowAuthor yes

    defaults to author value for the current document.

    default to location of the included jot.css

    Subject for author notification email (v 1.1.3+)

    ,

    - .- =-

    - =

    - .

    - 0 = do nothing.

    " "

    - -- = -

    fieldname:a (for ascending) or fieldname:d (for- .

    - =- to validate an email field:

    .

    .

    - ,-

    *&placeholder*parameter)- .

    " "published by default when *&moderated* is set 1.

    ..

    .

    =when someone posts a

  • 8/14/2019 MODx Cheat Sheet

    31/47

    rametersdescriptionTemplate (HTML) for user form.

    CSS style classname for alternate row.

    CSS style classname for current user row.

    CSS style classname for author row.

    .

    templates gets included once

    templates gets included twice (top

    templates gets included once

  • 8/14/2019 MODx Cheat Sheet

    32/47

  • 8/14/2019 MODx Cheat Sheet

    33/47

  • 8/14/2019 MODx Cheat Sheet

    34/47

    . .WebLoginPE documentation s/wlpedocs/index.html

  • 8/14/2019 MODx Cheat Sheet

    35/47

    ormRequired 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)

  • 8/14/2019 MODx Cheat Sheet

    36/47

    Description

    Name to display as sender of the auto-respond message.

    Set to 1 to allow user to enter html tags. Defaults to 0

    email to display as sender of the auto-respond message e.g. [email protected]

    Same as &emailbut for Bcc:

    Same as &emailbut for Cc:

    Sets the email address to appear in the From section of the emailSets the name of the sender in the From section of the email

    document id to load after sending message. See also &thankyou

    .=` ` =` ` =` ` =` `.

    =" " =" " =" ", .

    Tags: Same as for &tplplus [+fieldname+], where fieldname stands for the name of each form

    . . . - _ , --

    .

    .'

    [!eForm &cssStyle=`http://mysite.com/assets/styles/forms.css` ... !]

    .

    . .

    .

    . .

    .

    , .

    .

    . . . . .

    .=` `

    md5 hash from these key fields. Which fields are compared depends on the value of

    This can be used to insert functions as an alternative to declaring a separate snippet in the

    messages as html, &sendAsHTML=`report,autotext,mobile`- send specified messages as

    messages as text only, &sendAsText=`report,autotext,mobile`- send specified messages as

    save version 1.4.4 in the 'assets/snippets/eform/1.4.4' folder and set. . . . . . .

    . ,

    -

    .

    and just before all placeholders are merged. The function should accomodate the following. -

    ' ' ' ' ' 'and before the report and thankyou templates have been parsed and any emails have been

    .

  • 8/14/2019 MODx Cheat Sheet

    37/47

  • 8/14/2019 MODx Cheat Sheet

    38/47

  • 8/14/2019 MODx Cheat Sheet

    39/47

    an u ns sn e s a aren ns a eName DescriptionHide Editor

    DocInfo

    Customize Manager fields

    ManagerManager

    GetChunkTemplate

    Inherit Selected Template

    CurrDocOut

    getField

    GoogleEvents

    Tableau

    FileDownloadPE

    File Details

    phpThumb Package

    Possibly handy plugins/snippetAutomatic Template

    -

    "Pagetitle"(default), "alias", "longtitle" and etc. very convenient

    manager. Can change, hide, or inherit based on specific,

    original plugin) However, selecting a template in the parent,

    as a list and or in a Calendar. Supposedly can even mash, .

    hides the actual path to your file. FileDownloadPE keeps trackExtended

    settings tags. The recursive parser allows for nested tags.

    for your documents. Stop teaching your client what a template

  • 8/14/2019 MODx Cheat Sheet

    40/47

    e auDirect Link Possible use

    . - -

    . -

    . -- -.

    - .-

    ,. -

    - -

    .

    . -

    . -

    . -- . -

    .- . . .

    . -

    . -- -

    .

    . -

  • 8/14/2019 MODx Cheat Sheet

    41/47

  • 8/14/2019 MODx Cheat Sheet

    42/47

    Code$modx->getTemplateVar('TVName')

    $modx->documentObject['documentfield/TVname'] )

    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()

    $TVarray = $modx->getTemplateVarOutput(array('TV

  • 8/14/2019 MODx Cheat Sheet

    43/47

    Descri tionGet'st the value of a template variable for current document

    Returns the full table name based on db settings.

    Description

    mixed query(String $sql)

    boolean update(String $fields, String $table, String $where)

    Get's the value of a document field (e.g. 'created' on or

    Calling TVs in a snippet

    mixed makeArray(Array $rs )

    string prepareDate(integer $timestamp, string $fieldType =

    resource select([string $fields [, string $from [, string $where [,

  • 8/14/2019 MODx Cheat Sheet

    44/47

    exam le Link

    $table = $modx->getFullTableName( 'web_user_attributes' );

    example link

    http://wiki.modxcms.

    function show_members() {

    http://wiki.modxcms.function getEvents( $date ) {

    $output = '';

    http://wiki.modxcms.

    $res = $modx->db->select("id", $table_prefix.".modx_web_users",

    function update_username( $id, $username ) {

    http://wiki.modxcms.

  • 8/14/2019 MODx Cheat Sheet

    45/47

    Miscellaneous snippetName

    formatdate snippet

    includeDocContent

    loginRedirect

  • 8/14/2019 MODx Cheat Sheet

    46/47

    s, and or template hacks etc.Code, hack, etc.

  • 8/14/2019 MODx Cheat Sheet

    47/47

    Description

    This code was written to format the date the same

    This code will take the content and longtitle from

    Snippet to redirect any logged in user to another

    page. Be sure to call it uncached [!loginRedirect!]