Hello,
I’m pretty new to modx.
But I tried to get used to the api and coding snippets.
I looked through some snippet code and I found it really interesting that a lot of developer rather use sql-statement than the modxapi.
My understanding is that if you use a cms/framework always try to call the core function that already there, before create new ways of doing thinks.
Can someone help me with this ?
Example:
getting document data with a special id.
$sql = "SELECT "
.$site_content.".id"
.",".$site_content.".pagetitle"
.",".$site_content.".longtitle"
.",".$site_content.".menutitle"
.",".$site_content.".description"
.",".$site_content.".menuindex"
." FROM "
.$site_content
." WHERE"
." (".$parentWhere_str.")"
." ORDER BY ".$site_content.".menuindex"
." ASC";
$rs = $modx->dbQuery($sql);
$rs_count = $modx->recordCount($rs);
kalendar snippet code
VS
(...)
$content = $modx->getDocument(1,'pagetitle...','1');
(...)
matic