Wednesday, January 26, 2011

MODx 2 Context setup

When setting up a site to a context, be sure to set these setting in the context:
  • site_url - site url to the domain
  • filemanager_path - the file manager path for this context to upload images / media
  • site_start - the starting resource id as home / landing page
  • site_name - the Site name to be displayed in email and page title

Sunday, January 16, 2011

MODx 2 Adding ... to intro text summary

If you plan to add "..." to a intro text or content which is more than some # of characters,
you may use if condition within the chunk.

Example below will add ... to intro text:
[[+introtext:if=`[[+introtext:len]]`:gt=`200`:then=`[[+introtext:limit=`200`]] ...`:else=`[[+introtext]]`]]

Saturday, January 15, 2011

extjs Adding html to panel

After struggling to check why is my panel no reflecting,
i realised ive forgotten to call doLayout in the end.

To add a html to a extpanel,
Ext.getCmp("panelid").add( {
type: "panel",
html: "some html here"
});

Ext.getCmp("panelid").doLayout();


To remove all html content in a panel:
Ext.getCmp("panelid").removeAll();
//only works in 2.2.1 all later



Thursday, January 6, 2011

MAC /etc/hosts

MAC /etc/hosts is in /private/etc/hosts

Wednesday, January 5, 2011

MAC Finder alike windows explorer

I find it handy to show full path of the current folder at the application title bar.
here is how it can be done:

Tuesday, January 4, 2011

MAMP package and mysql sock

/tmp/mysql.sock was missing because its in /Application/MAMP/temp/mysql/mysql.sock

http://www.fischerlaender.net/web-20/mac-os-x-trouble-with-mamp-mysql

Monday, January 3, 2011

MODx loading other components lexicon

If you need some lexicon from another components from your snippet,
you may do so by running this in snippet:
$modx->lexicon->load("namespacename:filename");

Example:
$modx->lexicon->load("login:register");
//resolve to: core/components/login/lexicon/register.inc.php