Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / How to properly implement jscript_*.php file for main page?

How to properly implement jscript_*.php file for main page?

Locked

Views: 1,690

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
17 Oct 2009, 10:35 AM
#1
webwiz avatar

webwiz

New Zenner

Join Date:
Jan 2006
Location:
wv
Posts:
21
Plugin Contributions:
0

How to properly implement jscript_*.php file for main page?

Hello all,

I'm trying to insert an image into the main page, ABOVE the "welcome" text....so on the index.php page. BUT, I need for that image to be clickable to open a pop-up window for a survey form.

In trying to follow the documentation for using jscript file while "page specific" and included, not linked to...I'm afraid I'm a little lost. The directions leave out details that someone not familiar with jscript wouldn't know. For instance:

In testing my javascript on external pages (works fine), I've got this code around my image on the survey test page (Click the link if you want to see what I'm trying to make happen):

<div align="center"><a href="http://www.thesoappeddler.com/survey_01.html" onclick="NewWindow(this.href,'Survey','650','550','yes','center');return false" onfocus="this.blur()"><img src='http://www.thesoappeddler.com/images/survey_soap_468x60.gif' alt="FREE SOAP when you take our survey!" width="468" height="60" border=0></a></div>

Do I still insert this code "as is" into the index.php file where I want the image to be? And for naming the jscript file, I went with jscript_survey.php because I didn't see info on what, if anything I needed to use for the filename. But my head tells me this needs to match an existing reference somewhere?

I'm sorry for the dumb question. I realize jscript is very vanilla to most of you guys, but personally I think I'd rather play with php and html. Thanks in advance for any insight.

19 Oct 2009, 12:49 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: How to properly implement jscript_*.php file for main page?

webwiz:

<div align="center"><a href="http://www.thesoappeddler.com/survey_01.html" onclick="NewWindow(this.href,'Survey','650','550','yes','center');return false" onfocus="this.blur()"><img src='http://www.thesoappeddler.com/images/survey_soap_468x60.gif' alt="FREE SOAP when you take our survey!" width="468" height="60" border=0></a></div> ``` > > Do I still insert this code "as is" into the index.php file where I want the image to be?Yes.> **webwiz:** > > And for naming the jscript file, I went with jscript_survey.php That's fine. You'll see in your browser's page source that the file contents is being included.

Ref: http://www.zen-cart.com/wiki/index.php/Customisation_-_Templates_-_Javascript