Hello,
Any reason this isn't outputting nothing?
template.php
Or this also:
some_component
template.php
This plugin is great, but to output the result is a pain....
-- Edit --
I've copied the exact same example you demonstrated on the first page, and still I get partial results. Using the "im_list_page_generator" component it outputs only the ring image. When I click it it leads to 404, because of lack of config.
While using "im_details_page_generator" component, nothing shows up.
I'm not using DynPages, I'm a newbie theme developer trying to embed some functions directly to my theme...
------ Edit 3 -------
Nevermind... Got it....!!
Well, after a whole afternoon got it working, my final code looks something like this (not styled or anything yet, but works):
template.php
I'm calling the PHP directly in template.php, not using components.
Any reason this isn't outputting nothing?
template.php
PHP Code:
<?php
$manager = new ImController();
ImCategory::setCategory('Corpo Jurídico');
ImModel::setPref('itemsperpage', 6);
ImModel::setPref('sortby', 'sequence');
$manager->runModelMethod('gen_register', array('foto', 'especialidade', 'minicurriculo'));
$foto = $manager->getModelValue('foto');
$especialidade = $manager->getModelValue('especialidade');
$minicurriculo = $manager->getModelValue('minicurriculo');
echo $foto;
echo $especialidade;
echo $minicurriculo;
?>
Or this also:
some_component
PHP Code:
<?php
$manager = new ImController();
ImCategory::setCategory('Corpo Jurídico');
ImModel::setPref('itemsperpage', 6);
ImModel::setPref('sortby', 'sequence');
$manager->runModelMethod('gen_register', array('foto', 'especialidade', 'minicurriculo', 'sequence'));
$items = $manager->getModelValue('items_ordered_struct');
$pagedata = $manager->getModelValue('pagedata');
$rowTpl = '
<div class="itemrow">
<p><img alt="" class="mypic" src="[[ foto ]]" /></p>
<p>[[ title ]]</p>
<p>[[ especialidade ]]</p>
<p>[[ minicurriculo ]]</p>
</div>
';
$wrapperTpl = '<div id="my_wrapper">[[ row_tpl ]][[ paginator ]]</div>';
$manager->tplRegister(array('row_tpl' => $rowTpl, 'wrapper_tpl' => $wrapperTpl));
$rows = '';
foreach($pagedata['itemkeys'] as $key)
{
// Renders placeholders in row template
$rows .= $manager->paint('row_tpl',
array('foto' => $items[$key]['foto'],
'title' => $items[$key]['title'],
'especialidade' => $items[$key]['especialidade'],
'minicurriculo' => $items[$key]['minicurriculo'],
)
);
}
?>
template.php
PHP Code:
<?php get_component('some_component'); ?>
This plugin is great, but to output the result is a pain....
-- Edit --
I've copied the exact same example you demonstrated on the first page, and still I get partial results. Using the "im_list_page_generator" component it outputs only the ring image. When I click it it leads to 404, because of lack of config.
While using "im_details_page_generator" component, nothing shows up.
I'm not using DynPages, I'm a newbie theme developer trying to embed some functions directly to my theme...
------ Edit 3 -------
Nevermind... Got it....!!
Well, after a whole afternoon got it working, my final code looks something like this (not styled or anything yet, but works):
template.php
PHP Code:
<?php
$manager = new ImController();
ImCategory::setCategory('Corpo Jurídico');
ImModel::setPref('itemsperpage', 10);
ImModel::setPref('sortby', 'sequence');
ImModel::setPref('page', 'item-manager-details-page');
$manager->runModelMethod('gen_register', array('foto', 'especialidade', 'minicurriculo'));
$items = $manager->getModelValue('items_ordered_struct');
$pagedata = $manager->getModelValue('pagedata');
if(!$manager->tplRegister(array('loop' =>
'<div class="im-resultwrap">'
.'<img alt="" src="[[ foto ]]" /> [[title]] [[especialidade]] [[minicurriculo]]'
.'</div>', 'frontendlist' => '<div id="manager">[[ loop ]][[ paginator ]]</div>')))
{
return;
}
$loop = '';
foreach($pagedata['itemkeys'] as $key)
{
$loop .= $manager->paint('loop', array(
'foto' => $items[$key]['foto'],
'especialidade' => $items[$key]['especialidade'],
'minicurriculo' => $items[$key]['minicurriculo'],
'title' => $items[$key]['title']
));
}
echo $manager->paint('frontendlist', array('loop' => $loop,
'paginator' => $manager->paginator(ImModel::getTplKit('paginator'))));
?>
I'm calling the PHP directly in template.php, not using components.