Skip to content

Instantly share code, notes, and snippets.

@MKorostoff
Last active August 29, 2015 14:13
Show Gist options
  • Save MKorostoff/07774fd55cbd982d40ee to your computer and use it in GitHub Desktop.
Save MKorostoff/07774fd55cbd982d40ee to your computer and use it in GitHub Desktop.
<?php
/**
* Tell page.tpl.php whether or not to show the sticky player
*/
function olympics_degradation_states_preprocess_page(&$vars) {
$vars['disable_sticky_player'] = variable_get('disable_sticky_player', FALSE);
}
<?php
/**
* PHP template file
*/
?>
<header>
<?php if (!$disable_sticky_player): ?>
<div>
<iframe src="http://example.com/sticky-player-embed/12345"/>
</div>
<?php endif; ?>
<nav>
<ul class="main-nav">
<li><a href="#">Nav Item 1</a></li>
<li><a href="#">Nav Item 2</a></li>
<li><a href="#">Nav Item 3</a></li>
<li><a href="#">Nav Item 4</a></li>
<li><a href="#">Nav Item 5</a></li>
</ul>
</nav>
</header>
<!-- Final output show to the user -->
<header>
<nav>
<ul class="main-nav">
<li><a href="#">Nav Item 1</a></li>
<li><a href="#">Nav Item 2</a></li>
<li><a href="#">Nav Item 3</a></li>
<li><a href="#">Nav Item 4</a></li>
<li><a href="#">Nav Item 5</a></li>
</ul>
</nav>
</header>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment