Odeclass, Thanks for coming back with another helping hand. I gave your second suggestion a try and got another error message, but that was probably because of a couple of lines I added to your code just to get something printed out. I realised that you can’t access the array that comes back from the query asking for something like resource[’id’]. Modx doesn’t seem to accept that.
Anyway, after a lot of agonised searching I came back to those three articles on writing PHP in Modx in the official documentation. From that it seemed that the following very short snippet might get me a resource id just from the alias:
$aliasv = 'rocio-villa-liebana';
$resource = $modx->getObject('modResource',array(
'alias' => $aliasv
));
echo $resource->get('id');
When I tried that now it worked. It looks very, very simple, which makes me feel that it might actually be possible for me to get to grips with Modx.
I think what would be really good for someone to highlight is what people need to learn (and where they can find the best educational material) to make the transition from messy old procedural PHP to the kind of stuff of which Modx is made. I’m guessing that understanding the principles of OOP might be one ’must’, so I have just ordered a book about that. But it is just a guess.