I trying to build a snippet to show the children of a document as houses for rent. I am a php beginner(currently studying functions in class) and so ive never worked with an APT. So please bare with me if i sound retarded. How do I access the child images and content to make something like the picture below appear on the parent. How do i access the database part... im sure ill be fine once i can form an array with the info... but getting the info from the modx is whats getting me. Or is it ok to connect to the databse directly and build my SQL queries directly?
my drawing is gpl hahah
Also im a bit confused they api documentation will list getRecordCount(); but when i look at other people example i see $modx->db->getRecordCount();
Why was $modx->db-> added?
So does that mean that I would use it as such...
$int_total_children = $modx->db->getRecordCount($numlist);
sorry for all the questions...
Why not using Ditto for that?
I would recommend using Ditto as well, that is exactly what it is for.
And to answer your question you always need to add $modx-> to use an api function (that is how you identify that it is part of the $modx object). In the example above you are calling the db api and using the getRecordCount() function.
The api documentation in the documentation is well supplemented with the documentation in the wiki, but there are several missing links and sometimes looking at how someone else used it is the only way to understand it.
Thanks for the response guys, Ditto would make that easy... i just want to practice my php/snippet creation a bit and it seemed like it wouldn’t be that hard.