Is there any function to render a modResource from the API?

I found some really old topics around this but nothing directly related. I am looking along the lines of a static site generator for simple sites, where a shared Modx instance is used as the “site creator”. I found the article talking about just using file_get_contents on each page URL, but that seems inefficient.

I tried using the process function ($resource->process()), but that didn’t seem to process snippets in the page.

I could probably find the process in the core files, and maybe it’s more complex than I am thinking. It seems like what I am looking for is the equivalent of getChunk but for a full resource.


There is not a function, but you can use a technique like that used in the renderResources extra that is available. The relevant code is viewable at

@opengeek Thanks for the quick reply. That should get me what I need. Much appreciated!