Hi, people! Sorry for enter dialog w/o invitation, but I have the almost same problem:
here’s my code (external PHP file):
include_once('../manager/includes/config.inc.php');
include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php');
global $modx;
function generate_content($art){
global $modx;
$main_section_tpl=$modx->getChunk('main_section_tpl');
}
this code - is a part of parser of XML-file, $main_selection_tpl - is a variable, wich have to get a content of the chunk named main_section_tpl (with placeholders) for parsing in future.
content of the main_section_tpl is:
<table cellspacing="0" cellpadding="0" border="0" id="commons">
<tr>
<td rowspan="2"><a href="[big_image]" target="_blank"><img src="[image]"></a></td>
<td valign="top"><h3>[title]</h3></td>
</tr>
<tr><td>[description]</td></tr>
</table>
Note, that [big_image],[image],[title] and [description] is NOT MODx placeholders - but placeholders, wich I want to use with PHP-parser, part of wich you can see above. And everytime line
"$main_section_tpl=$modx->getChunk('main_section_tpl');" returns NULL...
Actually, that’s what I’m planning to do:
1. Load data from the XML file via PHP
2. Parse this data and create documents tree structure from the data scheme of xml file
3. fill documents with data, which will placed inside placeholders of the chunk wich showed above.
Any ideas? Thanks in advance!