如何在smarty中隐藏div或特定区域

时间:2013-10-07 19:21:58

标签: php smarty

亲爱的朋友,我有一个问题,我想在主页上的用户显示div

{if $smarty.server.QUERY_STRING == 'p=Home'}
<div class="dt_banner" style="float:left !important;">
  <div class="dt_content_wrap">
    <div class="dt_slider"> 
      <script src="images/jquery.cycle2.js"></script>
      <div class="cycle-slideshow" 
           data-cycle-timeout=5000
                    style="height: 318px; overflow: hidden; width: 675px;"> 
        <!-- empty element for overlay -->
        <div class="cycle-overlay custom" style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.5); color: #FFFFFF; font-size: 20px; margin-top: -269px; padding: 15px;  position: relative;  text-transform: uppercase; z-index: 9999;"></div>
        <img src="images/adv1.png" width="675px"> <img src="images/adv2.png" width="675px"> <img src="images/adv3.png" width="675px"> <img src="images/adv4.png" width="675px"> <img src="images/adv5.png" width="675px"> <img src="images/adv6.png" width="675px"> <img src="images/adv7.png" width="675px"> <img src="images/adv8.png" width="675px"> <img src="images/adv9.png" width="675px"> </div>
    </div>
    <div class="dt_vdo_box">
      <iframe width="350" height="295" src="//www.youtube.com/embed/LlHrvr5eYhM?rel=0" frameborder="0" allowfullscreen></iframe>
    </div>
  </div>
</div>
{/if} <br clear="all">

1 个答案:

答案 0 :(得分:0)

也许这样的东西而不是你的第一个if行?

{if $smarty.request.p == 'Home'}