Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Putting Script in <head></head>


Guest

Recommended Posts

I need to put some script in the head section of my pages. Is there anywhere I can put the script so that it will do it for all the pages or do I have to go into each file in my catalog folder and put it into everyone?

Link to comment
Share on other sites

The script can go in the includes/header.php file, depending on what it contains. Some functions need to be in the head section. But I routinely place js in the header and it works fine. Note that you should place it in an external file intead of placing it there directly for SEO purposes.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

:'(  Groan

 

I thought that might be the case

 

Remember when doing that though, just add a require statement between the <head></head> tags

 

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

 

and put your code into

 

mystufftogointheheader.php

 

that way it's easy to change what actually is included in the header without changing every file again.

Link to comment
Share on other sites

Remember when doing that though, just add a require statement between the <head></head> tags

 

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

 

and put your code into

 

mystufftogointheheader.php

 

that way it's easy to change what actually is included in the header without changing every file again.

 

Bingo!

 

Something like that should be implemented in the core.

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

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...