Friday, October 8, 2010

modx2 unable to right click Action

If you ever encounter problem right clicking on action box to create action for a namespace,
you may still do it manually by inserting a record in table "modx_actions"
  • create namespace in manager
  • insert record into modx_actions
    namespace=[namespace_name], parent: 0, controller: index, haslayout: 1
  • clear cache in manager
Tada, it will be there.

Modx2 accidental removed core Action

If you ever accidently removed the core Action ,
you may restore the file @
core/cache/mgr/actions.cache.php

Modx2 deployment

To transfer testing site to live site:

  • restore database to server
  • upload files to serveredit core/config/config.inc.php (many path setting)
  • server edit config.inc.php
  • server edit manager/config.inc.php
  • server edit connectors/config.inc.php
  • edit table modx_workspaces and set path field to core ,
    example: '/var/www/modx/core/'
  • for provisioner package: setting modx_system_settings.value of key "cookiefile" to temporary folder (if its not /tmp)
  • set chmod -R 777 to core
  • set chmod -R 777 to assets (create if not exists)
  • login manager, and clear cache (ignore the error of unable to locate action file)
If you have problem with packages, and accidently deleted the zip file, you may either download the package file manually, or delete the record in table "modx_transport_packages"

Newer version (2.1.3) doesnt need to edit manager, connectors config.inc.php.

First thing after done all above, login to manager, and clear cache.
But if you encounter unable to locate file ...manager/controllers/default/welcome.php
Try rerun setup

Useful links:

Thursday, October 7, 2010

Modx 2 how to output TV (template variable)

[[+tv.namehere]]

Make sure to have set:
&includeTVs=`1` in getResources snippet call

Example:
[[+tv.post_eventdate:strtotime:date=`%b %d, %Y`]]

Wednesday, September 29, 2010

Modx2 resourcegroup (documentgroup) with usergroup

In Modx1,
modx_web_groups.webuser=#userid
modx_webgroup_access.webgroup=modx_web_group.webgroup
modx_webgroup_access.documentgroup

In Modx2,
modx_member_groups.member=#userid
modx_access_resource_groups.principal_class='modUserGroup', principal=modx_member_groups.user_group
modx_access_resource_groups.target


principal: membergroup_names.id
target: modx_documentgroup_names.id / "web" / "manager"

Server CheckList

List of checklist on setup of any LAMP server:
  • timezone /etc/localtime
  • php timezone /etc/php5/apache2/php.ini, /etc/php5/cli/php.ini
  • checking the date after setting timezone
  • install/configure for rewrite for apache2, with Allowoveride all
  • install/configure GD2, xml, mbstring, pdo, pdo_mysql for php
  • configure PHP:
  • register_global=off, memory_limit=40mb+, magic_quote_qpc=off ,
  • file_uploads=1, upload_max_filesize=10Mb+, max_input_time=300+,
  • max_execution_time=60, post_max_size=15Mb+
  • display_errors=1, error_reporting=E_ALL, log_errors_max_len=10240

Monday, September 27, 2010

modx2 event

  • OnInitCulture
  • OnHandleRequest
  • OnWebPageInit
  • OnPageNotFound (if not found)
  • OnLoadWebPageCache
  • OnLoadWebDocument
  • OnParseDocument
  • OnWebPagePrerender
  • OnBeforeSaveWebPageCache
  • OnWebPageComplete