close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Displaying unique StoreMessage div for each vendor

Thread began 1/25/2010 1:42 pm by iggymak198560 | Last modified 2/09/2010 1:55 am by iggymak198560 | 6063 views | 15 replies

iggymak198560

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 />
&nbsp; &nbsp;<span class="style16">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <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 />
&nbsp; &nbsp;<span class="style16">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <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

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...