Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do I add HTML to my Index.Php?


milesdavis

Recommended Posts

Hello,

 

I'm trying to add a few logos/buttons to my index.php file, and I haven't had much luck.

 

So far, I've been editing the catalog/includes/languages/english/index.php file, right underneath the line that by defalt says your store name, and above the "new products" images boxes.

 

I can't figure out a way to include the html information in the .php file. Whenever I add it with Html tags it just gives me a error parsing that page referencing that line number.

 

 

Thanks for any help. I've been looking around, but I can't word it correctly in search to find any help.

 

thanks so much!

Link to comment
Share on other sites

You can use HTML in the TEXT_MAIN define, but you have to make sure that the string is a valid PHP string, meaning that apostrophes are preceded with a backslash.

Link to comment
Share on other sites

You can use HTML in the TEXT_MAIN define, but you have to make sure that the string is a valid PHP string, meaning that apostrophes are preceded with a backslash.

 

Because of my limited knowledge of coding in general, can you give me an usage example?

 

Say I wanted to add an image called google.jpg that links to http://www.google.com underneath the TEXT_MAIN description on the front page..

 

currently, I've got this:

 

define('TEXT_MAIN', 'Welcome to the our store!!');
define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');
define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');
define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');

 

where/how would I insert that to make it work?

 

thanks!!!

Link to comment
Share on other sites

define('TEXT_MAIN', '<p>Welcome to our store!!</p>
<p><a href-="www.google.com"><img src="images/google.jpg"></a></p>
<p>You\'ll like it here!</p>');

Link to comment
Share on other sites

define('TEXT_MAIN', '<p>Welcome to our store!!</p>
<p><a href-="www.google.com"><img src="images/google.jpg"></a></p>
<p>You\'ll like it here!</p>');

 

 

Thanks stevel,

 

that works perfectly, except the photo isn't linking to the site address (www.google.com). The image is there, as well as all the right text, but nothing is working as a link.

Here is how it looks with the name of my image in place:

 

 

define('TEXT_MAIN', '<p>Welcome to our store!!</p>
<p><a href-="www.google.com"><img src="images/opening.jpg"></a></p>
<p>You\'ll like it here!</p>');

 

thanks!!

Link to comment
Share on other sites

Thanks stevel,

 

that works perfectly, except the photo isn't linking to the site address (www.google.com). The image is there, as well as all the right text, but nothing is working as a link.

Here is how it looks with the name of my image in place:

define('TEXT_MAIN', '<p>Welcome to our store!!</p>
<p><a href-="www.google.com"><img src="images/opening.jpg"></a></p>
<p>You\'ll like it here!</p>');

 

thanks!!

 

 

I think I found the problem, I had an extra "-" before the = sign in the href equasion. Now it works, if I want the link to open in it's own window, do I just add a <blank> tag?

 

thanks for the assist.

Link to comment
Share on other sites

I think I found the problem, I had an extra "-" before the = sign in the href equasion. Now it works, if I want the link to open in it's own window, do I just add a <blank> tag?

 

thanks for the assist.

 

Got this working..

 

Just a quick one. Interesting follow-up, all the images that I attempt to load this way are given a "border". I'm wondering which variable this is in the stylesheets.css that would add a border to images added this way. I'd like to change the color to match the background, but I can't figure out what one it is.

 

thanks!!

Link to comment
Share on other sites

Got this working..

 

Just a quick one. Interesting follow-up, all the images that I attempt to load this way are given a "border". I'm wondering which variable this is in the stylesheets.css that would add a border to images added this way. I'd like to change the color to match the background, but I can't figure out what one it is.

 

thanks!!

 

Not in the stylesheet just add a border=0 at the end of your img tag

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...