Quote from: sottwell at Dec 11, 2007, 01:08 AM
If the ID you want is the ID of the document Ditto is processing, how about
$id = $modx->getPlaceholder['id']
This is the same as using [+id+] in the Ditto view template.
Hi sottwell
Thanks for the hint. I just tried this, but $modx->getPlaceholder[’id’] does not seem to return anything. I looked at the "getPlaceholder" Method inside the modx source and it seems to return a value from the "placeholders" Array. I created a snippet that simply dumps the contents of this array... when called inside a ditto template, i get some weird output:
[tt]
Array
(
[phx] => &_PHX_INTERNAL_&
[item[0]] => <strong><a href="blog/add-a-blog-entry.html" title="Add a Blog Entry">Add a Blog Entry</a></strong>
Add a Blog Entry
)
[/tt]
As you can see, the id is not in the list of placeholders and thus not accessible. Somehow the API Doc is misleading too, because it states "array" as return value.
It seems like you already gathered some experience using the getPlaceholder call. Could it be a PHx interference?
Regards -- roman