Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Suggestion: move html headers to header.php & split head


airblaster

Recommended Posts

Posted

In OSC's current state its impossible to include OSC into a site without using frames or modifying dozens of files.

To change this I suggest to replace the current header code (the part which includes header.php) with something like this:

 

<!-- header_top //-->

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

<!-- header_top_eof //-->



<script language="javascript" src="includes/general.js"></script>

(lots of JavaScript Code can go here)



<!-- header_bottom //-->

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

<!-- header_bottom_eof //-->



<!-- body //-->

........

 

header_top.php would contain everything till <head> (or the stylesheet definition if it is supposed to be included on every page), and header_bottom.php everything beginning from </head>.

The html footer code would also be moved to footer.php.

Dynamic titles could still be used if you simply output a variable containing the title of the current page.

 

This method has got several advantages:

- removes redundancy of HTML header code (change html header/footer at only 1 place instead of dozens of files)

- its possible to include induividual javascript functions and other code that goes between the <head> and </head> only for the files that need the code.

- allows users to integrate osCommerce into the Design of their webpage easily (e.g. they can include their php based framework that always displays its own html headers)

- its easy to implement

  • 3 weeks later...

Archived

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

×
×
  • Create New...