I am converting a non-database driven site to EE. I used some simple PHP in the site to keep navigation current etc. I know that I could do this stuff in a more native EE way, but in the interest of converting this site quickly I was hoping to just use what I have. However, the PHP is not executing probably and I am getting errors. It worked perfectly outside of EE. These are the errors I am getting, followed by the code I am using:
A PHP Error was encountered
Severity: Notice Message: Undefined variable: section Filename: libraries/Functions.php(656) : eval()’d code Line Number: 8
This is the home page template I am using:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content=""/>
<meta name="keywords" content=""/>
{embed="includes/head"}
</head>
<body id="home">
<?php $thisPage=('home');?>
{embed="includes/header"}
<div id="wrapper">
<div id="content-container">
Omitted content for clarity
</div>
<!-- End Content Container -->
{embed="includes/footer"}
</div>
<!-- End Wrapper -->
{embed="includes/google"}
</body>
</html>Here are the embedded header file which is causing the errors:
<div id="header-container">
<div id="header">
<a href="/">/_assets/images/logo.png</a>
<ul id="nav">
<li><a href="/products/elevation-series-panelsclass=current">PRODUCTS</a></li>
<li><a href="/partners/class=current">PARTNERS</a></li>
<li><a href="/applications/class=current">APPLICATIONS</a></li>
<li><a href="/about-us/class=current">ABOUT US</a></li>
<li><a href="/media/class=current">MEDIA</a></li>
<li><a href="/contact/class=current">CONTACT</a></li>
</ul>
<!-- End Nav -->
<?php if ($thisPage=='home') : ?>
/_assets/images/home/home-header.png
/_assets/images/solar-panel.png
<div id="rotator">
/_assets/images/home/sub-header-1.png
/_assets/images/home/sub-header-2.png
/_assets/images/home/sub-header-3.png
</div>
<?php endif; ?>
</div>
<!-- End Header -->
</div>
<!-- End Header Container -->
<?php if ($section=='products') : ?>
<div id="sub-nav-container">
<ul id="sub-nav">
<li><a href="/products/elevation-series-panels/class=current">Sub Product</a></li>
</ul>
</div>
<?php endif; ?>
<!-- End Products -->
<?php if ($section=='partners') : ?>
<div id="sub-nav-container">
<ul id="sub-nav">
<li><a href="/partners/class=current">Authorized Partners</a></li>
<li><a href="/partners/become-a-partner/class=current">Become a Partner</a></li>
</ul>
</div>
<?php endif; ?>
<!-- End Partners -->
<?php if ($section=='applications') : ?>
<div id="sub-nav-container">
<ul id="sub-nav">
<li><a href="/applications/class=current">Applications</a></li>
</ul>
</div>
<?php endif; ?>
<!-- End Applications -->
<?php if ($section=='about-us') : ?>
<div id="sub-nav-container">
<ul id="sub-nav">
<li><a href="/about-us/class=current">Overview</a></li>
<li><a href="/about-us/investors/class=current">Investors</a></li>
<li><a href="#class=current">Careers</a></li>
<li><a href="/about-us/faq/class=current">FAQ</a></li>
</ul>
</div>
<?php endif; ?>
<!-- End About Us -->
<?php if ($section=='media') : ?>
<div id="sub-nav-container">
<ul id="sub-nav">
<li><a href="/media/class=current">Press</a></li>
</ul>
</div>
<?php endif; ?>
<!-- End Media -->
<?php if ($section=='contact') : ?>
<div id="sub-nav-container">
<ul id="sub-nav">
<li><a href="/contact/class=current">Contact</a></li>
</ul>
</div>
<?php endif; ?>
<!-- End Contact -->[Mod Edit: Moved to the Development and Programming forum]
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.