snipt

Ctrl+h for KB shortcuts

PHP

Drupal detect front page

1
2
3
4
5
If($is_front){
  // do something;
} else {
  // do something;
}
https://snipt.net/embed/96a770c28a13671f40b0827621e8d608/
/raw/96a770c28a13671f40b0827621e8d608/
96a770c28a13671f40b0827621e8d608
php
PHP
5
2019-06-27T06:16:20
True
False
False
/api/public/snipt/27488/
drupal-detect-front-page
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="x">If($is_front){</span> </span><span id="L-2"><a name="L-2"></a><span class="x"> // do something;</span> </span><span id="L-3"><a name="L-3"></a><span class="x">} else {</span> </span><span id="L-4"><a name="L-4"></a><span class="x"> // do something;</span> </span><span id="L-5"><a name="L-5"></a><span class="x">}</span> </span></pre></div> </td></tr></table>
drupal6