Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

TEXT_MAIN Functionality


ps4956

Recommended Posts

I've searched the forum and cannot seem to locate an answer for this, so hopefully someone out there might be able to help.

 

Working with the Text_Main in the Languages/English/Index.php can be very difficult to deal with especially when it is followed by a large amount of data. Is there a way to use an Include or Require function within the define('TEXT_MAIN',''??? For example, suppose I create a file called mytext.php that contains all of the text. How would I be able to call that from the ('TEXT_MAIN',''??? I have tried something like this....define('TEXT_MAIN','<?php require(DIR_WS_INCLUDES . 'mytext.php'); ?>.......but I end up with a T-String error.

 

In searching the forums for an answer I noticed a lot of questions regarding Text_Main and parse errors that usually were the result of not editing the file correctly. It seems a separate file where you can dump all of the text and have it called when the main page loaded would be a very nice feature. Has anyone run into this or have a solution?

 

Thanks for your help.

Link to comment
Share on other sites

There are several contributions available... try searching contributions for "define mainpage"

 

I tried doing a number of searches in both the forum and contributions sections but found nothing on this specific topic. When I tried the search you refer to, the topics deal with the default.html page from earlier versions of OSCommerce.

 

Any other thoughts or ideas would be much appreciated.

Link to comment
Share on other sites

I tried doing a number of searches in both the forum and contributions sections but found nothing on this specific topic. When I tried the search you refer to, the topics deal with the default.html page from earlier versions of OSCommerce.

 

Any other thoughts or ideas would be much appreciated.

 

Okay....I just spent the last couple of hours searching the forums, contributions section and knowledge base. Not a single thing is listed on this topic that I could find. There are a number of questions regarding text_main and define mainpage, but nothing that deals with the question I had in my original post. I know there has to be a way to accomplish what I'm trying to do, so any suggestions would be appreciated. The content of my homepage changes daily, so I really need a simpler way of editing it other than using the current procedure. Any PHP wizards out there that might have an idea on how to approach this???

 

Thanks! B)

Link to comment
Share on other sites

Paul,

 

The define mainpage contrib works fine, I have been running this on my site for a long time with no problems.

 

When it refers to default.php it basically just means the index.php page.

 

It is very easy to install and operate.

 

Mark

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

Paul,

 

The define mainpage contrib works fine, I have been running this on my site for a long time with no problems.

 

When it refers to default.php it basically just means the index.php page.

 

It is very easy to install and operate.

 

Mark

 

Mark,

 

Thanks for the update. I downloaded the code and it looks like a lot of changes have to be made in order to call one line of PHP code. I don't have any PHP background, so I am very hesitant about diving into something like that. I was hoping there was a simpler way to do this......I created a php file called mytext.php and placed it in the Includes folder. In the Define Languages folder in the Index.php, is there a code I can enter where you would normally put the text within the two hypens....Text_Main','' that would call mytext.php? That is basically what I am trying to find.

 

As I mentioned in my earlier post, I have tried using the following:

define('TEXT_MAIN','<?php require(DIR_WS_INCLUDES . 'mytext.php'); ?>

When I do, I get a T-String parse error.

 

Thanks again. :thumbsup:

Link to comment
Share on other sites

Hi Paul,

 

As a rule you do not want to enter anything in the language files other than text, it makes life a pain when debugging at a later date.

 

The only way to get into osc and php is having a go at it.

 

Take your first step onto the php highway and you will not regret it (was that cheesy or wot!)

 

Believe me when I say that there are far far worse contribs to add than this one.

 

Mark

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

Hi Paul,

 

As a rule you do not want to enter anything in the language files other than text, it makes life a pain when debugging at a later date.

 

The only way to get into osc and php is having a go at it.

 

Take your first step onto the php highway and you will not regret it (was that cheesy or wot!)

 

Believe me when I say that there are far far worse contribs to add than this one.

 

Mark

 

Mark,

 

Thanks....I have already ordered a book from B&N on PHP....looks like I need to get started.

 

I did find a workaround for it though. Two steps are involved:

 

1. Create a .html file of the text you want to show on your homepage and upload that to your root directory.

2. In between the hypens of the define Text_Main (where you would normally put your text) put the following:

<iframe name="I1" src="http://www.yourwebsitename.com/yourtextfile.html" width="100%" height="1400" align="default" marginwidth="0" border="0" frameborder="0" marginheight="0">

 

All you have to do is change the website name to yours and be sure the path to your HTML file is correct. It just creates a basic frame and displays the html file within it. Be sure your frame size (height) is correct. Other than that, its a simple fix and makes it easy to edit the home page text...you just edit the HTML file.

 

Not sure if that is the best or the smartest way to handle it, but it seems to work. Any feedback would be helpful. :-"

Link to comment
Share on other sites

Paul,

 

Please dont use iframes as it will totally kill your site when it comes to search engine optimisation. Search engines hate iframes and it will only penalise your store.

 

Mark

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...