Where in the MODx code are the [~id~] tags parsed? $modx->parseDocumentSource doesn’t seem to do it, and I searched through document.parser.class.inc.php and couldn’t find a regex that does it.
Any ideas? I’m writing a snippet that returns the content of a document and I need it to make sure these tags are parsed. Thanks!
Andy
-
☆ A M B ☆
- 24,524 Posts
you want $modx->makeUrl()
So I guess I have to parse the document content myself, looking for the tags and replacing with the output of makeURL? I.e. there is no MODx API function that does this?
Andy
-
☆ A M B ☆
- 24,524 Posts
Ah, ok then, it’s $modx->rewriteUrls($documentSource), line 873 of manager/includes/document.parser.inc.php. That’s not really supposed to be an external API, though, so I can’t promise its performance under different circumstances.
Thanks! I looked at the code and function looks simple enough in operation that it should work ok.
Andy
-
MODX Staff
- 12,272 Posts
No promises that non-public/external/whatever-the-proper-name-is functions will be there in future (read 097) releases though.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
I hope if it is replaced there will be an equivalent. Being able to return parsed document content from a snippet is very useful. Or perhaps there is another way I should be doing it?
Andy