My module is almost working as I planned but I'm facing one unsolved problem.
I have a php file pointing to a template :
Code: Select all
<?php
if( !defined('CMS_VERSION') ) exit;
$query = new CategoryQuery;
$categorys = $query->GetMatches();
$sql = 'SELECT SQL_CALC_FOUND_ROWS H.* FROM '.CMS_DB_PREFIX.'mod_msfaq_questions H WHERE category = "'.$params['cname'].'" ORDER BY question';
$arr = $db->GetArray($sql);
$tpl = $smarty->CreateTemplate($this->GetTemplateResource('default.tpl'),null,null,$smarty);
$tpl->assign('questions',$arr);
$tpl->assign('categorys',$categorys);
$tpl->display();
?>
Code: Select all
<div class="msfaq_wrapper">
template
<div id="categoryBlock">
{foreach $categorys as $category}
<div class="category">
<div class="row">
<div class="categoryline"><a href="{cms_action_url action='default' cname=$category->category_name}">{$category->category_name}</a>
</div>
</div>
</div>
{foreachelse}
<div class=”noquestions”>{$mod->Lang('noquestion')}</div>
{/foreach}
</div>
<div id="questionAnswerBlock">
{foreach from=$questions item=value}
<div class="questionAnswer">
<div class="question">{$value.question}</div>
<div class="answer">{$value.answer}</div>
</div>
{/foreach}
</div>
</div>
Now when I click on the
Code: Select all
<div class="categoryline"><a href="{cms_action_url action='default' cname=$category->category_name}">{$category->category_name}</a>
What code do I need to put in the php file or template to replace the module tag and not create a new section?
Please help.
TIA