Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

I have moved the greetings messages to a box that uses the temmplate. For doing that, I had to define a new location for adding, removing or modifying new boxes on the front page and categories pages without touching the index code. It also cleans up a couple of language files and general.php by adding the texts and functions to the boxes.

Doing that, I noticed for now there are 'placeholders' defined for header, footer, porducts page, left and right column, but not for other pages, so I addded a 'boxes_main_page' placeholder into the front page.

Then I started moving new and incoming products modules to a box and found a problem: You can't associate a box to two placeholders at a time so I can't define a module that shows in frot page and categories page at the same time. This is logical for moddules that shows in columns but not for those into the body of the pages.

I figure it can be done reading $PHP_SELF in the box and adding the logic into it, but then the code of the box itself will be more complex, and ordering the boxes would be difficult too because we mix positions. Also that method can not differentiate front page and categories pages (never understood why they are in the same file).

Any opinions/suggestions?

Link to comment
Share on other sites

You need to do a few more tests:

  1. If $categories_id is greater than 0, you are on a category page.
  2. If $_GET['manufacturers_id'] is set and greater than 0, you are on a manufacturer's page
  3. Otherwise you are on the front page.

Look at the module code for 2.3.3.4BS -- some of the modules can select what pages they show on. You should be able to adapt that code to do what you want.

 

I have no idea why three of the pages are in index.php and all of the others are separate. Harald may be the oly person here who remembers that.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Yes I've seen the code inside at least three header tags modules. But I'm also thinking how to do it logically and what implies for each page/module. For example, there would be two What's new modules (one for the columns/footer and other for the page contents. Do you think that's a good idea?

 

Also the main page is a special page and I've not decided yet if putting a placeholder for it or adding a generic content placeholder and check if the page should load the module or not. Probably the second option is more practical so all modules can have a sort order.

 

The other thing I was thinking is to reorder the admin boxes page to see what's actually on each section/page. I'll give it a try, too.

Link to comment
Share on other sites

The content modules ant the box modules generally have different contents. The New Products content module might show six or eight products where the box module only has room for one. It would be possible to do this with a different template for each use, but the code would be inefficient. I would keep them as two separate modules.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • 1 month later...

Archived

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

×
×
  • Create New...