我的问题是:
我有一些切换部分。此部分应根据单击的触发器显示动态内容。所以例如。点击“支持”,应该有一些联系信息/下载支持工具,点击“搜索” - 搜索框等。
我的问题是是否有可能只用一个模块位置来解决这个问题,或者每个触发器需要一个位置?
希望描述这个可以理解=)
任何帮助表示赞赏。
谢谢
亚历克斯
UPD:我将尝试用代码解释:
模块位置:
if ($this->countModules('pos-1')) :
$module = JModuleHelper::getModules( 'pos-1' );
foreach($modules as $m) : ?>
<section class="mod_%echo $m->title%">
<jdoc:include type="modules" name="pos-1" style="xhtml" />
</section>
endforeach;
endif;
和触发器:
if ($this->countModules('pos-1')) :
$module = JModuleHelper::getModules( 'pos-1' );
foreach($module as $m) :
<a class="btn-collapse collapsed" role="button" data-toggle="collapse" data-parent="#accordion"
href="#echo $m->title;" aria-expanded="true" aria-controls=" echo $m->title;">
<i class="fa fa-building-o"></i> <? echo $m->title; ?>
</a>
endforeach;
endif;
所以我在这个位置添加了两个 CustomHTML 模块。
结果:
<section ... class="mod_title1">
content mod_one
content mod_two
</section>
<section ... class="mod_title2">
content mod_one
content mod_two
</section>
<a ... href="#mod_title1" ...> mod_title1 </a>
<a ... href="#mod_title2" ...> mod_title2 </a>
并且应该是:
<section ... class="mod_title1">
content mod_one
</section>
<section ... class="mod_title2">
content mod_two
</section>
<a ... href="#mod_title1" ...> mod_title1 </a>
<a ... href="#mod_title2" ...> mod_title2 </a>
所以我认为只有一个职位是不可能的,应该有很多职位来解决。
如果我错了,请纠正我。
UPD2:我错了。这是可能的,但不仅可以通过模板 - 模块 chrome tempalte 也应该使用自己的函数进行扩展以正确呈现它。