Dani, ran into a big issue with this!
Hi Dani,
The client just decided on which pictures that I Photoshopped go where, and I put in the code below, but it's not working as planned.
The problem is; while the home page is displaying its unique picture, ALL of the other pages, whether a category page, like Products_Results.php?Search=true&CategoryID=5, or a product page like Products_Detail.php?ProductID=205 or one that isn't associated with a category or product such as Support.php; are all exclusively showing the image listed first in the below code as CategoryID 1.
Here's what I put in for code:
<?php
$CategoryID = "1";
if($CategoryID == "1") {
$image = "Images/hkgirlndogbg.jpg";
}else if($CategoryID == "3") {
$image = "Images/2dogsandacatnewwysong.jpg";
}else if($CategoryID == "5") {
$image = "Images/storeMessage_bgboydog.jpg";
}else if($CategoryID == "7") {
$image = "Images/storeMessage_bgtruelove.jpg";
}else if($CategoryID == "9") {
$image = "Images/runningdogbg.jpg";
}else if($CategoryID == "13") {
$image = "Images/girlndogbg1.jpg";
}else if($CategoryID == "15") {
$image = "Images/hkgirlndogbg.jpg";
}else if($CategoryID == "16") {
$image = "Images/hkgirlndogbg.jpg";
}else if($CategoryID == "17") {
$image = "Images/girlndogbg1.jpg";
}else if($CategoryID == "18") {
$image = "Images/girlndogbg1.jpg";
}else if($CategoryID == "19") {
$image = "Images/2dogsandacatnewwysong.jpg";
}else if($CategoryID == "20") {
$image = "Images/2dogsandacatnewwysong.jpg";
}else if($CategoryID == "21") {
$image = "Images/storeMessage_bgboydog.jpg";
}else if($CategoryID == "22") {
$image = "Images/storeMessage_bgboydog.jpg";
}else if($CategoryID == "24") {
$image = "Images/storeMessage_bgtruelove.jpg";
}else if($CategoryID == "25") {
$image = "Images/runningdogbg.jpg";
}
?>
<div id="storeMessage" style="background-image:url(<?php echo $image; ?>)">
<h1>Your Store Message Goes Here!</h1>
</div>
- - - - - - - - -
Here's the source code for the support.php page off of Dreamweaver:
<div id="topNavigation">
<div id="searchBox">
<form id="searchForm" method="get" action="Products_Results.php" >
<input name="Search" type="submit" value="Search" id="Search" alt="Search" />
<input type="text" name="S_ProductName" id="S_ProductName" />
</form>
</div>
<?php require_once("CSSMenuWriter/cssmw_home/menu.php"); ?>
</div>
</div>
<?php
$CategoryID = "1";
if($CategoryID == "1") {
$image = "Images/hkgirlndogbg.jpg";
}else if($CategoryID == "3") {
$image = "Images/2dogsandacatnewwysong.jpg";
}else if($CategoryID == "5") {
$image = "Images/storeMessage_bgboydog.jpg";
}else if($CategoryID == "7") {
$image = "Images/storeMessage_bgtruelove.jpg";
}else if($CategoryID == "9") {
$image = "Images/runningdogbg.jpg";
}else if($CategoryID == "13") {
$image = "Images/girlndogbg1.jpg";
}else if($CategoryID == "15") {
$image = "Images/hkgirlndogbg.jpg";
}else if($CategoryID == "16") {
$image = "Images/hkgirlndogbg.jpg";
}else if($CategoryID == "17") {
$image = "Images/girlndogbg1.jpg";
}else if($CategoryID == "18") {
$image = "Images/girlndogbg1.jpg";
}else if($CategoryID == "19") {
$image = "Images/2dogsandacatnewwysong.jpg";
}else if($CategoryID == "20") {
$image = "Images/2dogsandacatnewwysong.jpg";
}else if($CategoryID == "21") {
$image = "Images/storeMessage_bgboydog.jpg";
}else if($CategoryID == "22") {
$image = "Images/storeMessage_bgboydog.jpg";
}else if($CategoryID == "24") {
$image = "Images/storeMessage_bgtruelove.jpg";
}else if($CategoryID == "25") {
$image = "Images/runningdogbg.jpg";
}
?>
<div id="storeMessage2" style="background-image:url(<?php echo $image; ?>)">
<h1><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<h1><span class="style8"><br />
<br />
<br />
<span class="style16"> <span class="style20">The Natural Path to Better Pet Health</span></span></span></h1></h1>
</div>
- - - - - - - - -
And here is the source code for the Support.php page off the browser view:
</div>
</div>
<div id="storeMessage2" style="background-image:url(Images/hkgirlndogbg.jpg)">
<h1><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<h1><span class="style8"><br />
<br />
<br />
<span class="style16"> <span class="style20">The Natural Path to Better Pet Health</span></span></span></h1></h1>
</div>
- - - - - - - -
The code on the browser looks the same as above for Products_Results.php?Search=true&CategoryID=5 and all the others.
You'll note it says storeMessage2... I made that so that the home page would use it's picture and all the others would display a different one, (that was before the vendor idea and worked well)
But now... I don't know what to do... it's obviously not recognizing the CategryIDs... should I use ProductIDs (There are 80!)? But then what about pages like the About and Support, which should show the home page pic...?
Is there a clever way to write this all into the PHP using the "else if" command so it responds properly, hopefully using only one storeMessage type? Should I release About and Support and the other non-vendor category pages from the template? Would rather not, really... and getting anxious, as...
...we're getting real close to needing to be live too... couple of weeks max... I wish you could see it!
If you need more code let me know!
Thanks!
Iggy