Results 1 to 10 of 20

Hybrid View

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

    Default Re: Adding JavaScript to Blank Sidebox module

    Missed one :)
    This bit
    $template->get_template_dir('',DIR_WS_TEMPLATE, $current_page_base,\'images\')
    needs either the first '' (two single quotes) escaped (\'\'), or the second set \'images\' not escaped ('images'); I forget which at the moment... think the escapes are not needed here. Try it both ways.

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

    Default Re: Adding JavaScript to Blank Sidebox module

    Try it both ways.
    Didn't help.

    Question; is the code suppose to be a continuous line?

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

    Default Re: Adding JavaScript to Blank Sidebox module

    In case this will help, here's an entry in the logs I suspect is related to the code:

    [15-May-2014 10:09:01 America/New_York] PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/littlecl/HIDDEN/dev/includes/templates/piccadilly_posh/sideboxes/tpl_blank_sidebox.php on line 19

    Line 19 is:
    $content .= '<div id="footer-payments">

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

    Default Re: Adding JavaScript to Blank Sidebox module

    If you use line breaks in the define, they will show in the "view source" of your output. They will not break a define unless you are doing something else wrong.

    One of the escaping options *will* work while the other won't. This means you have some other error in your code. Post your tpl_blank_sidebox.php so we can see exactly how you are adding the content. Also, exactly what you did with the javascript and where.

  5. #5
    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);
        })();

  6. #6
    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?

  7. #7
    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" 

  8. #8
    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.

  9. #9
    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" />

 

 

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

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