<![CDATA[ How do I get a documentObject by id? - My Forums]]> https://forums.modx.com/thread/?thread=19737 <![CDATA[Re: How do I get a documentObject by id?]]> https://forums.modx.com/thread/19737/how-do-i-get-a-documentobject-by-id#dis-post-109867 ZAP Aug 20, 2006, 10:48 PM https://forums.modx.com/thread/19737/how-do-i-get-a-documentobject-by-id#dis-post-109867 <![CDATA[Re: How do I get a documentObject by id?]]> https://forums.modx.com/thread/19737/how-do-i-get-a-documentobject-by-id#dis-post-109866 But - as always - I understand your explanation and that my confusion could have be avoided.
Not by the documentation - but by me myself & I.
Sorry!]]>
silent Aug 18, 2006, 02:18 PM https://forums.modx.com/thread/19737/how-do-i-get-a-documentobject-by-id#dis-post-109866
<![CDATA[Re: How do I get a documentObject by id?]]> https://forums.modx.com/thread/19737/how-do-i-get-a-documentobject-by-id#dis-post-109865 Quote from: silent at Aug 18, 2006, 06:55 PM

Strangely enough I never was aware of this distinction!
No one ever told me that I could access a doc’s content without an Id!
For me there was always one and the same starting point:
$cid = $modx->documentIdentifier; //current document

For the rest I always used "$cid" as a param - as indicated in the documentation.
Seems I’ve made it more difficult than necessary??
I’m not following what distinction you mean. $modx->getDocument($id) gets a specific documents fields, while the $modx->documentIdentifier is the current document ID, and $modx->documentObject holds the current documents attributes + TV values. $modx->getDocument($id) does not retrieve TV’s that are part of the document or anything but the fields you specify from that document’s site_content table row.]]>
opengeek Aug 18, 2006, 02:13 PM https://forums.modx.com/thread/19737/how-do-i-get-a-documentobject-by-id#dis-post-109865
<![CDATA[Re: How do I get a documentObject by id?]]> https://forums.modx.com/thread/19737/how-do-i-get-a-documentobject-by-id#dis-post-109864 No one ever told me that I could access a doc’s content without an Id!
For me there was always one and the same starting point:
$cid = $modx->documentIdentifier; //current document

For the rest I always used "$cid" as a param - as indicated in the documentation.
Seems I’ve made it more difficult than necessary??
]]>
silent Aug 18, 2006, 01:55 PM https://forums.modx.com/thread/19737/how-do-i-get-a-documentobject-by-id#dis-post-109864
<![CDATA[Re: How do I get a documentObject by id?]]> https://forums.modx.com/thread/19737/how-do-i-get-a-documentobject-by-id#dis-post-109863
And yes, we need a proper and up to date API reference...]]>
matthewchng Aug 18, 2006, 01:31 PM https://forums.modx.com/thread/19737/how-do-i-get-a-documentobject-by-id#dis-post-109863
<![CDATA[Re: How do I get a documentObject by id?]]> https://forums.modx.com/thread/19737/how-do-i-get-a-documentobject-by-id#dis-post-109862 opengeek Aug 18, 2006, 01:06 PM https://forums.modx.com/thread/19737/how-do-i-get-a-documentobject-by-id#dis-post-109862 <![CDATA[How do I get a documentObject by id?]]> https://forums.modx.com/thread/19737/how-do-i-get-a-documentobject-by-id#dis-post-109861
I want to get hold of another document’s introtext and to navigate there, I’d use it’s id. However, I can’t find any function in the API Quick Reference (Which sadly is the only source of reference for me and it’s a little sparse) that will do this job...

I know I can get the current doc’s stuff. What about getting another doc’s stuff via it’s id? Is that possible?

Thanks]]>
matthewchng Aug 18, 2006, 12:47 PM https://forums.modx.com/thread/19737/how-do-i-get-a-documentobject-by-id#dis-post-109861