Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PHP Code in STS $template['headcontent']


dstu

Recommended Posts

Hello,

 

I'm trying to integrate php-layers-menu in mySTS based osc site.

 

the menu requires some code (javascript, html and php requires) in the head section and some in the body.

 

Using STS, I'm forced to put every above the </head> inside the $template['headcontent'] (otherwise if I put these tags in the $masthead, they are stripped out).

 

The problem is that I have some PHP code that I need to run.

 

Doing this doesn't work:

	$template['headcontent'] .= '<script language="JavaScript" type="text/javascript">' . "\n";
$template['headcontent'] .= '<?php' . "\n";
$template['headcontent'] .= 'require_once \'/libjs/layersmenu-browser_detection.js\';' . "\n";
$template['headcontent'] .= ' ?>' . "\n";
$template['headcontent'] .= '</script>' . "\n";

 

Can anyone tell me what I should do?

 

Thanks,

 

David

Link to comment
Share on other sites

Hello,

 

I'm trying to integrate php-layers-menu in mySTS based osc site.

 

the menu requires some code (javascript, html and php requires) in the head section and some in the body.

 

Using STS, I'm forced to put every above the </head> inside the $template['headcontent'] (otherwise if I put these tags in the $masthead, they are stripped out).

 

The problem is that I have some PHP code that I need to run.

 

Doing this doesn't work:

	$template['headcontent'] .= '<script language="JavaScript" type="text/javascript">' . "\n";
$template['headcontent'] .= '<?php' . "\n";
$template['headcontent'] .= 'require_once \'/libjs/layersmenu-browser_detection.js\';' . "\n";
$template['headcontent'] .= ' ?>' . "\n";
$template['headcontent'] .= '</script>' . "\n";

 

Can anyone tell me what I should do?

 

Thanks,

 

David

Try placing the javascript in your store's default javascript folder in admin. This is where sts pulls all the default javascript for a stock version of osc from.

 

Hope this helps,

 

Bill Kellum

Bill Kellum

 

Sounds Good Productions

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...