Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Hybrid View

  1. #1
    Join Date
    Feb 2010
    Posts
    67
    Plugin Contributions
    0

    Default Add code to the <body> tag of just one EZ page?

    Hello,
    I need to add
    Code:
    onload="initialize()"
    to the <body> tag for one of my EZ Pages. How can I go about changing the tag for just that page? Thanks in advance!
    Brian

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Add code to the <body> tag of just one EZ page?

    In the docs folder that comes bundled with Zen Cart when you download it is a file about javascript. There's an explanation in there as to how to load javascript, or as you're asking, run it when the page loads.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Feb 2010
    Posts
    67
    Plugin Contributions
    0

    Default Re: Add code to the <body> tag of just one EZ page?

    Kuroi,
    I think I've found the file you're talking about (read_me_jscript.html), but I still can't figure out how to alter the <body> tag because it seems to be only referring to working with javascript. Can you point me in the right direction? Thanks for the help.
    Brian

  4. #4
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Add code to the <body> tag of just one EZ page?

    Sorry, my bad. I should have directed you to the file that describes specifically how to add to the body onload attribute. That files in the same place as the one you found but called read_me_onload.html.

    The idea that you should let go of, is that you add to the onload tag. That file will show you where and how to tell Zen Cart what you want added, and then Zen Cart will automatically do the adding for you on a page or site-wide basis depending upon which set of instructions you followed.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  5. #5
    Join Date
    Feb 2010
    Posts
    67
    Plugin Contributions
    0

    Default Re: Add code to the <body> tag of just one EZ page?

    All right, perfect. Now I understand how to make it happen. Thanks for the help!
    Now, my final question: what is the correct format for naming EZ pages folders in the modules/pages directory? The page I'd like to add to is ez page ID #13. I've tried naming the folder page_13 and that doesn't work. I'm assuming that I must have the wrong format for the folder names.
    Thanks for your help thus far!
    Brian

  6. #6
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Add code to the <body> tag of just one EZ page?

    I'm sorry but the question doesn't make sense to me. EZ-Pages are stored as block of HTML in the database, i.e. they don't have folders.

    Might you be confusing them with define pages, which are "real" pages built using PHP?

    Or are you using EZ-Pages to create links to something that would reside in a folder?
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  7. #7
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Add code to the <body> tag of just one EZ page?

    You can't target it to just one EZ-page specifically without writing custom code to accomplish that.

    What exactly does this "initialize()" function call actually "do"? (Ya, I know it runs the "initialize()" function, which would logically start up some sort of javascript you've got on the page: what exactly is THAT doing? and why? )
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Feb 2010
    Posts
    67
    Plugin Contributions
    0

    Default Re: Add code to the <body> tag of just one EZ page?

    It starts up my google maps javascript. Is there a way to just insert the javascript into the ezpage instead of loading in the body tag? Here's what I actually want to put in: onunload="GUnload()"

  9. #9
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Add code to the <body> tag of just one EZ page?

    So you're saying you don't really want an "onload" event at all?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Feb 2010
    Posts
    67
    Plugin Contributions
    0

    Default Re: Add code to the <body> tag of just one EZ page?

    Nope, sorry about that, I really want an "onunload" event. I know very little about javascript, so I apologize for my ignorance of the difference. Is there a way to put that into the body of the ez page?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 0
    Last Post: 20 Jul 2011, 02:17 PM
  2. How Can I add onload to BODY Tag
    By shabizon in forum General Questions
    Replies: 5
    Last Post: 9 Nov 2010, 02:48 PM
  3. Need to add code below </head> tag and above <body> tag in product page
    By Danielle in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 11 Apr 2010, 07:53 PM
  4. Add Some Script above the body tag on each page
    By mouse in forum General Questions
    Replies: 8
    Last Post: 24 May 2006, 03:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg