【问题标题】:Opencart Hide Div on Page Title - PHPOpencart 隐藏页面标题上的 Div - PHP
【发布时间】:2012-10-14 00:03:55
【问题描述】:
我有一个 opencart 类别页面,我试图为其隐藏标题 DIV。在所有类别和子猫中,(目前)只有一个是我想要隐藏的。
我使用的以下代码不起作用:
<?php if ($categories && $heading_title!="HEADING TITLE HERE") { ?>
<?php elseif : ?>
<div id="headerhide" style="width:800px;">
<h1><?php echo $heading_title; ?></h1>
</div>
<?php } ?>
<?php endif ?>
【问题讨论】:
标签:
php
html
hide
opencart
【解决方案1】:
<?php if ($categories && $heading_title!="HEADING TITLE HERE") { ?>
<?php }
else {
?>
<div id="headerhide" style="width:800px;">
<h1><?php echo $heading_title; ?></h1>
</div>
<?php } ?>
【解决方案2】:
<?php if ($categories && $heading_title!="HEADING TITLE HERE") { } else { ?>
<div id="headerhide" style="width:800px;">
<h1><?=$heading_title?></h1>
</div>
<?php } ?>
我的 OpenCart information.tpl 页面上有此设置:
<?
// If FAQs page or content show AJAX
// We check for case sensitive titles - the title is case sensitive
if($heading_title=="FAQs" || $heading_title=="Faqs") { ?>
<script type="text/javascript">
$(document).ready(function(){
// ETC
});
</script>
<?
// Not the FAQs page so do nothing
}
?>
【解决方案3】:
我最近制作了一个商业 vQmod,对你有用。它被称为Custom Templates,它允许您将其分配给任意数量的单独类别页面。它不仅适用于类别(制造商、产品和信息页面)。虽然一页可能有点矫枉过正,但如果您计划将来将其用于多页,我认为从长远来看会更好