WebTechKitchen; Your Web Technology Kitchen, contact us to create, or maintain your websites and other digital properties.

conditionally run code on page.tpl.php

Submitted by barnettech on Thu, 12/10/2009 - 21:23

I use the following code to conditionally show pieces of the page depending on which page the user is on:


$curr_uri = check_plain(request_uri());
//print $curr_uri;
<?php if ((!preg_match("/contact/i", $curr_uri))&&(!preg_match("/authentication-options/i", $curr_uri))&&(!preg_match("/node\/305/i", $curr_uri))) : ?>
conditional html code here
<?php or php code here to be conditionally shown?>
<?php endif; ?>