X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Craft Syntax (https://forum.x-cart.com/showthread.php?t=71555)

toddpatterson 03-05-2015 10:14 AM

Craft Syntax
 
Good morning everyone. I have got what is going to be a really stupid question as I seem to be having a major case of brain farts this morning. :oops:

The following code is supposed to generate an insite chat. I am not quite sure at all where to put this at though. We are using the Ideal Responsive theme. I have tried to put this in the home.tpl and also the head.tpl files but am having no luck at all.

Any help at all is GREATLY appreciated. We just upgraded to the latest BETA, 4.7.0, last night.



<link type="text/css" rel="stylesheet" media="all" href="/chat/insite/sp_style.php" />
<script type="text/javascript">
var CSLHDir = "/chat/insite/";
var CSLHDept = "";
AllowVisitorChats='no';
</script>
<script src="/chat/insite/jquery.js"></script>
<script src="/chat/insite/spanel.js"></script>


*** JUST REALIZED I PLACED THIS IN THE WRONG FORUM. SORRY ***

cflsystems 03-05-2015 10:17 AM

Re: Craft Syntax
 
The script with the variables has to be included in {literal} tag
{literal}
code
{/literal}

You can add it to home.tpl - this will show it on all pages. Looking at the fiels probably best to add it in <head> section. Do not load jquery - it is already loaded with XC.

4.7.0 is BETA and should not be used for production. It is for testing only.

toddpatterson 03-05-2015 10:24 AM

Re: Craft Syntax
 
Thanks Steve. So am I correct in assuming that this should be going in the skin/common_files/customer/head.tpl file?

cflsystems 03-05-2015 10:27 AM

Re: Craft Syntax
 
you can have it there too if you want to but I would put it in home.tpl. head.tpl is the header of the page not the info that goes in <head> html section

toddpatterson 03-05-2015 10:31 AM

Re: Craft Syntax
 
Ok, then I am truly confused here. I have it in the skin/common_files/customer/home.tpl but am getting no response or change at all.

This is the home.tpl file right now:

{*
bdba23e63d47131e81d453a59ac6edd5b12881bb, v13 (xcart_4_6_3), 2014-02-27 11:55:58, home.tpl, mixon
vim: set ts=2 sw=2 sts=2 et:
*}
<?xml version="1.0" encoding="{$default_charset|default:"utf-8"}"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{config_load file="$skin_config"}
<html xmlns="http://www.w3.org/1999/xhtml"{if $active_modules.Socialize} xmlns:g="http://base.google.com/ns/1.0" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://ogp.me/ns/fb#"{/if}>
<head>

{*
*** START CHAT SEQUENCE
*}

{literal}

<link type="text/css" rel="stylesheet" media="all" href="/chat/insite/sp_style.php" />
<script type="text/javascript">
var CSLHDir = "/chat/insite/";
var CSLHDept = "";
AllowVisitorChats='no';
</script>
<script src="/chat/insite/jquery.js"></script>
<script src="/chat/insite/spanel.js"></script>

{/literal}

{*
*** END CHAT SEQUENCE
*}


{include file="customer/service_head.tpl"}
<link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
</head>
<body{if $body_onload ne ''} onload="javascript: {$body_onload}"{/if}{if $container_classes} class="{foreach from=$container_classes item=c}{$c} {/foreach}"{/if}>
{if $active_modules.EU_Cookie_Law}
{include file="modules/EU_Cookie_Law/info_panel.tpl"}
{/if}
{if $main eq 'product' and $is_admin_preview}
{include file="customer/main/product_admin_preview_top.tpl"}
{/if}
<div id="page-container"{if $page_container_class} class="{$page_container_class}"{/if}>
<div id="page-container2">
<div id="content-container">
<div id="content-container2">

{if $active_modules.Socialize
and ($config.Socialize.soc_fb_like_enabled eq "Y" or $config.Socialize.soc_fb_send_enabled eq "Y")
}
<div id="fb-root"></div>
{/if}

{include file="customer/content.tpl"}

</div>
</div>

<div class="clearing">&nbsp;</div>

<div id="header">
{include file="customer/head.tpl"}
</div>

<div id="footer">

{if $active_modules.Users_online}
{include file="modules/Users_online/menu_users_online.tpl"}
{/if}

{include file="customer/bottom.tpl"}

</div>

{if $active_modules.Google_Analytics and $config.Google_Analytics.ganalytics_version eq 'Traditional'}
{include file="modules/Google_Analytics/ga_code.tpl"}
{/if}

</div>
</div>
{load_defer_code type="css"}
{include file="customer/service_body_js.tpl"}
{load_defer_code type="js"}


</body>
</html>

toddpatterson 03-05-2015 10:34 AM

Re: Craft Syntax
 
Also tried placing the code in the skin/ideal_responsive/customer/home.tpl with the same result....

cherie 03-11-2015 05:04 PM

Re: Craft Syntax
 
That script block does not require literal tags (no braces present).

"sp_style.php" is not a common stylesheet file. You may want to doublecheck that is correct.

jQuery should already be loaded so check that you really need that jquery.js line. Then I would load all of these script lines after jQuery loads. Your browser page source should help you see where things are placed.

I don't recommend modifying anything in skin/common_files if you can avoid it. You should have a custom skin directory and use that for making changes.

Once you've added the code check the browser page source to see if the new lines are added. If not then you're in the wrong file or you need to clear the template cache. If you can't find the right file try using Webmaster Mode.


All times are GMT -8. The time now is 08:06 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.