Jump to content
Sign in to follow this  
mrjohnpc

Include Infobox within Main Content

Recommended Posts

Hi,

 

I'm working on this site - http://www.mrjohnpcs.org/index.php

I'm using STS to template the thing, and so far everythings working out fine.

I've added a few other components and using the sts_inc/sts_user_code.php file I've been able to incorporate them into the template's mainpage.

I'm trying to incorporate another component - Product Listing Infobox.

It will work fine when called from the main template page - \includes\sts_templates\..\template.html

But I want it to be embedded in the main content of the page, i.e. under the $content call to \index.php.

As you can see from the site, this component is working fine in the left most column which is calling it from the template file, but I can't get it to work in the middle three columns which are calling their content from index.php. (the right most of the three central columns is using php echo at the moment).

I hope this makes sense.

I've little knowledge of php, it's top of a long list of things to learn, so I may be going about this the wrong way.

Any help would be greatly appreciated.

 

John

Share this post


Link to post
Share on other sites
Hi,

 

I'm working on this site - http://www.mrjohnpcs.org/index.php

I'm using STS to template the thing, and so far everythings working out fine.

I've added a few other components and using the sts_inc/sts_user_code.php file I've been able to incorporate them into the template's mainpage.

I'm trying to incorporate another component - Product Listing Infobox.

It will work fine when called from the main template page - \includes\sts_templates\..\template.html

But I want it to be embedded in the main content of the page, i.e. under the $content call to \index.php.

As you can see from the site, this component is working fine in the left most column which is calling it from the template file, but I can't get it to work in the middle three columns which are calling their content from index.php. (the right most of the three central columns is using php echo at the moment).

I hope this makes sense.

I've little knowledge of php, it's top of a long list of things to learn, so I may be going about this the wrong way.

Any help would be greatly appreciated.

 

John

John, send me your template so I can see where your placeholders are situated within the tables or css. (It's best that you send me a zip file including your images so that I can view it from a design viewpoint as well.)

 

Have you made a STS tag for your custom infobox "products.php"? If so, just place this tag in the column or table that you wish for it to display.

 

If you are trying to get the "products.php" file to be "included" within the STS tag "$content", then you will have to manually edit your index.php file to "include" this. I believe the following PHP code would work for you:

 

<tr><td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?><td></tr>

 

If you want to pull in a file within your shop, you will need the following code:

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

The above will pull in the "header.php" file which is located in the "includes" directory of

 

your shop. ***Change "includes" and "header.php" to match your folder and file that you want to include (same with the "PRODUCT_LISTING" example above)

 

Hope this has helped,

 

Bill


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Hi Bill,

 

Thanks for the reply.

I'm starting to narrow down the problem a bit, but I've gone as far with it as I can at this moment.

I've changed the content within the colums of my page to reflect what I intend to do with them.

I've been attempting to remove all tables from the core code of oscommerce.

I'm not a php coder, so to do this I've been hacking my way through the code inching forward through trial and error.

 

I'm almost there, but an issue still exists -

If I remove all the tables from the index.php file the frontpage's main content works fine but the product page is broken (i.e. it displays no products)

Conversely if leave the tables intact on the index.php file apart from the section of that file that deals with the main content, if I remove the tables here but leave the rest of the file's tables intact the frontpage's main content doesn't appear.

I have a half an understanding of why this is happening, and I hope to resolve it by the time I've finished the site and hacked the tables out of the rest of the files that I am using in oscommerce.

In the meantime I have found a workaround - remove most of the tables from the section of index.php that deals with the frontpage's main content but leave it wrapped in a table tag (also add a <td> <tr> wrap so firefox recognises it as a table and accepts table formatting in the css file)

 

Now how this issue relates to the current problem I'm having -

The file I wish to call is in the boxes folder and is called 'products.php'

I've added an STS tag for this and it is being called in the left-most column of the page, (it's the scroll-list with Products as a title).

I've tried using the php include in index.php and the result is a blank screen when page loading is attempted.

I've played around with this and I'm certain the correct file is being called.

At this stage I'm lost as to the reason for this problem and how to fix it.

 

I'll send you a zip file containing the site's index.php file, the template, the products.php file, and a draft design jpg of what I am hoping to achieve on this page.

 

Thanks again for all your help.

 

Talk to you soon,

John

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×