Thread: Creating Popups

Results 1 to 10 of 14

Hybrid View

  1. #1
    Join Date
    Sep 2007
    Location
    Herne Bay, Kent, England
    Posts
    182
    Plugin Contributions
    0

    Default Re: Creating Popups

    Hello again.

    I know you said this was easy, but I still can't get my popups to work correctly!! As you may remember, I'm trying to place some links on the home page (define_main_page) to some explanatory popups.

    So, this is what I've done:

    Downloaded jscript_add-event.js and jscript_popup.js and placed them in /includes/modules/pages/define_main_page/

    Installed one popup in includes/templates/my_template/main_page_info

    Added the following two lines to it.

    <script type="text/javascript" src="http://localhost/mainwebsite/includes/modules/pages/define_main_page/jscript_add-event.js"></script>
    <script type="text/javascript" src="http://localhost/mainwebsite/includes/modules/pages/define_main_page/jscript_popup.js"></script>

    Added the following into define_main_page.php

    <ul id="mainPageInfo"><li><a href="http://localhost/mainwebsite/includes/templates/apple_zen/main_page_info/ex-chainstore.html">rel="popup console 800 600 noicon" What is ex-chainstore clothing? </a></li></ul>

    I still get the popup opening full size in the current tab.

    Go on, tell me I'm doing something really stupid, I don't mind!

    Regards

    Philip

  2. #2
    Join Date
    Mar 2009
    Location
    Cornelius, NC
    Posts
    334
    Plugin Contributions
    0

    Default Re: Creating Popups

    phillip,
    you're still making it too complicated! :)

    i think you're getting confused by trying to combine directions from the perfect popup website, and zencart.

    just follow my directions that i posted as my last post, namely:

    1. DONT put the files in your "main_page" folder, follow the zencart directions here:

    Any file in the includes/templates/{template_directory}/jscript/ directory with the following filename format will be loaded globally on every page of your shop:
    jscript_{unique_name}.js
    (where {unique_name} can be anything you want)
    which means, change the two file names from:
    add-event.js
    popup.js

    to:
    jscript_add-event.js
    jscript_popup.js

    and add them to your "includes/templates/{template_directory}/jscript/ " folder

    2. DONT use this on any page: (delete it!)
    <script type="text/javascript" src="http://localhost/mainwebsite/includes/modules/pages/define_main_page/jscript_add-event.js"></script>
    <script type="text/javascript" src="http://localhost/mainwebsite/includes/modules/pages/define_main_page/jscript_popup.js"></script>
    it is not needed!

    3. what you wrote as code for the actual link should be correct! just need to put the jscript files in the correct location, and disregard the code you put at the top of the page.

    let me know how it goes!

  3. #3
    Join Date
    Sep 2007
    Location
    Herne Bay, Kent, England
    Posts
    182
    Plugin Contributions
    0

    Default Re: Creating Popups

    Thanks for that.

    Sorry - I was going round and round in circles yesterday!!

    I assume it doesn't matter where I put the pop up files, as long as I reference them correctly on define_home_page.

    Also by {template_directory} do you mean my custom template?

    Philip

  4. #4
    Join Date
    Mar 2009
    Location
    Cornelius, NC
    Posts
    334
    Plugin Contributions
    0

    Default Re: Creating Popups

    I assume it doesn't matter where I put the pop up files
    if by this you mean the jscript files... you MUST put them in the jscript folder...

    if you mean does it matter where you put the code that has the link and the "=rel console ....." no, you can put that most anywhere...

    Also by {template_directory} do you mean my custom template
    YES! that is correct! :)

  5. #5
    Join Date
    Sep 2007
    Location
    Herne Bay, Kent, England
    Posts
    182
    Plugin Contributions
    0

    Default Re: Creating Popups

    Quote Originally Posted by customk1 View Post
    if by this you mean the jscript files... you MUST put them in the jscript folder...

    if you mean does it matter where you put the code that has the link and the "=rel console ....." no, you can put that most anywhere...


    YES! that is correct! :)
    Excellent, thanks very much. Yep, by popup files I mean the actual content of the popup.

    I'll keep you posted!!

    All the best

    Philip

  6. #6
    Join Date
    Sep 2007
    Location
    Herne Bay, Kent, England
    Posts
    182
    Plugin Contributions
    0

    Default Re: Creating Popups

    Aaah - now I understand!

    Many thanks

    Philip

  7. #7
    Join Date
    Aug 2008
    Posts
    41
    Plugin Contributions
    0

    Default Re: Creating Popups

    Quote Originally Posted by customk1 View Post
    phillip,
    you're still making it too complicated! :)

    i think you're getting confused by trying to combine directions from the perfect popup website, and zencart.

    just follow my directions that i posted as my last post, namely:

    1. DONT put the files in your "main_page" folder, follow the zencart directions here:



    which means, change the two file names from:
    add-event.js
    popup.js

    to:
    jscript_add-event.js
    jscript_popup.js

    and add them to your "includes/templates/{template_directory}/jscript/ " folder

    2. DONT use this on any page: (delete it!)

    it is not needed!

    3. what you wrote as code for the actual link should be correct! just need to put the jscript files in the correct location, and disregard the code you put at the top of the page.

    let me know how it goes!

    This is all correct... but you must also add a custom "tpl_modules_main_product_image.php" file in your custom template directory, so that the anchor link for the product image generates the popup.

    Replace the following line:
    Code:
    document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '\\\')">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>');
    with this line:
    Code:
    document.write('<?php echo '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '" rel="popup">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>');
    you may also fix the anchor link between the <noscript> tags, just add rel="popup" after target="_blank".

 

 

Similar Threads

  1. disable popups
    By tcjay in forum General Questions
    Replies: 0
    Last Post: 19 Oct 2010, 12:28 PM
  2. Popups
    By ChrystiLell in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 11 Mar 2010, 03:30 PM
  3. create popups
    By balihr in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 22 Dec 2009, 12:47 AM

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