Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20
  1. #11
    Join Date
    Apr 2014
    Location
    Canada
    Posts
    249
    Plugin Contributions
    0

    Default Re: Adding JavaScript to Blank Sidebox module

    Thanks for your help.

    Here my whole tpl_blank_sidebox.php @ my_template/sideboxes/
    Code:
    <?php
    /**
     * blank sidebox - allows a blank sidebox to be added to your site
     *
     * @package templateSystem
     * @copyright 2007 Kuroi Web Design
      * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: blank_sidebox.php 2007-05-26 kuroi $
     */
    
      $content = '';
      $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
    
      // Replace the text and HTML tags between the apostophes on lines 19 and 20.
      // Use as many or as few lines using this model as you need for your custom content.
      // If you have a multilingual site define your text in the languages/YOUR_LANGUAGE/extra_definitions/blank_sidebox_defines.php and include it as shown in line 19.
      // If your site is monolingual, you can put the text right here as shown on line 20 (and nobody will know!)
    $content .= '<div id="footer-payments">
    <center>
      <img src="' . $template->get_template_dir(\'\',DIR_WS_TEMPLATE, $current_page_base,'images') . '/' . FOOTER_PAYMENT_ICON"   alt="payments we accept" class="payments-image" /> 
    </center>
    </div>';
    
    $content .= '   <!-- Do not alter for the seal to work properly -->
        <div id="sslsSiteSeal">
            seal by <a href="http://ssls.com/">SSLs.com</a>
        </div>';
    ?>
    And here's my jscript_sslseal.js @ my_template/jscript/
    Code:
     (function() {
            var ss = document.createElement('script'); ss.type = 'text/javascript'; ss.async = true;
            ss.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'seal.ssls.com/script.js?cn=' + window.location.host;
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ss, s);
        })();

  2. #12
    Join Date
    Apr 2014
    Location
    Canada
    Posts
    249
    Plugin Contributions
    0

    Default Re: Adding JavaScript to Blank Sidebox module

    Just for kicks I commented out the payments icons to focus merely on the site seal and the site seal actually works. The positioning is way off but I'm confident I can figure that out on my own. Then I tried the same with the payment icons and even alone, that code breaks the site. One thing I noticed, which is odd to me because that same code worked when it was in the footer, the path is actually images/icons/ not just images. Is it just that perhaps?

  3. #13
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Adding JavaScript to Blank Sidebox module

    You have
    PHP Code:
    <img src="' . $template->get_template_dir(\'\',DIR_WS_TEMPLATE, $current_page_base,'images') . '/' . FOOTER_PAYMENT_ICON" 
    with one escaped set of quotes \'\' and one unescaped set 'images'. This is guaranteed to fail. Try
    PHP Code:
    <img src="' . $template->get_template_dir('',DIR_WS_TEMPLATE, $current_page_base,'images') . '/' . FOOTER_PAYMENT_ICON" 

  4. #14
    Join Date
    Apr 2014
    Location
    Canada
    Posts
    249
    Plugin Contributions
    0

    Default Re: Adding JavaScript to Blank Sidebox module

    Well, that was just leftovers from your suggestion in post #7. As was already suggested, I tried with both single quotes & either escaped. None of those options have worked. I also just tried the latest suggest method:
    Code:
    <img src="' . $template->get_template_dir('',DIR_WS_TEMPLATE, $current_page_base,'images') . '/' . FOOTER_PAYMENT_ICON"
    to no avail.

  5. #15
    Join Date
    Apr 2014
    Location
    Canada
    Posts
    249
    Plugin Contributions
    0

    Default Re: Adding JavaScript to Blank Sidebox module

    Although I've been copying/pasting perhaps there must be a mistake somewhere!? Here are the contents as is directly from my tpl_blank_sidebox.php:

    Code:
    <img src="' . $template->get_template_dir(''',DIR_WS_TEMPLATE, $current_page_base,'images') . '/' . FOOTER_PAYMENT_ICON"   alt="payments we accept" class="payments-image" />

  6. #16
    Join Date
    Apr 2014
    Location
    Canada
    Posts
    249
    Plugin Contributions
    0

    Default Re: Adding JavaScript to Blank Sidebox module

    I think I mentioned this already but...Seems to me the images couldn't show up because they're actually in a subfolder of images ie images/icons. Seems to me like that code is only looking for the image files in 'images' no? What contradicts that is that this *exact* code was functioning in the footer...I just don't understand php enough yet so....

    Sorry, I don't know what lead me to think the images were in a subfolder but they are not.
    Last edited by plc613; 16 May 2014 at 02:20 PM.

  7. #17
    Join Date
    Apr 2014
    Location
    Canada
    Posts
    249
    Plugin Contributions
    0

    Default Re: Adding JavaScript to Blank Sidebox module

    Before anyone wastes more energy on this...

    I gave up on the blank_sidebox in lieu of PayPal CreditCards Accepted. I simply split the siteseal snippet between the tpl_paypal_creditcards_sidebox.php and jscript as suggested earlier in this thread.

    Code:
      $content = '';
      $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';    
      $content .= '   <!-- Do not alter for the seal to work properly -->
        <div id="sslsSiteSeal">
            seal by <a href="http://ssls.com/">SSLs.com</a>
        </div>';
      $content .= '<p>' . TEXT_PAYPAL_CREDITCARDS_SIDEBOX . '</p>';
      $content .= '</div>';
    Don't know why we couldn't get things going with the previous add-on but perhaps by posting this code it may be obvious to someone.

    Thank you to everyone who tried so hard to get this working. Much appreciated.
    Last edited by plc613; 16 May 2014 at 03:16 PM.

  8. #18
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Adding JavaScript to Blank Sidebox module

    PHP Code:
    $template->get_template_dir(''',DIR_WS_TEMPLATE, 
    You have three single quotes here instead of two. If this is what was actually in your live file, it would cause an error due to the extra quote.

  9. #19
    Join Date
    Apr 2014
    Location
    Canada
    Posts
    249
    Plugin Contributions
    0

    Default Re: Adding JavaScript to Blank Sidebox module

    For what it's worth I had caught that to and removing the third single quote didn't fix the code. I suspect there is something outside the snippets I've shown that was effecting things.

  10. #20
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Adding JavaScript to Blank Sidebox module

    Without seeing the exact error message *and* the exact file content that accompanied it, it is only possible to guess.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Adding pages to blank sidebox
    By strike_noir in forum Addon Sideboxes
    Replies: 4
    Last Post: 31 Jan 2021, 09:19 AM
  2. v150 Blank Sidebox Blank Page after adding code for livechat software
    By whatisthat456 in forum Basic Configuration
    Replies: 8
    Last Post: 3 May 2012, 10:40 AM
  3. javascript in blank sidebox - livezilla
    By giftsandwhatnot in forum Addon Sideboxes
    Replies: 0
    Last Post: 10 Aug 2011, 04:56 AM
  4. adding another blank sidebox
    By macc88 in forum Basic Configuration
    Replies: 3
    Last Post: 29 Nov 2009, 05:20 PM
  5. Problem adding javascript to custom sidebox
    By etrader in forum Basic Configuration
    Replies: 2
    Last Post: 28 Aug 2006, 04:03 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR