Hi guys,
I’am trying to create a new module. Now i’am trying to print something out let me show you in code:
This is my template tags:
{exp:weblog:entries weblog="default_site"}
{exp:select_blog field="{myext}"}
{select_weblog}
{/exp:select_blog}
{/exp:weblog:entries}
Below is the function that processes it. When i output $weblogname it displays the result as expected. But the template does not display the name as i would expect.What am i missing or doing wrong? Many thanks in advance!
class Select_blog {
function Select_blog()
{
global $TMPL, $DB, $SESS, $FNS;
$tagdata = '';
if($TMPL->fetch_param('field'))
{
$field = trim(strip_tags($TMPL->fetch_param('field')));
//var_dump($field);
$exploded = explode("|", $field);
$weblogname = $exploded[0];
$category = $exploded[1];
//$result = array("select_weblog" => $weblogname, "select_cat_id" => $category);
//var_dump($result);
//$tagdata .= $TMPL->tag_data;
/**
$cond['select_weblog'] = $weblogname;
$cond['select_cat_id'] = $category;
$tagdata = $FNS->prep_conditionals($tagdata, $cond);
*/
foreach ($TMPL->var_single as $key => $val)
{
switch ($key)
{
case "select_weblog":
$tagdata = $TMPL->swap_var_single($val, $weblogname, $tagdata);
break;
}
}
$this->return_data = $tagdata;
}
}
}
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.