Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

can banner be displayed in index "TEXT_MAIN" area?


fribhey

Recommended Posts

i want to move my banner into the index "TEXT_MAIN" area instead of having it in the footer. i know i have to edit the languages>english>index.php file but what exactly do i need to do? i tried just putting the banner code into that area but it's not working. is it not working because i'm putting php tags inside of php tags?

 

define('TEXT_MAIN', '<table width="129" border="0" cellspacing="0" cellpadding="0">
     <tr>
    	 <td>**TEXT GOES HERE**</td>
     </tr>
     <tr>
    	 <td>**BANNER GOES HERE**</td>
     </tr>
  	 </table>');

 

i replaced the "**BANNER GOES HERE**" with:

<?php
if ($banner = tep_banner_exists('dynamic', 'reminder')) {
echo tep_display_banner('static', $banner);
}
?>

 

and i also tried:

echo tep_display_banner('dynamic', 'reminder');

 

but neither worked.

 

does anyone have a suggestion/solution for this?

 

thanks

Link to comment
Share on other sites

Here is a contrib which lets you put it over the main text area in the index, you can tweek it replace the text too or just remove the text alltogether.

 

http://www.oscommerce.com/community/contributions,2234

Link to comment
Share on other sites

Here is a contrib which lets you put it over the main text area in the index, you can tweek it replace the text too or just remove the text alltogether.

 

http://www.oscommerce.com/community/contributions,2234

according to that link:

"Puts a banner at the very top of the body, in place of the default page heading text and appears before the main text area"

 

this banner box replaces the "HEADING_TITLE", i don't want the banner to appears before the main text area, i want it to appear within the main text area.

 

isn't there a line of code or something i can use instead of using this contrib.

 

thanks

Link to comment
Share on other sites

Hi, I wrote the contribution in question :D ...

 

I have figured out how you can use this contrib to do this.

 

_________

1. Download and install the contrib EXCEPT the step that tells you to change index.php.

 

2. Open catalog/index.php.

 

 

If you are using the stock index.php, find line 306 and replace this:

 

<tr>

<td class="main"><?php echo TEXT_MAIN; ?></td>

</tr>

 

 

with this:

 

<tr>

<td class="main"><?php echo TEXT_MAIN; ?></td>

</tr>

 

<tr>

<td class="pageHeading"><?php include(DIR_WS_MODULES . FILENAME_BANNER_BOX); ?></td>

</tr>

 

<tr>

<td class="main"><?php echo TEXT_MAIN2; ?></td>

</tr>

 

Then, open languages/english/index.php and call define text_main2 by adding this:

 

define('TEXT_MAIN2', 'Main text 2 here');

 

below this:

 

define('TEXT_MAIN', 'Main text here');

 

_________

 

Obviously, you change the 'Main text 2 here' and the 'Main text here' to whatever you want. If you want to preview it, here is a link:

 

dev site

 

Let me know if you have problems. Hope this is what you were talking about! :D

Link to comment
Share on other sites

If you don't need a rotating banner in the main text area, just an image, simply <br><img src="/catalog/images/yourgif.gif"> whereever in the TEXT_MAIN define you want it to appear. For example:

 

define('TEXT_MAIN', 'Your main text would go here<br><img src="/catalog/images/yourgif.gif">Some more text blah blah blah');

Link to comment
Share on other sites

Oh yeah, I swear this is the last one. If you don't need to wrap the banner in text, just exclude this:

 

<tr>

<td class="main"><?php echo TEXT_MAIN2; ?></td>

</tr>

 

and ignore my instructions on defining TEXT_MAIN2

 

or you can leave it the way it is, and change this:

 

define('TEXT_MAIN2', 'Main text 2 here');

 

to this:

 

define('TEXT_MAIN2', '');

Link to comment
Share on other sites

If you don't need a rotating banner in the main text area, just an image, simply <br><img src="/catalog/images/yourgif.gif"> whereever in the TEXT_MAIN define you want it to appear. For example:

 

define('TEXT_MAIN', 'Your main text would go here<br><img src="/catalog/images/yourgif.gif">Some more text blah blah blah');

ecopeia,

 

thank you for all of your help. i actually figured out a way to handle putting the banner in the main text area. i basically put the table on the index.php itself and in the one cell i put

<?php echo TEXT_MAIN; ?>

 

and in the other cell i put

<?php
if ($banner = tep_banner_exists('dynamic', 'reminder')) {
echo tep_display_banner('static', $banner);
}
?>

 

before i had the entire table in the 'TEXT_MAIN' and tried to put the banner code inside that table, now i just put the table on the main index.php page with the 'TEXT_MAIN' in one cell and the banner code in another.

 

the site is for a customer of mine who does gift baskets. she's constantly asking me to put up a little graphics on the homepage reminding people about certain holidays (xmas, mothers day, valetines day, etc). i figured i could use the banner code for these reminders since i wasn't using actual banners. this way i can go in the admin and set dates for each reminder to appear on the site. i just basically wanted to automate things a little more so it would be less work for me :)

 

thanks again

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...