MODx. Basic things
anyone will start to understand MODx will face with new terms. It's pretty simple to remember. And so you don't have to memorize that spell, we're going to celebrate here.
Also here we celebrate small moments that occasionally can look.
the
the Template – provides a General layout of the page structure and design. It also specifies the locations for output of dynamic content. For each document, you can choose your template.
the Settings (TV) – additional parameters that are connected to the template. Parameters can be of different types (text, link, file, date, number, etc.). Learn more about the types expect the following articles.
the chunk – a small template that can be used just to output some content (phone on all pages) and processing (template sent the letter eForm, a template directory, outputted Ditto, etc.). Thus, the view (presentation) is separated from the treatment site and easily managed.
the Snippet code for processing information. Analyze the received information (e.g., user message) and provide results (for example, sending a message by mail and show user a message about the result). Snippets form the menu (Wayfinder), deduce the list of articles with pagination (Ditto), building form (eForm). To use the output Chunks.
the Plugin – code that runs upon the occurrence of some event. For example, highlights the search words (Search Highlighting) at the transition from the search page. A lot of events, and considered worth a separate article.
the
To output dynamic data using special tags.
the
the [(site_name)] – the name of the website
the [(base_url)] or [(site_url)] site address (http://modx.ru)
the [(modx_charset)] – the encoding used.
the [^qt^] – database queries
the [^q^] database queries
the [^p^] – time for a PHP script
the [^t^] – the total time to generate the page
the [^s^] – the content source (database or cache)
the
the [*pagetitle*] the document title
the [*longtitle*] – advanced title of the document
the [*description*] – the description of the document
the [*introtext*] abstract of document
the [*content*] – the contents of the document
the [*alias*] – the alias of the document
the [*id*] is the ID (number) of the document
the [*pub_date*] – the publication date of dcoument
the [*unpub_date*] end date of publication
the [*createdby*] – the ID of the user who created the document
the [*createdon*] document creation date
the [*editedby*] – the ID of the user who edited the document
the [*editedon*] – the date you are editing the document
the [~ID~] – URL of the document
the
the [*type*] option (document, folder, or link)
the [*contentType*] – the content type (e.g. text/html)
the [*published*] any published document (1/0)
the [*parent*] number (ID) of the parent document
the [*isfolder*] – is the document folder (1/0)
the [*richtext*] – used when you edit a document visual editor
the [*template*] number (ID) template to use for a document
the [*menuindex*] – serial number of the display in menu
the [*searchable*] – the document to search (1/0)
the [*cacheable*] – if the document is Cached (1/0)
the [*deleted*] the Document is deleted (1/0)
the [*deletedby*] – the user ID of the deleted document
the [*menutitle*] – menu Title. If not used, then the title of the document
the [*donthit*] tracking the number of visits disabled (1/0)
the [*haskeywords*] – the Document contains a keyword (1/0)
the [*privateweb*] paper is part of a private group of custom documents (1/0)
the [*privatemgr*] paper is part of a private group of managerial documents (1/0)
the [*content_dispo*] – issue content (1 — show | 0 — for download)
the [*hidemenu*] the Document is not displayed in the menu (1/0)
the
the [*НазваниеПараметраTV*] – displays the value of the parameter in the document.
the {{Nazvanijami}} – returns the contents of the chunk.
the [[Nazvaniya]] – returns the result of the snippet. You can also pass the additional snippet options, listing them when you call — [[Nazvaniya? ¶meter1=`value1` ¶meter2=`value2` &параметрN=`значениеN`]
the [+Nathanaelgreene+] – found in chunks which are used for processing (Ditto, eForm, etc.). After processing instead inserted values. Thus, it is also like a mini-language, but for snippets.
the
1) actually there are two versions of the snippet call:
the [[Nazvaniya]] a cached call to the snippet
the [! Nazvaniya!] – non-cacheable call to the snippet
2) When using additional parameters in the snippet you need to make sure that the record is not split by a line break. If so, then the snippet will refuse to work.
the
All very harmoniously used with each other.
In templates you can use settings TV, snippets and chunks.
In chunks, you can call snippets, settings, TV, and other chunks.
In snippets you can invoke at all, but using PHP.
Ultimately you will return the final result of processing all the snippets/chunks/параметровTV.
the
This information is based everything else.
Article based on information from habrahabr.ru
Also here we celebrate small moments that occasionally can look.
the
Terminology
the Template – provides a General layout of the page structure and design. It also specifies the locations for output of dynamic content. For each document, you can choose your template.
the Settings (TV) – additional parameters that are connected to the template. Parameters can be of different types (text, link, file, date, number, etc.). Learn more about the types expect the following articles.
the chunk – a small template that can be used just to output some content (phone on all pages) and processing (template sent the letter eForm, a template directory, outputted Ditto, etc.). Thus, the view (presentation) is separated from the treatment site and easily managed.
the Snippet code for processing information. Analyze the received information (e.g., user message) and provide results (for example, sending a message by mail and show user a message about the result). Snippets form the menu (Wayfinder), deduce the list of articles with pagination (Ditto), building form (eForm). To use the output Chunks.
the Plugin – code that runs upon the occurrence of some event. For example, highlights the search words (Search Highlighting) at the transition from the search page. A lot of events, and considered worth a separate article.
the
tags
To output dynamic data using special tags.
the
System
the [(site_name)] – the name of the website
the [(base_url)] or [(site_url)] site address (http://modx.ru)
the [(modx_charset)] – the encoding used.
the [^qt^] – database queries
the [^q^] database queries
the [^p^] – time for a PHP script
the [^t^] – the total time to generate the page
the [^s^] – the content source (database or cache)
the
Standard
the [*pagetitle*] the document title
the [*longtitle*] – advanced title of the document
the [*description*] – the description of the document
the [*introtext*] abstract of document
the [*content*] – the contents of the document
the [*alias*] – the alias of the document
the [*id*] is the ID (number) of the document
the [*pub_date*] – the publication date of dcoument
the [*unpub_date*] end date of publication
the [*createdby*] – the ID of the user who created the document
the [*createdon*] document creation date
the [*editedby*] – the ID of the user who edited the document
the [*editedon*] – the date you are editing the document
the [~ID~] – URL of the document
the
Advanced
the [*type*] option (document, folder, or link)
the [*contentType*] – the content type (e.g. text/html)
the [*published*] any published document (1/0)
the [*parent*] number (ID) of the parent document
the [*isfolder*] – is the document folder (1/0)
the [*richtext*] – used when you edit a document visual editor
the [*template*] number (ID) template to use for a document
the [*menuindex*] – serial number of the display in menu
the [*searchable*] – the document to search (1/0)
the [*cacheable*] – if the document is Cached (1/0)
the [*deleted*] the Document is deleted (1/0)
the [*deletedby*] – the user ID of the deleted document
the [*menutitle*] – menu Title. If not used, then the title of the document
the [*donthit*] tracking the number of visits disabled (1/0)
the [*haskeywords*] – the Document contains a keyword (1/0)
the [*privateweb*] paper is part of a private group of custom documents (1/0)
the [*privatemgr*] paper is part of a private group of managerial documents (1/0)
the [*content_dispo*] – issue content (1 — show | 0 — for download)
the [*hidemenu*] the Document is not displayed in the menu (1/0)
the
Parameters TV, snippets and chunks
the [*НазваниеПараметраTV*] – displays the value of the parameter in the document.
the {{Nazvanijami}} – returns the contents of the chunk.
the [[Nazvaniya]] – returns the result of the snippet. You can also pass the additional snippet options, listing them when you call — [[Nazvaniya? ¶meter1=`value1` ¶meter2=`value2` &параметрN=`значениеN`]
the [+Nathanaelgreene+] – found in chunks which are used for processing (Ditto, eForm, etc.). After processing instead inserted values. Thus, it is also like a mini-language, but for snippets.
the
Nuances
1) actually there are two versions of the snippet call:
the [[Nazvaniya]] a cached call to the snippet
the [! Nazvaniya!] – non-cacheable call to the snippet
2) When using additional parameters in the snippet you need to make sure that the record is not split by a line break. If so, then the snippet will refuse to work.
the
Where to use
All very harmoniously used with each other.
In templates you can use settings TV, snippets and chunks.
In chunks, you can call snippets, settings, TV, and other chunks.
In snippets you can invoke at all, but using PHP.
Ultimately you will return the final result of processing all the snippets/chunks/параметровTV.
the
Example of template
<html>
<head>
<title>[(site_name)] | [*pagetitle*]</title>
<meta http-equiv="Content-Type" content="text/html; charset=[(modx_charset)]" />
<base href="[(site_url)]"></base>
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="[(site_url)][~11~]" />
</head>
<body>
<div id="header">
<h1><a id="logo" href="[~[(site_start)]~]" title="[(site_name)]" > [(site_name)]</a></h1>
<div id="ajaxmenu"> [[Wayfinder?startId=`0` &outerTpl=`mh.OuterTpl` &innerTpl=`mh.InnerTpl` &rowTpl=`mh.RowTpl` &innerRowTpl=`mh.InnerRowTpl` &firstClass=`first` &hereClass=`]] </div>
</div>
<h2>News:</h2>
[[Ditto? &startID=`2` &summarize=`2` &total=`20` &commentschunk=`Comments` &tpl=`nl_sidebar` &showarch=`0` &truncLen=`100` &truncSplit=`0`]]
<div id="content">
<h2>[*longtitle*]</h2>
[*#content*]
</div>
</body>
</html>
This information is based everything else.
Комментарии
Отправить комментарий