Installation and configuration documentation modxTalks
Installation installation, settings and examples
Before installation
Tech skills
However modxTalks is not for the nerds you need to have some basic MODX knowledges:
System requirements
ModxTalks requires:
- MODX version
- MODX Revolution 2.2.6+
- jQuery version
- jQuery lib 1.7+
Download
In MODX manager use Package Management to download package from repository (search "modxTalks") and install it.
Source code can be found on github.com
Set modxTalks on your site
You can set modxTalks on your site in 2 ways.
- Create resource with comments
- To create resource with comments - right click on resouce in the resource tree and then "Create":
- Insert snippet in any place in your site
- You can call modxTalks in any place you like
[[!modxTalks]]
Be asured that snippet call is uncached
Settings modxTalks basic settings
Basic Settings
modxTalks settings can be found in System Settings, in "modxtalks" folder.
All hints are described in comments for each setting.
Name | Key | Defaults | Description |
---|---|---|---|
Setting BBCode | |||
Set BBCode | modxtalks.bbcode |
Yes |
Set on BBCode editor in comments? Yes/No |
Links | modxtalks.detectUrls |
No |
Detect links on the page and wrap them into <a> tags? Yes/No |
Tags editor | modxtalks.editOptionsControls |
fixed, image, link, strike, header, italic, bold, video, quote | Choose control tags for editor. Available - fixed, image, link, strike, header, italic, bold, video, quote |
Smiles | modxtalks.smileys |
Нет |
Enable smileys in comments? Yes/No |
General Settings | |||
Reverse | modxtalks.revers |
Нет |
Displaying Comments top new ones if select NO, the new comments are below. |
Timeout between sending comments | modxtalks.add_timeout |
60 |
The time in seconds between sending comments |
AJAX update of comments | modxtalks.ajax |
Да |
Enable realtime update of comments from server? Yes/No |
Comment length | modxtalks.commentLength |
2000 | Max length of comments (in symbols). |
Comments per page | modxtalks.commentsPerPage |
20 | Max number of comments on page for pagination. |
Date format | modxtalks.dateFormat |
j-m-Y, G:i | Date format displayed in a comment. |
Default avatar | modxtalks.defaultAvatar |
Full link to avatar which appeared when Gravatar is disabled or doesn`t exist. | |
Time for editing | modxtalks.edit_time |
180 | Time after which user can`t edit his comment. |
Use gravatar | modxtalks.gravatar |
Yes |
Enable gravatar image in user messages. Yes/No |
Gravatar size | modxtalks.gravatarSize |
64 | Gravatar size in the comment. |
Enable jQuery | modxtalks.jquery |
Yes |
If you are using jQuery Lib on your page choose NO, but make sure your version of jQuery is 1.7+ |
Group moderators | modxtalks.moderator |
Administrator | Moderator groups separated by commas. |
Only authorised users | modxtalks.onlyAuthUsers |
No |
Comments can be left only by authorised users. |
Comments premoderation | modxtalks.preModarateComments |
Yes |
If YES then comments are premoderated. After approval comment will appear on the site. |
Scrubber offset | modxtalks.scrubberOffsetTop |
0 | Scrubber offset from top position when scrolling. This is needed when you have elements with fixed postion, e.g. menu. |
Scrubber position | modxtalks.scrubberTop |
No |
Displaying scrubber in top position of the comment. By defaults NO - right column. |
Vote for comment | modxtalks.voting |
No |
Select Yes if you want to add a vote for comments. |
Code highlight | |||
Code highlight | modxtalks.highlight |
Yes |
Enable code highlight in the comments? Yes/No |
Highlight theme | modxtalks.highlighttheme |
GitHub | Hightlight theme for code. More details here. Available themes: Default, Dark, FAR, IDEA, Sunburst, Zenburn, Visual Studio, Ascetic, Magula, GitHub, Google Code, Brown Paper, School Book, IR Black, Solarized-Dark, Solarized-Light, Arta, Monokai, XCode, Pojoaque, Rainbow, Tomorrow, Tomorrow Night, Tomorrow Night Bright, Tomorrow Night Blue, Tomorrow Night Eighties |
Email notifications | |||
modxtalks.emailsFrom | modxtalks.emailsFrom |
Email for sender of message. | |
modxtalks.emailsReplyTo | modxtalks.emailsReplyTo |
Email for answer |
Resource Settings Set modxTalks in resource
Set modxTalks in the resource
After resource with comments creation you'll have tab with comments settings

- 1
- number of unapproved comments for the resource
- 2
- number of deleted comments for the resource
- 3
- general number of comments for the resource
- 4
- max number of comments on the page for listing (pagination)
- 5
- moderator group comma separated, which can moderate comments
- 6
- template for comments output. Leave blank for defaults
- 7
- template for output deleted comments. Leave blank for defaults
- 8
- template for output editable comments. Leave blank for defaults
- 9
- template for output authourization of comments. Leave blank for defaults
Call modxTalks as a snippet
You can make modxTalks call as a simple snippet call in any place you like [[!modxTalks]]
Basic parameters for snippet call:
Parameter | Type | Description |
---|---|---|
conversation |
(string) | Unique name for output block of the comments, defaults [[*class_key]]-[[*id]] |
add_timeout |
(numeric) | Time in seconds between sending comments. |
commentAddFormTpl |
(string) | Adding form template. |
commentAuthTpl |
(string) | Pattern registration form. Output is limited to authorized users, if the parameter is active onlyAuthUsers. |
commentEditFormTpl |
(string) | Editing form template. |
commentLength |
(numeric) | Max length of comment in symbols. |
commentTpl |
(string) | Comment template for output. |
commentsClosed |
(boolean) | Comments are closed for all users except moderators with granted permissions. Commenting is disabled |
commentsPerPage |
(numeric) | Max number of comments listed on the page |
dateFormat |
(string) | Date format in a comment. |
deletedCommentTpl |
(string) | Deleted comment template. |
edit_time |
(numeric) | Time during which user can update his comment. |
gravatar |
(boolean) | Set on gravatar in user comments. |
gravatarSize |
(numeric) | Size of a gravatar. |
moderator |
(string) | Comma-separated list of the moderator groups which have permissions to moderate the comments in the resource. |
onlyAuthUsers |
(boolean) | Comments can be made only by authorised users. |
Last Comments output unit of the latest comments
To display the latest comments on your site. sufficient to establish the call Snippets [[!modxTalksLatestComments]]
Parameters snippet // Parameters snippet modxTalksLatestComments
Parameter | Type | Description |
---|---|---|
commentLatestTpl |
(string) | Template separate comment for the block. Maybe chunk name. If the set value, it will replace the original template. |
commentsLatestOutTpl |
(string) | Shell pattern for the block comment. Maybe chunk name. If the set value, it will replace the original template. |
commentsLatestLimit |
(numeric) | Restrict the output of comments per page. |
Connection example scripts // on the page with the call of the latest comments
<script src="[[++assets_url]]components/modxtalks/js/web/lib/jquery-1.9.min.js" type="text/javascript"></script> <script src="[[++assets_url]]components/modxtalks/js/web/lib/timeago.js" type="text/javascript"></script> <script src="[[++assets_url]]components/modxtalks/js/web/lib/timeago/en.js" type="text/javascript"></script>
Custom templates setting and creation of the templates
You can make your own template, examples of available templates can be found on github.com
or in chunks/ folder in modxTalks installment: core/
components/modxtalks/elements/chunks
commentTpl // Comment row template
Parameter | Description |
---|---|
index |
data-index, returs date format 201301 year and month |
idx |
idx of the comment (unique in its thread) |
deleted |
CSS for deleted comment |
id |
id of the comment |
userId |
id of User in md5 |
hideAvatar |
CSS class which hide avatar if previous comment belongs to the same user |
avatar |
User avatar output |
name |
Username |
link |
Link to the comment |
date |
Date of comment, for example: 19-01-2013, 23:56 +0200 |
funny_date |
Comment publication date in fuzzydate format |
funny_edit_date |
Comment editing date in fuzzydate format |
edit_name |
Name of the User who has edited comment |
link_reply |
Link for the reply |
quote |
Name of the link for answer to the comment |
user |
Navigation output depending on the user Role |
content |
Comment content |
deletedCommentTpl // Template for deleted comment row
Parameter | Desciption |
---|---|
index |
data-index, return date in 201301 format, year and month |
idx |
idx of the comment (unique in its theme) |
id |
id comment |
name |
Username |
link |
Link to the comment |
date |
Date of the comment, for example: 19-01-2013, 23:56 +0200 |
funny_date |
Publication date of the comment in fuzzydate format |
delete_date |
Date of the comment deletion |
funny_delete_date |
Date of the comment deletion in fuzzydate format |
deleteUser |
Username who has deleted comment |
link_restore |
Link for restoration of the deleted comment |
commentAddFormTpl // Template for form for comment adding
Parameter | Description |
---|---|
link |
Link for page with comments |
avatar |
Returns user avatar |
controlsbb |
Panel instrument output for editing of the comments |
commentEditFormTpl // Template for form edit of the comment
Parameter | Description |
---|---|
link |
Link for page with the commments |
id |
Comment ID |
avatar |
Returns User avatar |
controlsbb |
Outputs panel of tools for comment editing |
content |
Comment content |
comment_auth_tpl // Authorization form template
Output template for anonimous users. You can create link to the authorizaiton page or authorization form.
mt_send_mail // Letter and notification template
You can change design or its elements as you want

Parameter | Description |
---|---|
title |
Title of the e-mail message |
avatar |
User avatar |
text |
Text of the message title |
content |
Message content |
date |
Comment date |
comment_latest // Template for a separate comment block.
Template separate comment for the block. Maybe chunk name. If the set value, it will replace the original template.
Parameter | Description |
---|---|
time |
Add a comment to UNIX timestamp format |
cid |
id comment |
avatar |
Conclusion pm |
name |
User name |
timeago |
Add a comment, example: 19-01-2013, 23:56 +0200 |
funny_date |
The date post a comment in the format fuzzydate |
total |
Comments to this topic |
link |
Comment Link |
content |
The first 200 characters of Contents Comments |
title |
Resource Name |
comments_latest_out // Shell pattern for blog comments.
Shell pattern for the block comment. Maybe chunk name. If the set value, it will replace the original template.
Parameter | Description |
---|---|
output |
Output of all comments |
System Events system events OnModxTalksCommentAfterAdd
Parameters
Event OnModxTalksCommentAfterAdd there is a call for adding a comment.
Parameter | Description |
---|---|
conversationId |
ID Thread |
idx |
Ordinal index comment |
userId |
User ID Add Comments |
time |
Time to create a comment in UNIX timestamp format |
date |
Date of the comment in the format YYYYMM (201301) |
editUserId |
User ID edit comments |
editTime |
While editing a comment |
deleteUserId |
User ID Delete comment |
deleteTime |
When you remove a comment |
hash |
Comment hash, md5 (text_commentary + Email_User_ID + themes) |
content |
The comment text |
username |
Name of the user added a comment (for guests) |
useremail |
Email user added a comment (for guests) |
ip |
IP address from which you have added a comment |
properties |
Additional properties in JSON comment |
Output to tape output to tape the number of comments on the resource
Probably one wonders on the withdrawal in the news for example, the number of comments on the resource.
Let's consider an example of the output of the resource through getPage or getResources. Open your Chunk O resource and fix it in place display of comment tag {%mtr_[[+id]]%}
Example chunk
For example chunk getResources.
... ... <div class="comments"><i class="icon-eye-open">comments {%mtr_[[+id]]%}</i></div> ... ...
[[!MtCount]]
, это активирует плагин для замены тугов на сущность.
If you call a snippet comments and have your own structure binding to the resource, the call shall consist of such-like the name you put in, or formed in the snippet call.
Calling a tag in this case is the following: {%mtc_myBlog-2%}
- myBlog-2, this is the very name conversation
[[!MtCount]]
.