title: php conditional statement not working in magento
body: <p>So I have an e-newsletter popup on my website so users can stay in contact and up to date with our happenings. I only want the popup to appear on the homepage and i've put together a simple shorthand conditional statement like so:</p>
  
  <pre><code>&lt;?php if(Mage::getSingleton('cms/page')-&gt;getPageId() == '2' &amp;&amp; Mage::app()-&gt;getFrontController()-&gt;getRequest()-&gt;getRouteName() == 'cms') : ?&gt;    
  
  &lt;div id="newsletter_sign_up" style="display:none;" &gt;
  
  &lt;div style="padding:20px;" &gt;
  &lt;form action="&lt;?php echo($this-&gt;getUrl('newsletter/subscriber/new')) ?&gt;" method="post" &gt;
    &lt;div class="fieldset"&gt;
  
      &lt;h1 style="color: #28ced7; text-align: left; font-family: Arial, Helvetica, sans-serif; font-size: 28px;"&gt;verbiage goes here&lt;/h1&gt;
  
      &lt;h2 class="legend" style="text-align:left; font-family: Arial, Helvetica, sans-serif; font-size: 13px;"&gt;verbiage goes here&lt;/h2&gt;
      &lt;!--end--&gt;
      &lt;ul class="form-list"&gt;
        &lt;li class="fields"&gt;
          &lt;div class="customer-name"&gt;
            &lt;div class="field name-firstname"&gt;
              &lt;label class="required" for="firstname" style="text-align:left;"&gt;&lt;em&gt;*&lt;/em&gt;First Name&lt;/label&gt;
              &lt;div class="input-box"&gt;
                &lt;input type="text" class="input-text required-entry" maxlength="255" title="First Name" value="" name="firstname" id="firstname" autocomplete="off"/&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="field name-lastname"&gt;
              &lt;label class="required" for="lastname" style="text-align:left;"&gt;&lt;em&gt;*&lt;/em&gt;Last Name&lt;/label&gt;
              &lt;div class="input-box"&gt;
                &lt;input type="text" class="input-text required-entry" maxlength="255" title="Last Name" value="" name="lastname" id="lastname" autocomplete="off"/&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/li&gt;
        &lt;li&gt;
          &lt;label class="required" for="email_address"  style="text-align:left;"&gt;&lt;em&gt;*&lt;/em&gt;Email Address&lt;/label&gt;
          &lt;div class="input-box"&gt;
  
            &lt;input type="text" class="input-text validate-email required-entry" title="Email Address" value="" id="email_address" name="email" autocomplete="off"/&gt;
  
        &lt;input class="pop_newsletter_source" name="source" type="hidden" value="3" /&gt;
  
          &lt;/div&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
    &lt;div class="buttons-set form-buttons"&gt;
      &lt;button onclick="pop_newsletter.submit(); return false;" title="Submit" class="button" type="submit" autocomplete="off" style="position: relative; right: 140px;"&gt;&lt;span&gt;&lt;span&gt;Submit&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;/div&gt;
    &lt;p class="required"&gt;* Required Fields&lt;/p&gt;
  
    &lt;h2 style="text-align: left; font-size: 10px;"&gt;Email Privacy Statement:&lt;/h2&gt;
    &lt;p style="font-family: Arial, Helvetica, sans-serif; font-size: 10px; text-align: left;"&gt;more verbiage&lt;/p&gt;
    &lt;!--//end--&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  
  &lt;/div&gt;
  
  &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>I've checked to verify that the page id is 2.</p>
  
  <pre><code>&lt;?php echo "&lt;pre&gt;"; print_r(Mage::getSingleton('cms/page')-&gt;getPageId()); echo "&lt;/pre&gt;"; ?&gt;
  </code></pre>
  
  <p>I can't figure out why it breaks... am i missing something blatantly obvious? Any help would be appreciated.</p>