Answers.Body: <p>One option is to use .extra.tpl files to load the data you wish to display, rather than the block.  <a href="https://civicrm.stackexchange.com/a/21885/12">An explanation of the technique is here</a>.  This avoids having to worry about whether something that's in scope for CiviCRM isn't in scope for the PHP visibility block.</p>
  
  <p>Another is to check the value of the <code>$_REQUEST</code> or <code>$_POST</code> supervariables for some element that is specific to this page (e.g. I'm guessing the page ID is in there somewhere).  If so, you could test for the presence of that value.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-01T19:35:08.750Z
Answers.LastActivityDate: 2018-10-01T19:35:08.750Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>I can use this with PHP visibility feature to get a block to show on the Event Page.</p>
  
  <pre><code>&lt;?php
  $match = FALSE;
  if (current_path() == 'civicrm/event/register' &amp;&amp; isset($_GET['id']) &amp;&amp; $_GET['id'] == 74) { $match = TRUE; }
  return $match;
  ?&gt;
  </code></pre>
  
  <p>However, if they submit the first page and there is a validation error, they get sent back to the URL of: /civicrm/event/register and the visibility setting no longer works.</p>
  
  <p>Does anyone have a way to fix this?</p>
  
  <p>Drupal 7.x CiviCRM 5.5</p>
  
Tags: <civievent>
Title: Drupal Block on Specific CiviEvent Page (How to?)
ThreadText: # Drupal Block on Specific CiviEvent Page (How to?)
  
  (Asked by: username_0 on 2018-10-01)
  
  I can use this with PHP visibility feature to get a block to show on the Event Page.
  
  ```
  <?php
  $match = FALSE;
  if (current_path() == 'civicrm/event/register' && isset($_GET['id']) && $_GET['id'] == 74) { $match = TRUE; }
  return $match;
  ?>
  
  ```
  
  However, if they submit the first page and there is a validation error, they get sent back to the URL of: /civicrm/event/register and the visibility setting no longer works.
  
  Does anyone have a way to fix this?
  
  Drupal 7.x CiviCRM 5.5
  
  **Tags:** civievent
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-10-01. Score: 1 | Accepted answer
  
  One option is to use .extra.tpl files to load the data you wish to display, rather than the block. [An explanation of the technique is here](https://civicrm.stackexchange.com/a/21885/12). This avoids having to worry about whether something that's in scope for CiviCRM isn't in scope for the PHP visibility block.
  
  Another is to check the value of the `$_REQUEST` or `$_POST` supervariables for some element that is specific to this page (e.g. I'm guessing the page ID is in there somewhere). If so, you could test for the presence of that value.
  
  
  ---
  
  