Re: [ITX] Again

From: Date: Tue, 25 Jun 2002 16:34:25 +0000
Subject: Re: [ITX] Again
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-1756@lists.php.net to get a copy of this message
le 25/06/02 18:21, Tim Glen à tim@javelindigital.com a écrit : > On 6/25/02 10:09 AM, "Bertrand Mansion" <bmansion@mamasam.com> wrote: > >> le 25/06/02 17:52, Tim Glen à tim@javelindigital.com a écrit : >> >> ITX works fine as far as I know. >> The problem is probably in your code and we can't help if we don't know what >> you are doing. ITX has not been released yet because its maintainer is too >> lazy to do it :-p (or probably too busy...) > > Bertrand, > > Here is a clipping of the code I am working with. I'm honestly not sure if > I'm going in the right direction at all, although it seems close. If you > don't want to or can't help me, please feel free to say so. > > // SET UP TEMPLATE > $tpl = new IntegratedTemplateExtension('templates/'); > $tpl->loadTemplateFile('main.tpl'); > > $template_containers = array('MAIN_CONTENT'=>''); > $content_info = $page->getPageContent($page_id); > foreach ($content_info as $val) { > // load the info object, get the content, check for template usage > // and load it into the appropriate template > $io = InputOutput::factory($val['object']); > $res = $io->getObjectTemplates($io->getObjectID()); > $row = $res->fetchRow(); > $res->free; > $template_filename = $row['template_filename']; > $template_container = $row['template_container']; > $res = $io->getVersions($val['id']); > $row = $res->fetchRow(); > $current_block = (!$current_block)?$template_container:$current_block; > $tpl->addBlockFile($current_block, $template_container, > $template_filename); > $current_block = $template_container; > foreach ($io->fields as $field=>$attributes) { > $tpl->setVariable(strtoupper($field), $row[$field]); > } > $tpl->parseCurrentBlock(); > } > > $tpl->show(); > > You can view the results at: > > <http://cmsdev.javelindigital.com/simplenet/includes/cms/template.php?page_i > d=6> (watch the wrap) > > If you don't have any time to help me or if you want simpler code to look > at, then please just let me know. Anything you can do to help is greatly > appreciated, however. Can you try with a setCurrentBlock(xxx), before the parseCurrentBlock() in your code and tell me how it goes. (xxx will probably be $template_container). Bertrand Mansion Mamasam

« previous php.pear.general (#1756) next »