Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding text to the home page plus duplicate navigation buttons.


lakul

Recommended Posts

Posted

Trying to tidy up a site and trying to get to grips with this PHP thingy :'( I would like to add some text to the home page under the picture - www.eternalmaker.com but have no idea what index.php to put it in and where to insert it exactly. I'm sure this is an easy one for you experts out there.

 

There are also duplicate navigation bars and buttons, so any tips on how to sort these out would be appreciated. If it's a massive job, I'm leaving well alone.

Posted

I've managed to edit index.php and I'm pretty sure it's right, but the text isn't showing on my homepage. Any ideas why?? is there something else I need to do. Any help would be appreciated.

Posted

Hey Kerry,

 

You might not have too much luck getting help here as you're using a template. But I'll give it a shot!

 

If you are talking about adding text below this image =

 

m25.jpgm26.jpg

 

It is in your header.php file with the purple nav buttons below it.

 

Next inline are those "sort by" category buttons which appear to be in your index.php file.

 

Once you figure out where you want the text to appear, add this to a table cell = <?php echo TEXT_MAIN; ?>

 

Now open your includes\languages\english\index.php file.

 

Make sure you have an entry such as this = define('TEXT_MAIN', 'Add your text here');

 

Of course, change the above Add your text here to what you want.

 

wink.gif

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Posted

Thanks Jim, my next problem is I have no idea what a table cell is. I would like the text to go below the picture, do I just pop the code you gave me inbetween? I have added my text already to index.php. This is like a foreign language to me, but I want to learn. Here is my code -

 

 

<td><img

src="images/m25.jpg" height="188" width="246"><a

href="%3C?=tep_href_link%28%27index.php%27,%27cPath=46_53%27%29?">><img

src="images/m26.jpg" border="0" height="188"

width="242"></a></td>

</tr>

<tr>

<td height="5"></td>

</tr>

<tr>

<td><a

href="%3C?=tep_href_link%28%27index.php%27%29?">><img

src="images/b01.gif" border="0" height="28"></a><a

href="%3C?=tep_href_link%28%27products_new.php%27%29?">><img

src="images/b02.gif" border="0" height="28"></a><a

href="%3C?=tep_href_link%28%27account.php%27%29?">><img

src="images/b03.gif" border="0" height="28"></a><a

href="%3C?=tep_href_link%28%27shopping_cart.php%27%29?">><img

src="images/b04.gif" border="0" height="28"></a><a

href="%3C?=tep_href_link%28%27checkout_shipping.php%27%29?">><img

src="images/b05.gif" border="0" height="28"></a></td>

Posted

You are welcome Kerry... wink.gif

 

This is a good place to checkout and learn the basics of a table structure - http://www.w3schools...html_tables.asp

 

A quick lesson rundown:

<table> The starting tag where you want the table.

<tr> The starting tag where you want a table row (horizontal)

<td> The starting tag where you want a table cell, mulitple cells to create columns.

</td> Closes/ends the table cell.

</tr> Closes/ends the table row.

</table> Closes/ends the table itself.

 

The opening and and closing tags must follow the reverse sequence, such as:

<table>

<tr>

<td>Text or picture here</td>

<td>Text or picture here</td>

</tr>

<tr>

<td>Text or picture here</td>

<td>Text or picture here</td>

</tr>

</table>

You first close the cell, then the row, then the table.

 

Ok, enough dribble LOL

Now for your issue...

 

If you want the text you created in your - includes\languages\english\index.php file to appear directly below the picture, change your code as follows =

 

From this:

 

<td><img src="images/m25.jpg" height="188" width="246"><a href="%3C?=tep_href_link%28%27index.php%27,%27cPath=46_53%27%29?">><img src="images/m26.jpg" border="0" height="188" width="242"></a></td>

</tr>

<tr>

<td height="5"></td>

</tr>

 

To this:

 

<td><img src="images/m25.jpg" height="188" width="246"><a href="%3C?=tep_href_link%28%27index.php%27,%27cPath=46_53%27%29?">><img src="images/m26.jpg" border="0" height="188" width="242"></a></td>

</tr>

<tr>

<td height="5"></td>

</tr>

<tr>

<td><?php echo TEXT_MAIN; ?></td>

</tr>

 

That will place the text below the picture and above the purple catagory buttons.

 

Personally I think it would look better under the purple buttons and lose the "sort by" image links. I can help you with that too if you'd rather do that.

 

wink.gif

 

P.S. I'm not very good with PHP either, so I'm not sure if you need to create a header.php file in your english language folder with your text since you're placing it in your header. Let me know how it works for you, any problems and I'll try again.

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Posted

Thanks Jim, you're a star :D and thanks for the link to the lessons, boy do I need them. I'ts not my website, but I agree, there are far too many navigation buttons all doing the same thing. It could be tidied up big time, but I need to check with the owner first.

 

I tried what you said, editing header.php in the english folder and public folder the and text didn't show :'(

Posted

Hummm...

 

You added this code:

 

<tr>

<td><?php echo TEXT_MAIN; ?></td>

</tr>

 

to your includes\header.php file?

 

And this code:

 

define('TEXT_MAIN', 'Add your text here');

 

to your includes\languages\english\index.php file?

 

And nothing showed??

 

Then try saving a copy of your includes\languages\english\index.php file as includes\languages\english\header.php and see if it shows.

 

If not, you might have to get in touch with the template creator and find out what exactly the file structure is.

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Posted

OK, I got the wrong header file (why are there so many??) but the code just filled the home page with errors :o

Posted

What kind of errors?

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Posted

Jim, I didn't hang around long enough to take a screen dump as I wanted to get the website back to normal. But here is where I put my code if that helps ( I even put it below the buttons as you suggested but that didn't work either. I've never know it be this hard to add some text to a homepage but I appreciate all the help you are giving me -

 

 

src="images/m25.jpg" height="188" width="246"><a

href="%3C?=tep_href_link%28%27index.php%27,%27cPath=46_53%27%29?">><img

src="images/m26.jpg" border="0" height="188"

width="242"></a></td>

</tr>

<tr>

<td height="5"></td>

</tr>

<tr>

<td><?php echo TEXT_MAIN; ?></td>

</tr>

<tr>

<td><a

href="%3C?=tep_href_link%28%27index.php%27%29?">><img

src="images/b01.gif" border="0" height="28"></a><a

href="%3C?=tep_href_link%28%27products_new.php%27%29?">&gt

Posted

I'm not sure what to tell you now Kerry. blush.gif

 

The code looks correct.

 

It might be time to contact your template creator. sad.gif

 

Sorry... crying.gif

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Posted

Thanks Jim, I contacted the company who setup the website in the first place and they couldn't help unless i wanted to part with lots of £'s :( Are there any other files that might need changing?

Posted

Just found an old post where main_text was called from the root index.php. Is that worth a try, if so, if I post my code would someone be able to tell me where it goes. With thanks

  • 4 weeks later...
Posted

Im having the same problem as well. I deleted the text when i first installed it now i cant add any text and i know i have it in the right folder.

 

This is what i have in /includes/languages/english

 

 

<?php

/*

$Id: index.php 1739 2007-12-20 00:52:16Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2007 osCommerce

 

Released under the GNU General Public License

*/

 

define('TEXT_MAIN', 'YO WTF WORK');

define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');

define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');

define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');

 

if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {

define('HEADING_TITLE', 'Let\'s See What We Have Here');

define('TABLE_HEADING_IMAGE', '');

define('TABLE_HEADING_MODEL', 'Model');

define('TABLE_HEADING_PRODUCTS', 'Product Name');

define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');

define('TABLE_HEADING_QUANTITY', 'Quantity');

define('TABLE_HEADING_PRICE', 'Price');

define('TABLE_HEADING_WEIGHT', 'Weight');

define('TABLE_HEADING_BUY_NOW', 'Buy Now');

define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');

define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');

define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');

define('TEXT_SHOW', '<b>Show:</b>');

define('TEXT_BUY', 'Buy 1 \'');

define('TEXT_NOW', '\' now');

define('TEXT_ALL_CATEGORIES', 'All Categories');

define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers');

} elseif ($category_depth == 'top') {

define('HEADING_TITLE', 'What\'s New Here?');

} elseif ($category_depth == 'nested') {

define('HEADING_TITLE', 'Categories');

}

?>

Archived

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

×
×
  • Create New...