Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding infobox to define('TEXT_MAIN'


Tabula_Rasa

Recommended Posts

I'm using the line in /catalog/includes/languages/english/index.php:

 

define('TEXT_MAIN', ' [HTML content in here] ');

 

as a way to lay out the center in HTML. Works great, I'm happy, the client's happy.

 

However, the client wants the What's New box inside part of that html. I'm not sure how to do that.

 

My thought was to have the html extend to that point, then terminate the definition, add the php, then pick up again where I left off, but I have a feeling that's not going to work:

 

e.g.

define('TEXT_MAIN', ' <table><tr><td>' .  SOME-PHP-TO-CALL-WHATS_NEW_BOX . '</td></tr></table ');

 

Any suggestions on how I would do this? "SHOULD" I do it this way? What would be the syntax?

 

I really appreciate the assistance. :'(

Link to comment
Share on other sites

I'm not sure if calling the box per say would work, but I do use php inside of TEXT_MAIN and it works fine (html links using tep_href, and images using tep_image).

Kenneth S

--------------

Customer "Are you a real programmer?"

Me "No, but I did stay at a Holiday Inn Express last night"

Link to comment
Share on other sites

I'm using the line in /catalog/includes/languages/english/index.php:

 

define('TEXT_MAIN', ' [HTML content in here] ');

 

as a way to lay out the center in HTML. Works great, I'm happy, the client's happy.

 

However, the client wants the What's New box inside part of that html. I'm not sure how to do that.

 

My thought was to have the html extend to that point, then terminate the definition, add the php, then pick up again where I left off, but I have a feeling that's not going to work:

 

e.g.

define('TEXT_MAIN', ' <table><tr><td>' . ?SOME-PHP-TO-CALL-WHATS_NEW_BOX . '</td></tr></table ');

 

Any suggestions on how I would do this? "SHOULD" I do it this way? What would be the syntax?

 

I really appreciate the assistance.  :'(

 

normally, and with good reason, the language files are there for 1 purpose, defining the different language constants. Not for defining code and any other functionality. I would advice to keep it that way.

 

If you want a box on the index page, define it and call it there like the new_products and also purchased modules are called by default.

 

Believe me, if you start to put code in all the (wrong) places, it will haunt you in the end. Things will happen and you will have no idea why.

Treasurer MFC

Link to comment
Share on other sites

normally, and with good reason, the language files are there for 1 purpose, defining the different language constants. Not for defining code and any other functionality. I would advice to keep it that way.

 

If you want a box on the index page, define it and call it there like the new_products and also purchased modules are called by default.

 

Believe me, if you start to put code in all the (wrong) places, it will haunt you in the end. Things will happen and you will have no idea why.

Good advice, and I considered the wisdom of that. However, I'm a little new to PHP: Better at rehashing other people's code.

 

So, What I'm thinking is to find the references to TEXT_MAIN, then:

 

1. In the languages part, define a new TEXT_MAIN and TEXT_MAIN_END.

2. Wherever it is that TEXT_MAIN is being used, add,

###PHP-LEADING-UP-TO### TEXT_MAIN . ###PHP-CALLING-WHATS-NEW-BOX### . TEXT_MAIN_END.

 

My questions are, then, what would be the syntax for this?

 

Thanks for the comments :)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...