Answer the question
In order to leave comments, you need to log in
Do you need to form and write one condition correctly?
Hello.
There is a forum with two main categories and many subcategories. All this is displayed on one page. And it turns out a big sheet.
Here is the original code:
{foreach from=$aForums item=oForum}
{if $oForum->getAllowShow()}
{assign var='aSubForums' value=$oForum->getChildren()}
<section class="forums-list category-block toggle-section" id="category-{$oForum->getId()}">
<header class="forums-header well well-sm">
<i class="js-forum-cat-toggler"></i>
<h2><a href="{$oForum->getUrlFull()}" title="{$oForum->getTitle()}"><i class="fa fa-folder fa-lg"></i> {$oForum->getTitle()}</a></h2>
</header>
<div class="forums-content well">
{include file="$sTemplatePathForum/forums_list.tpl" aForums=$aSubForums}
</div>
<div class="forums-note clearfix" style="display:none;">
<div class="fl-r">
<strong>{$oForum->getCountTopic()|number_format:0:'.':$oConfig->Get('plugin.forum.number_format')}</strong> {$oForum->getCountTopic()|declension:$aLang.plugin.forum.topics_declension:'russian'|lower}
<span>|</span>
<strong>{$oForum->getCountPost()|number_format:0:'.':$oConfig->Get('plugin.forum.number_format')}</strong> {$oForum->getCountPost()|declension:$aLang.plugin.forum.posts_declension:'russian'|lower}
</div>
</div>
</section>
{/if}
{/foreach}
<ul class="nav nav-tabs" id="cat-tab">
<li class="active"><a href="#category-13" data-toggle="tab">форум_1</a></li>
<li class=""><a href="#category-11" data-toggle="tab">-форум_2</a></li>
</ul>
<div class="tab-content">
{foreach from=$aForums item=oForum}
{if $oForum->getAllowShow()}
{assign var='aSubForums' value=$oForum->getChildren()}
<div class="tab-pane forums-list toggle-section" id="category-{$oForum->getId()}">
<header class="forums-header well well-sm">
<i class="js-forum-cat-toggler"></i>
<h2><a href="{$oForum->getUrlFull()}" title="{$oForum->getTitle()}"><i class="fa fa-folder fa-lg"></i> {$oForum->getTitle()}</a></h2>
</header>
<div class="forums-content well">
{include file="$sTemplatePathForum/forums_list.tpl" aForums=$aSubForums}
</div>
<div class="forums-note clearfix" style="display:none;">
<div class="fl-r">
<strong>{$oForum->getCountTopic()|number_format:0:'.':$oConfig->Get('plugin.forum.number_format')}</strong> {$oForum->getCountTopic()|declension:$aLang.plugin.forum.topics_declension:'russian'|lower}
<span>|</span>
<strong>{$oForum->getCountPost()|number_format:0:'.':$oConfig->Get('plugin.forum.number_format')}</strong> {$oForum->getCountPost()|declension:$aLang.plugin.forum.posts_declension:'russian'|lower}
</div>
</div>
</div>
{/if}
{/foreach}
</div>
<div class="tab-pane forums-list toggle-section active" id="category-{$oForum->getId()}">
Answer the question
In order to leave comments, you need to log in
I don't know maybe govnokod. But it is possible, for example
if($_GET['do'] == '1' ){
echo 'ваш текст1';
} else {
echo 'ваш текст2';
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question