Jump to content

Resolved - problem adding box


Recommended Posts

I wanted to add a box to the right, so I made

 

It would be very similar, actually. In main.php, find:

            <div class="row {$SECTION_NAME}_wrapper">
               <div class="small-12 large-9 columns small-collapse">
                  {include file='templates/box.errors.php'}
                  {include file='templates/box.progress.php'}
                  {$PAGE_CONTENT}
               </div>
               <div class="large-3 columns show-for-large-up">
                  {include file='templates/box.featured.php'}
                  {include file='templates/box.popular.php'}
                  {include file='templates/box.sale_items.php'}
               </div>
               <a href="#" class="back-to-top"><i class="fa fa-angle-up"></i> {$LANG.common.top}</a>
            </div>

The second nested div block -- "large-3" -- has a series of includes. Add another:

                  {include file='templates/box.port.php'}

 

and the box.port.php I file

<div class="panel" id="box-port">
   <h3>frais de port</h3>
<canvas height="225" id="offert" onclick="this.focus();" oncontextmenu="return false;" style="outline: none" width="225"> </canvas> <script type="text/javascript"
    src="http://www.santonspeyroncampagna.com/boutique/santons-de-provence/peyron-campagna/fraisdeport/offert/offert.js">
    </div>

 

but when I checked the operation, my footer disappeared and the image that should appear company does not appear.

 

Link to comment
Share on other sites

I do not see the closing </script> tag.

Hello, I change my box.port.php file as below

<div class="panel" id="box-port">
   <h3>frais de port</h3>
<canvas height="225" id="offert" onclick="this.focus();" oncontextmenu="return false;" style="outline: none" width="225"> </canvas> <script type="text/javascript"
    src="http://www.santonspeyroncampagna.com/boutique/santons-de-provence/peyron-campagna/fraisdeport/offert/offert.js">
    </div>
    </script>

but now my whole page went black. over my image in the new box Appear when I'm in a category. but not on the welcome page
see screenshot below

Capture2.thumb.JPG.6d4a8b98959408003e5ed

category

Capture1.thumb.JPG.c923e4f4aba889152a43b

Link to comment
Share on other sites

For the box code, try:

<div class="panel" id="box-port">
  <h3>frais de port</h3>
  <canvas height="225" id="offert" onclick="this.focus();" oncontextmenu="return false;" style="outline: none" width="225"></canvas>
  <script type="text/javascript" src="http://www.santonspeyroncampagna.com/boutique/santons-de-provence/peyron-campagna/fraisdeport/offert/offert.js"></script>
</div>

Your latest edit has put the closing </script> tag in the wrong place.

Link to comment
Share on other sites

This is my guess: Also on the Homepage, you have a <canvas id="offert"> as part of the Homepage document. The "frais de port" box has <canvas id="offert">.

In many cases, javascript is not coded to control more than one item with the same ID.

So, for the side box, use <canvas id="side_offert"> and for the javascript file, /fraisdeport/offert/side_offert.js, code it to use var a=document.getElementById("side_offert").

Link to comment
Share on other sites

Open this file for editing: /fraisdeport/offert/offert.js

Near the beginning, there are two places where you will find document.getElementById("offert")

Change offert to side_offert in both places. Save the file as /fraisdeport/offert/side_offert.js

You may wish to ask for assistance from the authors of this javascript canvas code.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...