-
CSS JS Loader [Support Thread]
Since I didn't find a support thread for the CSS/JS Loader (http://www.zen-cart.com/downloads.php?do=file&id=1774), I've created this one!
I've installed v3.0.2 on a v1.5.3 test site and it's working quite well! I did make the following changes before I installed:
1. I run local test sites for all my installations, with a /includes/local/configure.php file to allow me to keep the /includes/configure.php as it is in the "live" store. The following change to /min/config.php allows that environment to work properly with the loader:
Code:
// added for Zen Cart
//-20140806-lat9-Enable proper operation if a local configure.php file is being used.
if (file_exists('../includes/local/configure.php')) {
include('../includes/local/configure.php');
} else {
include('../includes/configure.php');
}
//-eof-20140806-lat9
2. The new-install script "kills" configuration_group_id = 0 in the configuration table; I made the following change to /YOUR_ADMIN/includes/installers/css_js_loader/new_install.php:
Code:
<?php
$configuration = $db->Execute("SELECT configuration_group_id FROM " . TABLE_CONFIGURATION_GROUP . " WHERE configuration_group_title = 'CSS/JS Loader' OR configuration_group_title = 'CSS/JS Loader Configuration';");
if ($configuration->RecordCount() > 0) {
while (!$configuration->EOF) {
$db->Execute("DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_group_id = " . $configuration->fields['configuration_group_id'] . ";");
$db->Execute("DELETE FROM " . TABLE_CONFIGURATION_GROUP . " WHERE configuration_group_id = " . $configuration->fields['configuration_group_id'] . ";");
$configuration->MoveNext();
}
}
//$db->Execute("DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_group_id = 0;"); //-20140806-lat9-Don't kill CGI(0)!
$db->Execute("DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = '';");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION_GROUP . " (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (NULL, 'CSS/JS Loader Configuration', 'Set CSS/JS Loader Options', '1', '1');");
$configuration_group_id = $db->Insert_ID();
$db->Execute("UPDATE " . TABLE_CONFIGURATION_GROUP . " SET sort_order = " . $configuration_group_id . " WHERE configuration_group_id = " . $configuration_group_id . ";");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES
('Version', 'CSS_JS_LOADER_VERSION', '2.0.0', 'Installed Version', " . $configuration_group_id . ", 0, NOW(), NOW(), NULL, 'trim('),
('Enable Minify', 'MINIFY_STATUS', 'true', 'Minifying will speed up your site\'s loading speed by combining and compressing css/js files (valid CSS and JS are required).', " . $configuration_group_id . ", 10, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\'true\', \'false\'),'),
('Max URL Length', 'MINIFY_MAX_URL_LENGHT', '500', 'On some servers the maximum length of any POST/GET request URL is limited. If this is the case for your server, you can change the setting here', " . $configuration_group_id . ", 20, NOW(), NOW(), NULL, NULL),
('Minify Cache Time', 'MINIFY_CACHE_TIME_LENGHT', '31536000', 'Set minify cache time (in second). Default is 1 year (31536000)', " . $configuration_group_id . ", 30, NOW(), NOW(), NULL, NULL),
('Latest Cache Time', 'MINIFY_CACHE_TIME_LATEST', '0', 'Normally you don\'t have to set this, but if you have just made changes to your js/css files and want to make sure they are reloaded right away, you can reset this to 0.', " . $configuration_group_id . ", 40, NOW(), NOW(), NULL, NULL)");
-
Re: CSS JS Loader [Support Thread]
There are plans to rebuild the auto_installer. I'm sure that will be resolved with that change
-
Re: CSS JS Loader [Support Thread]
Hi everyone I am trying to get CSS/JS Loader installed as a first step to installing Fast and Easy checkout.
I am running V1.5.3 with PHP 5.5.3
I have installed the latest available version ( v3.0.2 ? ) which broke the site. After enabling the minify's in admin I got back a large portion of CSS functionality , but there are still some CSS's that are being blocked.
Further it slows the site down by almost 2 seconds.
Un-installing and modifying the " new_install.php " just produces he same results.
The cache time thru all this always stays at : 1407828153 (I have reset it to zero a number of times )
I have not worked on the config in /min/config.php
Anybody got any pointers for me?
-
Re: CSS JS Loader [Support Thread]
The /plugins directory created by this plugin needs an .htaccess and empty index.html to prevent the directory structure from being "snooped":
Code:
#
# @copyright Copyright 2003-2010 Zen Cart Development Team
# @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
# @version $Id: .htaccess 16111 2010-04-29 22:39:02Z drbyte $
#
# This is used with Apache WebServers
#
# The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved exceptions
# It also prevents the ability of any scripts to run. No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.
# Will also prevent people from seeing what is in the dir. and any sub-directories
#
# For this to work, you must include either 'All' or at least: 'Limit' and 'Indexes' parameters to the AllowOverride configuration in your apache/conf/httpd.conf file.
# Additionally, if you want the added protection offered by the OPTIONS directive below, you'll need to add 'Options' to the AllowOverride list, if 'All' is not specified.
# Example:
#<Directory "/usr/local/apache/htdocs">
# AllowOverride Limit Options Indexes
#</Directory>
###############################
# deny *everything*
<FilesMatch ".*">
Order Allow,Deny
Deny from all
</FilesMatch>
# but now allow just *certain* necessary files:
<FilesMatch ".*\.(php|html)$">
Order Allow,Deny
Allow from all
</FilesMatch>
IndexIgnore */*
OPTIONS -Indexes -ExecCGI
Code:
<html>
<head>
<title></title>
<meta content="">
<style></style>
</head>
<body></body>
</html>
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
lat9
The /plugins directory created by this plugin needs an .htaccess and empty index.html to prevent the directory structure from being "snooped":
Code:
#
# @copyright Copyright 2003-2010 Zen Cart Development Team
# @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
# @version $Id: .htaccess 16111 2010-04-29 22:39:02Z drbyte $
#
# This is used with Apache WebServers
#
# The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved exceptions
# It also prevents the ability of any scripts to run. No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.
# Will also prevent people from seeing what is in the dir. and any sub-directories
#
# For this to work, you must include either 'All' or at least: 'Limit' and 'Indexes' parameters to the AllowOverride configuration in your apache/conf/httpd.conf file.
# Additionally, if you want the added protection offered by the OPTIONS directive below, you'll need to add 'Options' to the AllowOverride list, if 'All' is not specified.
# Example:
#<Directory "/usr/local/apache/htdocs">
# AllowOverride Limit Options Indexes
#</Directory>
###############################
# deny *everything*
<FilesMatch ".*">
Order Allow,Deny
Deny from all
</FilesMatch>
# but now allow just *certain* necessary files:
<FilesMatch ".*\.(php|html)$">
Order Allow,Deny
Allow from all
</FilesMatch>
IndexIgnore */*
OPTIONS -Indexes -ExecCGI
Code:
<html>
<head>
<title></title>
<meta content="">
<style></style>
</head>
<body></body>
</html>
lat9,
The change you have recommended has added to the module, and should be submitted for moderation shortly.
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
bislewl
lat9,
The change you have recommended has added to the module, and should be submitted for moderation shortly.
Excellent! Thanks much.
-
Re: CSS JS Loader [Support Thread]
Alright, so I validated my css's and disabled minify option in admin config, BUT it's still breaking my site.
My template frame's are now whole page wide, categories bars in sidebox are full page wide etc.
looks like this:
http://i61.tinypic.com/333adc3.jpg
Upon validation I removed *zoom property from css. Could this be responsible for good look of my page?
I noticed that now links in my footer has additional display:none, but when I'm checking this with chrome dev tools, it shows no source.
It doesn't make much sense to me.
-
Re: CSS JS Loader [Support Thread]
any errors in /logs?
how many version of jquery are you running? should be 1.11.0 and migrate 1.2.1, in my opinion.
-
Re: CSS JS Loader [Support Thread]
There's nothing in logs. I don't know where to check jquery.
-
Re: CSS JS Loader [Support Thread]
in your <HEAD> what are the js files that are loading sometimes things get messed up and the javascript files get loaded in the body as well
also jquery should be the first with migrate being the 2nd
-
Re: CSS JS Loader [Support Thread]
I got the answer. Problem was with proper merging in includes/templates/MYTEMPLATE/common/html_header.php
After replacing this file with html_header from css js loader, I had to add little line of code just before closing tag ?> :
PHP Code:
if (COLUMN_WIDTH == '0') {
echo '';
} else {
echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . 'responsive.css' . '" />';
}
After this everything works just fine!
(Before that, I tried to include all code from new and old html_header, but my css's was loaded twice this way :D slowing down my site)
Cheers, thanks for help!
-
Re: CSS JS Loader [Support Thread]
That won't use the full benefits of CSS/JS loader you SHOULD add an auto-loader lets call it loader_responsive.php
as
includes/templates/MYTEMPLATE/common/loader_responsive.php
it should look something like this:
PHP Code:
<?php
if (COLUMN_WIDTH == '0') {
$loaders[] = array('conditions' => array('pages' => array('*')),
'css_files' => array(
'responsive.css' => 1)
);
}
Then it will minify (if properly validated)
-
Re: CSS JS Loader [Support Thread]
I have some problems with responsive design on my site.
I will need to merge this html_header properly this time, probably build this auto-loaders. I have never done this so far, for now I'm not even sure what lines of code should I attach in this loaders. Any tips?
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
khejit
I have some problems with responsive design on my site.
I will need to merge this html_header properly this time, probably build this auto-loaders. I have never done this so far, for now I'm not even sure what lines of code should I attach in this loaders. Any tips?
This is typically what i do, typically I can do all of this in +/- 1 hour and get all the JS working properly, but that's with a lot of practice, I have probably built/modified 4-500 of these autoloaders.
1.) Take all the lines of code in the html_header.php that direct to css/js files remove them and then add the css/js loader code, from the sample.
2.) Then take all the js files and move them into a sub directory of /jscript
for this example I will move them to /jquery this will prevent them from loading automatically.
Use the loader to load each of the files, you would only want to load 1 jquery library.
Right now I'm using jquery-1.11.0.min.js, and jquery-migrate-1.2.1.min.js
Here is the link to download the 3 files you will need http://jquery.com/download/
3.) add these files to your includes/templates/YOUR_TEPLATE/jscript/jquery/
jquery-1.11.0.min.js
jquery-migrate-1.2.1.min.js
jquery-1.11.0.min.map (you don't need to reference this in the loader)
4.) In your includes/.htaccess add "map" as an allowed filetype.
just add the | and than map like this here:
PHP Code:
# but now allow just *certain* necessary files:
<FilesMatch ".*\.(js|JS|css|CSS|jpg|JPG|gif|GIF|png|PNG|swf|SWF|xsl|XSL|eot|otf|svg|ttf|woff|cur|map)$">
Order Allow,Deny
Allow from all
</FilesMatch>
5.) Create a site wide autoloader
PHP Code:
$loaders[] = array(
'conditions' => array('pages' => array('*')),
'jscript_files' => array(
'jquery/jquery-1.11.0.min.js' => 1,
'jquery/jquery-migrate-1.2.1.min.js' => 2,
'jquery/jscript_templatefile.js' => 3,
'jquery/jscript_anotherfile.php' => 4
),
'css_files' => array(
'stylesheet.css' => 1,
'style_imagehover.css' => 2,
'stylesheet_css_buttons.css' => 3,
'stylesheet_layout.css' => 4,
'stylesheet_template.php' => 5
)
);
You will want to make sure that all the js files are loaded in the correct order:
jquery-1.11.0.min.js
jquery-migrate-1.2.1.min.js
than pretty much everything else.
6.) Load the page and look in your <head> to find out which ones are still loading outside of a css/js auto-loader, many times especially theme forest & template monster templates, will load these from functions & classes files. Some load them from includes/modules/pages/THIS_PAGE/ others form an init file, and there are a few others that load them weird, so you will need to move those files to the /jquery and then remove their references. T
NOTE: to minimize the amount of css/js that is loaded is one of the great benefits of css/js loader. And many templates just load all css/js files no matter what. So for example a homepage slider doesn't need those css/js files loaded on the product_info page. so you can make a separate auto-loader file, like this loader.
PHP Code:
$loaders[] = array('conditions' => array('pages' => array('index_home')),
'jscript_files' => array(
'jquery/jquery-1.11.0.min.js' => 1,
'jquery/jquery-migrate-1.2.1.min.js' => 2,
'jquery/jquery.blockUI.js' => 3,
'jquery/jquery.jcarousel.js' => 4,
'jquery/jquery_index_carousel.js' => 5
),
'css_files' => array(
'jcarousel.css' => 3
)
);
Hopefully that helps make things a little clearer.
-
Re: CSS JS Loader [Support Thread]
Merry Christmas everyone!
I was wondering whether someone could help me with the following.
I am trying to install CSS/JS Loader as a first step to installing Fast and Easy Checkout, but I'm not sure whether I've installed everything correctly. I am running Zen Cart version 1.5.1 with PHP 5.4.
At the moment my html_header.php file looks like this:
Code:
<?php
/**
* Common Template
*
* outputs the html header. i,e, everything that comes before the \</head\> tag <br />
*
* @package templateSystem
* @copyright Copyright 2003-2012 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version GIT: $Id: Author: DrByte Tue Jul 17 16:02:00 2012 -0400 Modified in v1.5.1 $
*/
/**
* load the module for generating page meta-tags
*/
require(DIR_WS_MODULES . zen_get_module_directory('meta_tags.php'));
/**
* load the module which retrieves data from the database
*/
require(DIR_WS_MODULES . zen_get_module_directory('main_page.php'));
/**
* output main page HEAD tag and related headers/meta-tags, etc
*/
?>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js gt-ie8"> <!--<![endif]-->
<head>
<title><?php echo META_TAG_TITLE; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="keywords" content="<?php echo META_TAG_KEYWORDS; ?>" />
<meta name="description" content="<?php echo META_TAG_DESCRIPTION; ?>" />
<meta http-equiv="imagetoolbar" content="no" />
<!-- ===================== Fonts ===================== -->
<link href='//fonts.googleapis.com/css?family=Oswald:400,300,700' rel='stylesheet' type='text/css'>
<!-- ===================== Touch Icons ===================== -->
<link rel="shortcut icon" href="favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="includes/templates/mars/images/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="includes/templates/mars/images/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="includes/templates/mars/images/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="includes/templates/mars/images/apple-touch-icon-precomposed.png">
<!-- ===================== Facebook "like" Meta Tags ===================== -->
<meta property="og:title" content="<?php echo META_TAG_TITLE; ?>" />
<meta property="og:url" content="http://<?php echo $_SERVER["SERVER_NAME"]?><?php echo $_SERVER['REQUEST_URI'];?>" />
<?php if(META_TAG_PRODUCT_IMAGE=="META_TAG_PRODUCT_IMAGE"){?>
<meta property="og:image" content="<?php echo HTTP_SERVER . DIR_WS_CATALOG ?>includes/templates/mars/images/logo.png"; />
<?php }else{ ?>
<meta property="og:image" content="<?php echo HTTP_SERVER . DIR_WS_CATALOG ?>images/<?php echo META_TAG_PRODUCT_IMAGE;?>" />
<meta property="og:type" content="product" />
<?php } ?>
<meta property="og:site_name" content="<?php echo META_TAG_TITLE; ?>"/>
<meta property="og:description" content="<?php echo META_TAG_DESCRIPTION; ?>"/>
<meta property="og:locale" content="en_US" />
<!-- <meta name="author" content="The Zen Cart® Team and others" /> -->
<!-- <meta name="generator" content="shopping cart program by Zen Cart®, http://www.zen-cart.com eCommerce" /> -->
<?php if (defined('ROBOTS_PAGES_TO_SKIP') && in_array($current_page_base,explode(",",constant('ROBOTS_PAGES_TO_SKIP'))) || $current_page_base=='down_for_maintenance' || $robotsNoIndex === true) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } ?>
<?php if (defined('FAVICON')) { ?>
<link rel="icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<?php } //endif FAVICON ?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ); ?>" />
<?php if (isset($canonicalLink) && $canonicalLink != '') { ?>
<link rel="canonical" href="<?php echo $canonicalLink; ?>" />
<?php } ?>
<?php
/**
* load all template-specific stylesheets, named like "style*.css", alphabetically
*/
$site_theme = $general_site_options->fields['general_site_theme'];
if(isset($site_theme)){
$site_theme_file = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . '/' . $site_theme . '.css';
if (file_exists($site_theme_file)) {
echo '<link rel="stylesheet" type="text/css" href="' . $site_theme_file .'" />'."\n";
}else{
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^style/', '.css');
while(list ($key, $value) = each($directory_array)) {
echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n";
}
}
}else {
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^style/', '.css');
while(list ($key, $value) = each($directory_array)) {
echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n";
}
}
/**
* load stylesheets on a per-page/per-language/per-product/per-manufacturer/per-category basis. Concept by Juxi Zoza.
*/
$manufacturers_id = (isset($_GET['manufacturers_id'])) ? $_GET['manufacturers_id'] : '';
$tmp_products_id = (isset($_GET['products_id'])) ? (int)$_GET['products_id'] : '';
$tmp_pagename = ($this_is_home_page) ? 'index_home' : $current_page_base;
if ($current_page_base == 'page' && isset($ezpage_id)) $tmp_pagename = $current_page_base . (int)$ezpage_id;
$sheets_array = array('/' . $_SESSION['language'] . '_stylesheet',
'/' . $tmp_pagename,
'/' . $_SESSION['language'] . '_' . $tmp_pagename,
'/c_' . $cPath,
'/' . $_SESSION['language'] . '_c_' . $cPath,
'/m_' . $manufacturers_id,
'/' . $_SESSION['language'] . '_m_' . (int)$manufacturers_id,
'/p_' . $tmp_products_id,
'/' . $_SESSION['language'] . '_p_' . $tmp_products_id
);
while(list ($key, $value) = each($sheets_array)) {
//echo "<!--looking for: $value-->\n";
$perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . $value . '.css';
if (file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n";
}
/**
* custom category handling for a parent and all its children ... works for any c_XX_XX_children.css where XX_XX is any parent category
*/
$tmp_cats = explode('_', $cPath);
$value = '';
foreach($tmp_cats as $val) {
$value .= $val;
$perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . '/c_' . $value . '_children.css';
if (file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n";
$perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . '/' . $_SESSION['language'] . '_c_' . $value . '_children.css';
if (file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n";
$value .= '_';
}
/**
* load printer-friendly stylesheets -- named like "print*.css", alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^print/', '.css');
sort($directory_array);
while(list ($key, $value) = each($directory_array)) {
echo '<link rel="stylesheet" type="text/css" media="print" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n";
}
?>
<?php
/**
* load the Mars custom css file, you can edit the content by going to Tools -> Define Pages Editor -> define_custom_css.php
*/
require(zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_CUSTOM_CSS, 'false'));
?>
<?php
/**
* load all site-wide jscript_*.js files from includes/templates/YOURTEMPLATE/jscript, alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript'), '/^jscript_/', '.js');
while(list ($key, $value) = each($directory_array)) {
echo '<script type="text/javascript" src="' . $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/' . $value . '"></script>'."\n";
}
/**
* load all page-specific jscript_*.js files from includes/modules/pages/PAGENAME, alphabetically
*/
$directory_array = $template->get_template_part($page_directory, '/^jscript_/', '.js');
while(list ($key, $value) = each($directory_array)) {
echo '<script type="text/javascript" src="' . $page_directory . '/' . $value . '"></script>' . "\n";
}
/**
* load all site-wide jscript_*.php files from includes/templates/YOURTEMPLATE/jscript, alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'jscript'), '/^jscript_/', '.php');
while(list ($key, $value) = each($directory_array)) {
/**
* include content from all site-wide jscript_*.php files from includes/templates/YOURTEMPLATE/jscript, alphabetically.
* These .PHP files can be manipulated by PHP when they're called, and are copied in-full to the browser page
*/
require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/' . $value); echo "\n";
}
/**
* include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically.
*/
$directory_array = $template->get_template_part($page_directory, '/^jscript_/');
while(list ($key, $value) = each($directory_array)) {
/**
* include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically.
* These .PHP files can be manipulated by PHP when they're called, and are copied in-full to the browser page
*/
require($page_directory . '/' . $value); echo "\n";
}
// DEBUG: echo '<!-- I SEE cat: ' . $current_category_id . ' || vs cpath: ' . $cPath . ' || page: ' . $current_page . ' || template: ' . $current_template . ' || main = ' . ($this_is_home_page ? 'YES' : 'NO') . ' -->';
?>
<?php
/**
* load the necessary custom Mars theme script files
*/
require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_JS_HEADER));
?>
</head>
<?php // NOTE: Blank line following is intended: ?>
I've merged the CSS JS Loader html_header.php, which looks like this:
Code:
<?php
/**
* Common Template
*
* outputs the html header. i,e, everything that comes before the \</head\> tag <br />
*
* @package templateSystem
* @copyright Copyright 2003-2010 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: html_header.php 6 2012-05-07 21:43:01Z numinix $
*/
/**
* load the module for generating page meta-tags
*/
require(DIR_WS_MODULES . zen_get_module_directory('meta_tags.php'));
/**
* output main page HEAD tag and related headers/meta-tags, etc
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>
<head>
<title><?php echo META_TAG_TITLE; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
<meta name="keywords" content="<?php echo META_TAG_KEYWORDS; ?>" />
<meta name="description" content="<?php echo META_TAG_DESCRIPTION; ?>" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="author" content="The Zen Cart™ Team and others" />
<meta name="generator" content="shopping cart program by Zen Cart™, http://www.zen-cart.com eCommerce" />
<?php if (defined('ROBOTS_PAGES_TO_SKIP') && in_array($current_page_base,explode(",",constant('ROBOTS_PAGES_TO_SKIP'))) || $current_page_base=='down_for_maintenance' || $robotsNoIndex === true) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } ?>
<?php if (defined('FAVICON')) { ?>
<link rel="icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<?php } //endif FAVICON ?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ); ?>" />
<?php if (isset($canonicalLink) && $canonicalLink != '') { ?>
<link rel="canonical" href="<?php echo $canonicalLink; ?>" />
<?php } ?>
<?php
/**
* load the loader files
*/
if($RI_CJLoader->get('status') && (!isset($Ajax) || !$Ajax->status())){
$RI_CJLoader->autoloadLoaders();
$RI_CJLoader->loadCssJsFiles();
$files = $RI_CJLoader->header();
foreach($files['css'] as $file)
if($file['include']) {
include($file['src']);
} else if (!$RI_CJLoader->get('minify_css') || $file['external']) {
echo '<link rel="stylesheet" type="text/css" href="'.$file['src'].'" />'."\n";
} else {
echo '<link rel="stylesheet" type="text/css" href="min/?f='.$file['src'].'&'.$RI_CJLoader->get('minify_time').'" />'."\n";
}
foreach($files['jscript'] as $file)
if($file['include']) {
include($file['src']);
} else if(!$RI_CJLoader->get('minify_js') || $file['external']) {
echo '<script type="text/javascript" src="'.$file['src'].'"></script>'."\n";
} else {
echo '<script type="text/javascript" src="min/?f='.$file['src'].'&'.$RI_CJLoader->get('minify_time').'"></script>'."\n";
}
}
//DEBUG: echo '<!-- I SEE cat: ' . $current_category_id . ' || vs cpath: ' . $cPath . ' || page: ' . $current_page . ' || template: ' . $current_template . ' || main = ' . ($this_is_home_page ? 'YES' : 'NO') . ' -->';
?>
</head>
<?php // NOTE: Blank line following is intended: ?>
With my current html_header.php, to look like this:
Code:
<?php
/**
* Common Template
*
* outputs the html header. i,e, everything that comes before the \</head\> tag <br />
*
* @package templateSystem
* @copyright Copyright 2003-2012 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version GIT: $Id: Author: DrByte Tue Jul 17 16:02:00 2012 -0400 Modified in v1.5.1 $
*/
/**
* load the module for generating page meta-tags
*/
require(DIR_WS_MODULES . zen_get_module_directory('meta_tags.php'));
/**
* load the module which retrieves data from the database
*/
require(DIR_WS_MODULES . zen_get_module_directory('main_page.php'));
/**
* output main page HEAD tag and related headers/meta-tags, etc
*/
?>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js gt-ie8"> <!--<![endif]-->
<head>
<title><?php echo META_TAG_TITLE; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="keywords" content="<?php echo META_TAG_KEYWORDS; ?>" />
<meta name="description" content="<?php echo META_TAG_DESCRIPTION; ?>" />
<meta http-equiv="imagetoolbar" content="no" />
<!-- ===================== Fonts ===================== -->
<link href='//fonts.googleapis.com/css?family=Oswald:400,300,700' rel='stylesheet' type='text/css'>
<!-- ===================== Touch Icons ===================== -->
<link rel="shortcut icon" href="favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="includes/templates/mars/images/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="includes/templates/mars/images/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="includes/templates/mars/images/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="includes/templates/mars/images/apple-touch-icon-precomposed.png">
<!-- ===================== Facebook "like" Meta Tags ===================== -->
<meta property="og:title" content="<?php echo META_TAG_TITLE; ?>" />
<meta property="og:url" content="http://<?php echo $_SERVER["SERVER_NAME"]?><?php echo $_SERVER['REQUEST_URI'];?>" />
<?php if(META_TAG_PRODUCT_IMAGE=="META_TAG_PRODUCT_IMAGE"){?>
<meta property="og:image" content="<?php echo HTTP_SERVER . DIR_WS_CATALOG ?>includes/templates/mars/images/logo.png"; />
<?php }else{ ?>
<meta property="og:image" content="<?php echo HTTP_SERVER . DIR_WS_CATALOG ?>images/<?php echo META_TAG_PRODUCT_IMAGE;?>" />
<meta property="og:type" content="product" />
<?php } ?>
<meta property="og:site_name" content="<?php echo META_TAG_TITLE; ?>"/>
<meta property="og:description" content="<?php echo META_TAG_DESCRIPTION; ?>"/>
<meta property="og:locale" content="en_US" />
<!-- <meta name="author" content="The Zen Cart® Team and others" /> -->
<!-- <meta name="generator" content="shopping cart program by Zen Cart®, http://www.zen-cart.com eCommerce" /> -->
<?php if (defined('ROBOTS_PAGES_TO_SKIP') && in_array($current_page_base,explode(",",constant('ROBOTS_PAGES_TO_SKIP'))) || $current_page_base=='down_for_maintenance' || $robotsNoIndex === true) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } ?>
<?php if (defined('FAVICON')) { ?>
<link rel="icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<?php } //endif FAVICON ?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ); ?>" />
<?php if (isset($canonicalLink) && $canonicalLink != '') { ?>
<link rel="canonical" href="<?php echo $canonicalLink; ?>" />
<?php } ?>
<?php
/**
* load the loader files
*/
if($RI_CJLoader->get('status') && (!isset($Ajax) || !$Ajax->status())){
$RI_CJLoader->autoloadLoaders();
$RI_CJLoader->loadCssJsFiles();
$files = $RI_CJLoader->header();
foreach($files['css'] as $file)
if($file['include']) {
include($file['src']);
} else if (!$RI_CJLoader->get('minify_css') || $file['external']) {
echo '<link rel="stylesheet" type="text/css" href="'.$file['src'].'" />'."\n";
} else {
echo '<link rel="stylesheet" type="text/css" href="min/?f='.$file['src'].'&'.$RI_CJLoader->get('minify_time').'" />'."\n";
}
foreach($files['jscript'] as $file)
if($file['include']) {
include($file['src']);
} else if(!$RI_CJLoader->get('minify_js') || $file['external']) {
echo '<script type="text/javascript" src="'.$file['src'].'"></script>'."\n";
} else {
echo '<script type="text/javascript" src="min/?f='.$file['src'].'&'.$RI_CJLoader->get('minify_time').'"></script>'."\n";
}
}
//DEBUG: echo '<!-- I SEE cat: ' . $current_category_id . ' || vs cpath: ' . $cPath . ' || page: ' . $current_page . ' || template: ' . $current_template . ' || main = ' . ($this_is_home_page ? 'YES' : 'NO') . ' -->';
?>
<?php
/**
* load the necessary custom Mars theme script files
*/
require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_JS_HEADER));
?>
</head>
<?php // NOTE: Blank line following is intended: ?>
Everything seems to be in working order, but I have the feeling that I might be overlooking something. Before I go live, could someone perhaps take a quick look and point out any obvious errors I might be overlooking?
-
Re: CSS JS Loader [Support Thread]
I installed CSS/JS Loader to improve the load speed of the responsive template Sheffield Blue
(which is a free responsive template offered on the forum).
It threw the look of the template out completely ... but luckily Id stored away the html_header.php file before the CSS/JS Loader version overwrote it.
Ive been trying to follow what is going on in this forum and Im wondering if I can be helped to piece together a new html_header.php and get this product to work (or is there more to it than just merging the coding). Or should I just sit tight and wait for a new version of CSS/JS Loader?.
I have just gone live with the new site using v1.5.4 of Zen Cart and havent installed Fast and Easy checkout. (www.tidytoys.co.uk) I dont have any php coding experience or knowledge of what the code is doing.
The coding that is currently in the html_header.file is this ...
PHP Code:
<?php
/**
* Common Template
*
* outputs the html header. i,e, everything that comes before the \</head\> tag <br />
*
* @package templateSystem
* @copyright Copyright 2003-2012 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version GIT: $Id: Author: DrByte Tue Jul 17 16:02:00 2012 -0400 Modified in v1.5.1 $
*/
/**
* load the module for generating page meta-tags
*/
require(DIR_WS_MODULES . zen_get_module_directory('meta_tags.php'));
/**
* output main page HEAD tag and related headers/meta-tags, etc
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>
<head>
<title><?php echo META_TAG_TITLE; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
<meta name="keywords" content="<?php echo META_TAG_KEYWORDS; ?>" />
<meta name="description" content="<?php echo META_TAG_DESCRIPTION; ?>" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="author" content="The Zen Cart® Team and others" />
<meta name="generator" content="shopping cart program by Zen Cart®, http://www.zen-cart.com eCommerce" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<?php if (defined('ROBOTS_PAGES_TO_SKIP') && in_array($current_page_base,explode(",",constant('ROBOTS_PAGES_TO_SKIP'))) || $current_page_base=='down_for_maintenance' || $robotsNoIndex === true) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } ?>
<?php if (defined('FAVICON')) { ?>
<link rel="icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<?php } //endif FAVICON ?>
<link rel="apple-touch-icon-precomposed" href="images/apple touch icon.png" />
<link rel="apple-touch-icon-precomposed" href="images/touch-icon-iphone-60x60.png">
<link rel="apple-touch-icon-precomposed" sizes="60x60" href="images/touch-icon-ipad-76x76.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="images/touch-icon-iphone-retina-120x120.png">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="images/touch-icon-ipad-retina-152x152.png">
<link rel="apple-touch-icon-precomposed" sizes="180x180" href="images/apple-touch-icon-180x180.png">
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ); ?>" />
<?php if (isset($canonicalLink) && $canonicalLink != '') { ?>
<link rel="canonical" href="<?php echo $canonicalLink; ?>" />
<?php } ?>
<?php
/**
* load all template-specific stylesheets, named like "style*.css", alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^style/', '.css');
while(list ($key, $value) = each($directory_array)) {
echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n";
}
/**
* load stylesheets on a per-page/per-language/per-product/per-manufacturer/per-category basis. Concept by Juxi Zoza.
*/
$manufacturers_id = (isset($_GET['manufacturers_id'])) ? $_GET['manufacturers_id'] : '';
$tmp_products_id = (isset($_GET['products_id'])) ? (int)$_GET['products_id'] : '';
$tmp_pagename = ($this_is_home_page) ? 'index_home' : $current_page_base;
if ($current_page_base == 'page' && isset($ezpage_id)) $tmp_pagename = $current_page_base . (int)$ezpage_id;
$sheets_array = array('/' . $_SESSION['language'] . '_stylesheet',
'/' . $tmp_pagename,
'/' . $_SESSION['language'] . '_' . $tmp_pagename,
'/c_' . $cPath,
'/' . $_SESSION['language'] . '_c_' . $cPath,
'/m_' . $manufacturers_id,
'/' . $_SESSION['language'] . '_m_' . (int)$manufacturers_id,
'/p_' . $tmp_products_id,
'/' . $_SESSION['language'] . '_p_' . $tmp_products_id
);
while(list ($key, $value) = each($sheets_array)) {
//echo "<!--looking for: $value-->\n";
$perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . $value . '.css';
if (file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n";
}
/**
* custom category handling for a parent and all its children ... works for any c_XX_XX_children.css where XX_XX is any parent category
*/
$tmp_cats = explode('_', $cPath);
$value = '';
foreach($tmp_cats as $val) {
$value .= $val;
$perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . '/c_' . $value . '_children.css';
if (file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n";
$perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . '/' . $_SESSION['language'] . '_c_' . $value . '_children.css';
if (file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n";
$value .= '_';
}
/**
* load printer-friendly stylesheets -- named like "print*.css", alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^print/', '.css');
sort($directory_array);
while(list ($key, $value) = each($directory_array)) {
echo '<link rel="stylesheet" type="text/css" media="print" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n";
}
/**
* load all site-wide jscript_*.js files from includes/templates/YOURTEMPLATE/jscript, alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript'), '/^jscript_/', '.js');
while(list ($key, $value) = each($directory_array)) {
echo '<script type="text/javascript" src="' . $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/' . $value . '"></script>'."\n";
}
/**
* load all page-specific jscript_*.js files from includes/modules/pages/PAGENAME, alphabetically
*/
$directory_array = $template->get_template_part($page_directory, '/^jscript_/', '.js');
while(list ($key, $value) = each($directory_array)) {
echo '<script type="text/javascript" src="' . $page_directory . '/' . $value . '"></script>' . "\n";
}
/**
* load all site-wide jscript_*.php files from includes/templates/YOURTEMPLATE/jscript, alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'jscript'), '/^jscript_/', '.php');
while(list ($key, $value) = each($directory_array)) {
/**
* include content from all site-wide jscript_*.php files from includes/templates/YOURTEMPLATE/jscript, alphabetically.
* These .PHP files can be manipulated by PHP when they're called, and are copied in-full to the browser page
*/
require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/' . $value); echo "\n";
}
/**
* include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically.
*/
$directory_array = $template->get_template_part($page_directory, '/^jscript_/');
while(list ($key, $value) = each($directory_array)) {
/**
* include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically.
* These .PHP files can be manipulated by PHP when they're called, and are copied in-full to the browser page
*/
require($page_directory . '/' . $value); echo "\n";
}
// DEBUG: echo '<!-- I SEE cat: ' . $current_category_id . ' || vs cpath: ' . $cPath . ' || page: ' . $current_page . ' || template: ' . $current_template . ' || main = ' . ($this_is_home_page ? 'YES' : 'NO') . ' -->';
if (COLUMN_WIDTH == '0') {
echo '';
} else {
echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . 'responsive.css' . '" />';
}
?>
<script src="<?php echo $template->get_template_dir('',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/css_browser_selector.js' ?>" type="text/javascript"></script>
</head>
<?php // NOTE: Blank line following is intended: ?>
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
toyseller
...It threw the look of the template out completely ...
your description/question is not clear, but if you are referring to the opaque black and white spots on the ribbons where there should be transparent shadows, then you just need to revert back to the original images, and preserve their transparency when attempting to change their color. that's all I can see wrong. not sure if that's what your question is about.... I don't see any script/css/loading errors off hand....
-
Re: CSS JS Loader [Support Thread]
There are currently no problems with my live webite at the moment because I cant use CSS/JS Loader on it.
I cant argue my case because I dont understand the coding. I had this module running on my old 1.3.9h website but it doesnt work on my new 1.5.4 site with its new Sheffield Blue template. It wasnt just a minor glitch. It rendered the whole website visually unusable.
I am not the only person who found that this template and CSS/JS Loader are incompatable. My understanding is that it is because the coding in the html_header.php varies between the 2 products (Im sorry I really really cant argue my case). All I know is that I could get my website back to looking good by putting the coding above for html_header.php back into my website and it worked again. Hence why I posted the code above. I thought someone would understand why the coding isnt compatable for this template.
This is another posting on the Sheffield Blue website of someone with the same issues ..
http://www.zen-cart.com/showthread.p...ld-Blue/page28
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
toyseller
There are currently no problems with my live webite at the moment because I cant use CSS/JS Loader on it.
I cant argue my case because I dont understand the coding. I had this module running on my old 1.3.9h website but it doesnt work on my new 1.5.4 site with its new Sheffield Blue template. It wasnt just a minor glitch. It rendered the whole website visually unusable.
I am not the only person who found that this template and CSS/JS Loader are incompatable. My understanding is that it is because the coding in the html_header.php varies between the 2 products (Im sorry I really really cant argue my case). All I know is that I could get my website back to looking good by putting the coding above for html_header.php back into my website and it worked again. Hence why I posted the code above. I thought someone would understand why the coding isnt compatable for this template.
This is another posting on the Sheffield Blue website of someone with the same issues ..
http://www.zen-cart.com/showthread.p...ld-Blue/page28
There is no incompatibility between the Responsive Sheffield Blue template and the css/js loader plugin. My guess is that you are not merging the html_header.php file correctly. Any stable, correctly installed plugin will work with the template. If you do not have the skills to merge the files you may need to contract professional help.
Thanks,
Anne
-
Re: CSS JS Loader [Support Thread]
I simply downloaded the CSS/JS Loader add-on and switched it on.
Am I supposed to merge the coding ... that is what I am trying to find out.
I thought that on a normal situation you downloaded a plug-in installed it, turned it on and if you had installed it correctly it worked.
The CSS/JS Loader didnt work for me ... and Im trying to understand from this forum whether I need to pull out the coding to get it to work.
What is increasingly frustrating me is that the people with the knowledge are expecting me to be at their level
I have no knowledge of PHP, CSS or HTML. I do have knowledge of Cobol.
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
toyseller
I simply downloaded the CSS/JS Loader add-on and switched it on.
Am I supposed to merge the coding ... that is what I am trying to find out.
I thought that on a normal situation you downloaded a plug-in installed it, turned it on and if you had installed it correctly it worked.
The CSS/JS Loader didnt work for me ... and Im trying to understand from this forum whether I need to pull out the coding to get it to work.
What is increasingly frustrating me is that the people with the knowledge are expecting me to be at their level
I have no knowledge of PHP, CSS or HTML. I do have knowledge of Cobol.
IN GENERAL here's how MOST modules are structured..
The readme should explain that IF the module modifies any of the core files and any of those files have been modified by OTHER modules, that you will have to merge the files so that you don't stomp on code those other modules need..
The readme for most modules also includes instructions that if there are template folders you will need to re-name them to match your primary template's folder name, and that you will need to rename their "ADMIN" folder to match you site's admin folder name. You will need to do this before uploading the modules files..
Finally, it's difficult for anyone to assist you without much more detail than you've provided.. Saying "it doesn't work" doesn't help anyone assist you.. What do you mean by "doesn't work"?? Can you provide a link to your site?? Include the details suggested in the "Posting Tips" section you see JUST when you click reply just below the rep;ies textarea field.. All of this will help folks to help you.. Very rarely is having knowledge of PHP needed..
-
Re: CSS JS Loader [Support Thread]
Thank you for your reply.
I think there was a misunderstanding because I thought that by posting the complete contents of my html_header.php file that would be more than enough to show what was wrong - when I put my header file in place the website template showed up correctly and when the CSS/Loader html_header.php file was in place there was a problem, I simply thought that a look down my coding would be enough to see what the issue was.
I applied CSS/Loader to my live site, so I couldnt leave the file in place. I had to put back my own html_header.php file. The website was completely unrecognisable with rows and rows of full-stops. I dont think there was anything to be gained from leaving the website to be viewed in this condition.
How I understood previous postings, it looked as if I need to merge the code from the CSS/Loader into my own file, but I wasnt sure from the postings whether this was what was being said.
I have never come across a situation where I had needed to merge coding, but I just wanted clarification that thats what was needed ... or it sounded like what I might need to wait because there is a newer version of CSS/Loader. I simply wanted clarification of what I needed to do.
I wasnt expecting the reaction I got.
I have years of IT experience in the older programming languages and can usually skim through coding to get a idea of what wrong. Hence why I posted the code.
Regards
Sue
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
toyseller
Thank you for your reply.
I think there was a misunderstanding because I thought that by posting the complete contents of my html_header.php file that would be more than enough to show what was wrong - when I put my header file in place the website template showed up correctly and when the CSS/Loader html_header.php file was in place there was a problem, I simply thought that a look down my coding would be enough to see what the issue was.
I applied CSS/Loader to my live site, so I couldnt leave the file in place. I had to put back my own html_header.php file. The website was completely unrecognisable with rows and rows of full-stops. I dont think there was anything to be gained from leaving the website to be viewed in this condition.
Right.. seeing the code isn't terribly helpful.. This is a volunteer community so unless someone is willing to test your file on their own test store, seeing the code isn't going to be terribly useful..
So let me make a few observations/suggestions:
You need to create a dev version of your site.. As an IT pro you know that it's NEVER a good idea to implement something on your live site that you haven't first tested in a development environment.. So I'd say the FIRST thing you need todo is establish a clone of your site to TEST the install first.
I don't know how else to explain what WILL help us help you except to say that saying: "The website was completely unrecognisable with rows and rows of full-stops." TRULY isn't a very helpful statement.. Since we can't SEE your site I have NO CLUE what you mean by this statement.. and given the LIGHT response to your queries, I'd say that neither does anyone else..
Start by telling us CLEARLY what EXACTLY happens that is the issue.. Because honestly at this point I am CLUELESS as to what is happening on your site.. All we know is "when the CSS/Loader html_header.php file was in place there was a problem" WHAT PROBLEM.. Explain it.. in DETAIL.. Then post ALL of the suggested info recommended in "Posting Tips". Because honestly without DETAILED information, you will waste a lot of time waiting for someone willing to spend a few posts GUESSING your issue and GUESSING the solution..
Quote:
Originally Posted by
toyseller
How I understood previous postings, it looked as if I need to merge the code from the CSS/Loader into my own file, but I wasnt sure from the postings whether this was what was being said.
I have never come across a situation where I had needed to merge coding, but I just wanted clarification that thats what was needed ... or it sounded like what I might need to wait because there is a newer version of CSS/Loader. I simply wanted clarification of what I needed to do.
Zen Cart modules are not "plug-n-play". For all except a rare few, you WILL need to merge files.. IF the module modifies any of the core files and any of those files have been modified by OTHER modules, you will have to merge the files so that you don't stomp on code those other modules need.. A file merging tool like WinMerge or a commercial one like Beyond Compare will help with this task.. I prefer Beyond Compare and IMHO it does a MUCH better job of highlighting file diffs..
Quote:
Originally Posted by
toyseller
I wasnt expecting the reaction I got.
I have years of IT experience in the older programming languages and can usually skim through coding to get a idea of what wrong. Hence why I posted the code.
Regards
Sue
Because we don't know what ELSE you have going on on your site. Seeing ONE file isn't going to tell us much.. What we need is for you to TELL US what happens with this file in place.. You are going to find that this is going to be a standard "reaction" when seeking assistance here or any other open source support forum..
-
Re: CSS JS Loader [Support Thread]
Hello All,
I'm running Zen 154 with TPP 1.1 and I'm now installing CSS JS Loader 3.0.2. When I turn on "css minify" in CSS JS Loader it removes the styling for TPP only.
Is there a way to get CSS JS Loader 3.0.2 and TPP 1.1 to play nicely?
Any help would be appreciated. Thank you.
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
kcb410
Hello All,
I'm running Zen 154 with TPP 1.1 and I'm now installing CSS JS Loader 3.0.2. When I turn on "css minify" in CSS JS Loader it removes the styling for TPP only.
Is there a way to get CSS JS Loader 3.0.2 and TPP 1.1 to play nicely?
Any help would be appreciated. Thank you.
Though I have not used the latest version of TPP, you could compare 1.1 and 1.06 with each other to find out what needs to be done to use css loader with TPP
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
Design75
Though I have not used the latest version of TPP, you could compare 1.1 and 1.06 with each other to find out what needs to be done to use css loader with TPP
I originally posted on the TPP thread and mentioned looking at TPP 1.0.6 but was told it was a CSS JS Loader issue and I should post here. I'm hoping someone using CSS JS Loader 3.02 and TPP 1.1 has bumped into this and resolved it.
Thank you for the reply Design75!
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
Design75
Though I have not used the latest version of TPP, you could compare 1.1 and 1.06 with each other to find out what needs to be done to use css loader with TPP
I haven't a CLUE how to make this module and TPP work together which is why I sent the OP here.. He needs help with this module.. The issue is NOT with TPP which works JUST FINE, until you install this module with it.. I cannot help him since I DON'T use this module..
The inclusion of the CSS JS Loader with TPP was NEVER done well or explained or even supported by the individual who included it with TPP (with NO ANNOUNCEMENT to the support thread that this "enhancement" was made). For that reason and the fact that the CSS JS Loader module should have been rlease as a SEPERATE module NOT "bundled" in with another module. This is why I kicked the CSS JS Loader module to the curb.. v1.06 of TPP is an OLDER version of both modules, and much has changed with both.. So I DOUBT the OP is going to find looking at TPP v1.06 very useful...
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
DivaVocals
I haven't a CLUE how to make this module and TPP work together which is why I sent the OP here.. He needs help with this module.. The issue is NOT with TPP which works JUST FINE, until you install this module with it.. I cannot help him since I DON'T use this module..
The inclusion of the CSS JS Loader with TPP was NEVER done well or explained or even supported by the individual who included it with TPP (with NO ANNOUNCEMENT to the support thread that this "enhancement" was made). For that reason and the fact that the CSS JS Loader module should have been rlease as a SEPERATE module NOT "bundled" in with another module. This is why I kicked the CSS JS Loader module to the curb.. v1.06 of TPP is an OLDER version of both modules, and much has changed with both.. So I DOUBT the OP is going to find looking at TPP v1.06 very useful...
hmm... okay, maybe I will check on it later. The files needed for TPP to work are included in the 1.06 package. If I can find the time I will extract them, and explain how to use them here.
A few years back I used that version of TPP a lot. actually it was also when I started to appreciate the css loader and its possibilities to :laugh:
-
Re: CSS JS Loader [Support Thread]
Thank you for the replies.
I guess I'll make an attempt to install TPP 1.0.6 on our Z154 DEV site, I'm assuming it won't go well.....it's too bad that when CSS JS loader was removed from TPP so was their ability to get along. :(
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
kcb410
Thank you for the replies.
I guess I'll make an attempt to install TPP 1.0.6 on our Z154 DEV site, I'm assuming it won't go well.....it's too bad that when CSS JS loader was removed from TPP so was their ability to get along. :(
No it was a good call to remove it. As one should not force people to use the css loader.
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
Design75
No it was a good call to remove it. As one should not force people to use the css loader.
I wasn't questioning the removal, that seems like the correct move. It's just too bad that they were compatible when they were packaged together and once they separated they just stopped working together....sounds like most divorces I've seen! :)
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
kcb410
I wasn't questioning the removal, that seems like the correct move. It's just too bad that they were compatible when they were packaged together and once they separated they just stopped working together....sounds like most divorces I've seen! :)
:laugh: , Okay I will give it a go after the weekend, and give our divorced couple a second change for a happy marriage. I hate it when mum and dad fight. :hug:
I will set up a test environment for TPP and the css loader. I will let you know what the results are
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
Design75
:laugh: , Okay I will give it a go after the weekend, and give our divorced couple a second change for a happy marriage. I hate it when mum and dad fight. :hug:
I will set up a test environment for TPP and the css loader. I will let you know what the results are
That's great, thank you for the help! .... I'm hoping they can reconcile. :cry:
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
Design75
hmm... okay, maybe I will check on it later. The files needed for TPP to work are included in the 1.06 package. If I can find the time I will extract them, and explain how to use them here.
As I recall, the files needed to make this module work with TPP were not included, and the contributor who bundled CSS JS Loader in NEVER ONCE answered a SINGLE support thread for the MANY PEOPLE who installed v1.06 - v1.08 of TPP only to discover that TPP (which worked PERFECT up until then) stopped working.. In fact NO ONE helped these folks.. In version 1.09 I resubmitted TPP sans this module and the silly WordPress tabs addition that made it's way into v1.06.
Quote:
Originally Posted by
kcb410
it's too bad that when CSS JS loader was removed from TPP so was their ability to get along. :(
They get along fine IF you know what files are needed by this module are needed.. Design75 can help you with that since he uses this module and TPP. I DO NOT and therefore I can't help you..
Removing this module from the TPP module was NOT "too bad".. It was a BAD IDEA to bundle in this module with TPP to begin with.. It was removed because it should NEVER have been FORCED on folks to begin with as THIS module doesn't just impact TPP, but EVERY module with JS and CSS files..
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
kcb410
I wasn't questioning the removal, that seems like the correct move. It's just too bad that they were compatible when they were packaged together and once they separated they just stopped working together....sounds like most divorces I've seen! :)
This is ABSOLUTELY not true.. the TPP module support thread was LITTERED with support threads from folks who found it stopped working with the advent of v1.06 - v1.08..
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
Design75
:laugh: , Okay I will give it a go after the weekend, and give our divorced couple a second change for a happy marriage. I hate it when mum and dad fight. :hug:
I will set up a test environment for TPP and the css loader. I will let you know what the results are
Hello Design75,
I'm just touching base to see if you had a chance to test this. Please let me know when you have a moment.
Thanks Design75!
Paul
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
kcb410
Hello Design75,
I'm just touching base to see if you had a chance to test this. Please let me know when you have a moment.
Thanks Design75!
Paul
Paul,
did not forget you, but you are in my traffic jam. which is growing pretty quick all of the sudden, because of new payed projects.
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
Design75
Paul,
did not forget you, but you are in my traffic jam. which is growing pretty quick all of the sudden, because of new payed projects.
Thanks for the update Design75. It's not a panic for me, I'm just hoping to use CSS JS Loader to minify the CSS on our site which I can't do currently.
Please let me know when you have a chance to look at. Thanks again.
Paul
-
Re: CSS JS Loader [Support Thread]
I am using zen-cart version 1.5.4, and when I install CSS/JS Loader my website is all messed up. The website goes screen wide. I read post# 14, but is all french to me as I am not a coder. Just wondering if anyone could help out a tech illiterate like myself.
-
Re: CSS JS Loader [Support Thread]
I'm going to assume that you are using a template other than classic.
many of the templates out there load files in the html_header.php although this is frowned upon
In the include/YOUR_TEMPLATE/common/html_header.php.
Did you merge the files?
or
Build Auto-loaders for those files that were called in that file previously?
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
bislewl
I'm going to assume that you are using a template other than classic.
many of the templates out there load files in the html_header.php although this is frowned upon
In the include/YOUR_TEMPLATE/common/html_header.php.
Did you merge the files?
or
Build Auto-loaders for those files that were called in that file previously?
I am using the responsive Sheffield blue template. I did not merge files. I just followed the instructions in the readmehtml page. There was no mention of having to merge files. I don't code so building auto loaders is beyond me. Thank you for your response.
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
llmcdonald
I am using the responsive Sheffield blue template. I did not merge files. I just followed the instructions in the readmehtml page. There was no mention of having to merge files. I don't code so building auto loaders is beyond me. Thank you for your response.
You are correct, it doesn't mention that, in version 3.0.5 it has been clarified. However as a general rule, anytime you are overwriting files (if if it doesn't say to) you will need to merge files.
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
bislewl
You are correct, it doesn't mention that, in version 3.0.5 it has been clarified. However as a general rule, anytime you are overwriting files (if if it doesn't say to) you will need to merge files.
So do I just need to merge the files, or do I need the autoloader as well?
-
Re: CSS JS Loader [Support Thread]
Ideally...
You would do merge everything but the CSS/JS of the "old" html_header.php.
You can do which ever you choose.
I'll give a a quick overview of building an auto_loader, many others have difficulty with this.
So it may be a good idea.
Create a file for every different scenario you would need different CSS / JS files loaded.
put this file in the catalog/includes/templates/YOUR_TEMPLATE/auto_loaders/
start the file with "loader_", the end is best for something to make your life easier like lets call our loader_featured.php
you will need to know 3 things:
1.) Pages you want to load these files on
2.) JS files you want to load (and their location)
2.) CSS files you want to load (and their location)
Example
1.)
Lets say you wanted a loader for the new products and featured and the pages.
Those constants go in the pages array below, you can also just use one (then you don't need the comma)
2.)
we want to load the following javascript files (relative to the includes/templates/YOUR_TEMPLATE/jscript) in this order
//code.jquery.com/jquery-1.11.3.min.js (note the double slashes is used to use http/https depending on the current.)
jquery/jquery-migrate-1.2.1.min.js
jquery/jquery-ui-1.10.2.custom.min.js
jquery/index.js
add the files in the jscript_files array, with the key being the file, and the value being the order to load them in. Avoid duplicate numbers in a single auto-loader, and always start with 1
3.)
we want to load the following CSS files(relative to the includes/templates/YOUR_TEMPLATE/css) in this order
stylesheet_master.css
featured_products.css
add the files in the css_files array, with the key being the file, and the value being the order to load them in. Avoid duplicate numbers in a single auto-loader, and always start with 1
We would get the following result.
PHP Code:
<?php
$loaders[] = array('conditions' => array('pages' => array(FILENAME_PRODUCTS_NEW, FILENAME_FEATURED_PRODUCTS)),
'jscript_files' => array(
'//code.jquery.com/jquery-1.11.3.min.js' => 1,
'jquery/jquery-migrate-1.2.1.min.js' => 2,
'jquery/jquery-ui-1.10.2.custom.min.js' => 3,
'jquery/index.js' => 5
),
'css_files' => array(
'stylesheet_master.css' => 1,
'featured_products.css' => 2
)
);
if you want to load on all pages, the pages array would look like:
array('pages' => array('*')).
This avoids duplicate loading of jQuery
TIP: Many modules may put additional js files in: includes/modules/pages/PAGE_NAME/
and those will need to be moved to the includes/templates/YOUR_TEMPLATE/jscript and then added to the respective auto_loader
NOTE: You can have multiple auto-loaders for a single page, basically they CAN overlap.
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
bislewl
Ideally...
You would do merge everything but the CSS/JS of the "old" html_header.php.
You can do which ever you choose.
I'll give a a quick overview of building an auto_loader, many others have difficulty with this.
So it may be a good idea.
Create a file for every different scenario you would need different CSS / JS files loaded.
put this file in the catalog/includes/templates/YOUR_TEMPLATE/auto_loaders/
start the file with "loader_", the end is best for something to make your life easier like lets call our loader_featured.php
you will need to know 3 things:
1.) Pages you want to load these files on
2.) JS files you want to load (and their location)
2.) CSS files you want to load (and their location)
Example
1.)
Lets say you wanted a loader for the new products and featured and the pages.
Those constants go in the pages array below, you can also just use one (then you don't need the comma)
2.)
we want to load the following javascript files (relative to the includes/templates/YOUR_TEMPLATE/jscript) in this order
//code.jquery.com/jquery-1.11.3.min.js (note the double slashes is used to use http/https depending on the current.)
jquery/jquery-migrate-1.2.1.min.js
jquery/jquery-ui-1.10.2.custom.min.js
jquery/index.js
add the files in the jscript_files array, with the key being the file, and the value being the order to load them in. Avoid duplicate numbers in a single auto-loader, and always start with 1
3.)
we want to load the following CSS files(relative to the includes/templates/YOUR_TEMPLATE/css) in this order
stylesheet_master.css
featured_products.css
add the files in the css_files array, with the key being the file, and the value being the order to load them in. Avoid duplicate numbers in a single auto-loader, and always start with 1
We would get the following result.
PHP Code:
<?php
$loaders[] = array('conditions' => array('pages' => array(FILENAME_PRODUCTS_NEW, FILENAME_FEATURED_PRODUCTS)),
'jscript_files' => array(
'//code.jquery.com/jquery-1.11.3.min.js' => 1,
'jquery/jquery-migrate-1.2.1.min.js' => 2,
'jquery/jquery-ui-1.10.2.custom.min.js' => 3,
'jquery/index.js' => 5
),
'css_files' => array(
'stylesheet_master.css' => 1,
'featured_products.css' => 2
)
);
if you want to load on all pages, the pages array would look like:
array('pages' => array('*')).
This avoids duplicate loading of jQuery
TIP: Many modules may put additional js files in: includes/modules/pages/PAGE_NAME/
and those will need to be moved to the includes/templates/YOUR_TEMPLATE/jscript and then added to the respective auto_loader
NOTE: You can have multiple auto-loaders for a single page, basically they CAN overlap.
I just need fast and easy checkout to work. Right now fast and easy checkout gets hung up on the processing order, please wait.... screen. I was told it was not working because I didn't have css/js loader installed.
-
Re: CSS JS Loader [Support Thread]
What credit module are you using? Have you tried with check/money order?
-
Re: CSS JS Loader [Support Thread]
How can I check/confirm that this module is actually working properly and has an effect on my webiste?
I have installed the module and my website still seems to work fine, however I validated my CSS file and it does not validate correctly, it has about 10 errors; but still the website and module seems to work fine. I thought it would not work if the CSS file does not validate correctly (?).
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
DML73
How can I check/confirm that this module is actually working properly and has an effect on my webiste?
I have installed the module and my website still seems to work fine, however I validated my CSS file and it does not validate correctly, it has about 10 errors; but still the website and module seems to work fine. I thought it would not work if the CSS file does not validate correctly (?).
It will work without valid css, but many times it will break if it isn't when compressed. Also it may break if some one comments in css with // versus /* */ as it is normally one line when compressed
-
Re: CSS JS Loader [Support Thread]
Thanks. How can I check/confirm that this module is actually working properly and has an effect on my webiste?
-
Re: CSS JS Loader [Support Thread]
If your minifing data, when you look in your <head> of the website you should see a long string (containing the files names usually) for the CSS & JS files.
***PRO TIP**
After setting up CSS/JS Loader to load ALL of your CSS & JS files.
Move it from the html_header to the tpl_footer, to reduce the render blocking CSS & JS, for better page speeds on google insights
-
Re: CSS JS Loader [Support Thread]
Great thanks. Am I correct that there is no way to actually meassure/test if the module has an effect on my website?
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
DML73
Great thanks. Am I correct that there is no way to actually meassure/test if the module has an effect on my website?
You are incorrect.
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
bislewl
You are incorrect.
Ok, how can I meassure/test if the module have an effect on my site?
-
Re: CSS JS Loader [Support Thread]
One more question, am I supposed to remove the following from html_header.php?:
/**
* load all template-specific stylesheets, named like "style*.css", alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^style/', '.css');
while(list ($key, $value) = each($directory_array)) {
echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n";
}
/**
* load stylesheets on a per-page/per-language/per-product/per-manufacturer/per-category basis. Concept by Juxi Zoza.
*/
$manufacturers_id = (isset($_GET['manufacturers_id'])) ? $_GET['manufacturers_id'] : '';
$tmp_products_id = (isset($_GET['products_id'])) ? (int)$_GET['products_id'] : '';
$tmp_pagename = ($this_is_home_page) ? 'index_home' : $current_page_base;
if ($current_page_base == 'page' && isset($ezpage_id)) $tmp_pagename = $current_page_base . (int)$ezpage_id;
$sheets_array = array('/' . $_SESSION['language'] . '_stylesheet',
'/' . $tmp_pagename,
'/' . $_SESSION['language'] . '_' . $tmp_pagename,
'/c_' . $cPath,
'/' . $_SESSION['language'] . '_c_' . $cPath,
'/m_' . $manufacturers_id,
'/' . $_SESSION['language'] . '_m_' . (int)$manufacturers_id,
'/p_' . $tmp_products_id,
'/' . $_SESSION['language'] . '_p_' . $tmp_products_id
);
while(list ($key, $value) = each($sheets_array)) {
//echo "<!--looking for: $value-->\n";
$perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . $value . '.css';
if (file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n";
}
/**
* custom category handling for a parent and all its children ... works for any c_XX_XX_children.css where XX_XX is any parent category
*/
$tmp_cats = explode('_', $cPath);
$value = '';
foreach($tmp_cats as $val) {
$value .= $val;
$perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . '/c_' . $value . '_children.css';
if (file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n";
$perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . '/' . $_SESSION['language'] . '_c_' . $value . '_children.css';
if (file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n";
$value .= '_';
}
/**
* load printer-friendly stylesheets -- named like "print*.css", alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^print/', '.css');
sort($directory_array);
while(list ($key, $value) = each($directory_array)) {
echo '<link rel="stylesheet" type="text/css" media="print" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n";
}
/**
* load all site-wide jscript_*.js files from includes/templates/YOURTEMPLATE/jscript, alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript'), '/^jscript_/', '.js');
while(list ($key, $value) = each($directory_array)) {
echo '<script type="text/javascript" src="' . $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/' . $value . '"></script>'."\n";
}
/**
* load all page-specific jscript_*.js files from includes/modules/pages/PAGENAME, alphabetically
*/
$directory_array = $template->get_template_part($page_directory, '/^jscript_/', '.js');
while(list ($key, $value) = each($directory_array)) {
echo '<script type="text/javascript" src="' . $page_directory . '/' . $value . '"></script>' . "\n";
}
/**
* load all site-wide jscript_*.php files from includes/templates/YOURTEMPLATE/jscript, alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'jscript'), '/^jscript_/', '.php');
while(list ($key, $value) = each($directory_array)) {
/**
* include content from all site-wide jscript_*.php files from includes/templates/YOURTEMPLATE/jscript, alphabetically.
* These .PHP files can be manipulated by PHP when they're called, and are copied in-full to the browser page
*/
require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/' . $value); echo "\n";
}
/**
* include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically.
*/
$directory_array = $template->get_template_part($page_directory, '/^jscript_/');
while(list ($key, $value) = each($directory_array)) {
/**
* include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically.
* These .PHP files can be manipulated by PHP when they're called, and are copied in-full to the browser page
*/
require($page_directory . '/' . $value); echo "\n";
}
-
Re: CSS JS Loader [Support Thread]
You should actually be replacing html_header.php with the file in CSS JS Loader. Backup your old file first. Then any embedded scripts need to be moved into includes/templates/YOUR_TEMPLATE/jscript/jscript_somename.php files so they auto load. This will cause them to load site-wide through Zen Cart's default system.
However, the default system does not support dependencies. So, if you have something like jQuery loading in your template, other than in CSS JS Loader supported plugins, you'll need to create auto loader files in CSS JS Loader to load those libraries. Otherwise you are going to have multiple versions of jQuery loading and in no particular order.
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
DML73
Ok, how can I meassure/test if the module have an effect on my site?
One way to test the difference is buy using one of these tools:
https://developers.google.com/speed/pagespeed/insights/
http://tools.pingdom.com/fpt/
-
Re: CSS JS Loader [Support Thread]
Hey all!
So I think I have a unique issue with my CSS JS Loader install. I've combed the support threads and haven't found anyone talking about it, but in case I've missed it please call me stupid and link me to it. Thanks!
Anywho, I've loaded CSS JS loader as per the instructions as well as FEC. Everyting works fine, EXCEPT that my columns are displaying correctly. My left column now appears in my center column and I'm not sure how to fix this. Here is my site: newsite.camppacs.com
Any help is greatly appreciated!
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
kcb410
Hello All,
I'm running Zen 154 with TPP 1.1 and I'm now installing CSS JS Loader 3.0.2. When I turn on "css minify" in CSS JS Loader it removes the styling for TPP only.
Is there a way to get CSS JS Loader 3.0.2 and TPP 1.1 to play nicely?
Any help would be appreciated. Thank you.
TPP works just fine with Minify activated in the CSS JS Loader if you follow these steps to load it dynamically via CSS/JS Loader:
1)
Create a file called loader_tpp.php with the following content:
Code:
<?php
/**
* @package Pages
* @copyright Copyright 2003-2015 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart-pro.at/license/2_0.txt GNU Public License V2.0
* @version $Id: loader_tpp.php 2015-08-04 18:23:35Z webchills $
*/
$loaders[] = array('conditions' => array('pages' => array('product_info','product_music_info','document_general_info','document_product_info','product_free_shipping_info')),
'jscript_files' => array(
'tpp.js' => 5
),
'css_files' => array(
'tpp/alt_tpp_tabs13.css' => 10,
'tpp.css' => 11)
);
Upload it to includes/templates/YOURTEMPLATE/auto_loaders
If you want to use an other Stylesheet change to alt_tpp_tabs5.css or whatever you want.
2)
Remove the following files from TPP 1.1 from your store as they are not needed anymore (do not delete them without having a look at them, maybe you have some other definitions in these stylesheets, just remove the TPP entries):
includes/templates/YOURTEMPLATE/css/document_general_info.css
includes/templates/YOURTEMPLATE/css/document_product_info.css
includes/templates/YOURTEMPLATE/css/product_free_shipping_info.css
includes/templates/YOURTEMPLATE/css/product_info.css
includes/templates/YOURTEMPLATE/css/product_music_info.css
3)
Create a Stylesheet with the following content:
Code:
.alignright {
display:inline;
float:right;
margin-bottom:4px;
margin-left:10px;
overflow:hidden;
border: 1px solid black;
}
.alignleft {
display:inline;
float:left;
margin-bottom:4px;
margin-right:10px;
overflow:hidden;
}
Save it as tpp.css and upload it to includes/templates/YOURTEMPLATE/css
4)
Look at includes/modules/pages/product_info
TPP 1.1 has placed a javascript called jscript_tpp.js in this folder
Download the file, rename it to tpp.js and upload it to
includes/templates/YOURTEMPLATE/jscript
Then you can safely remove the jscript_tpp.js from the following folders:
includes/modules/pages/document_general_info
includes/modules/pages/document_general_info
includes/modules/pages/document_product_info
includes/modules/pages/product_free_shipping_info
includes/modules/pages/product_info
includes/modules/pages/product_music_info
-
Re: CSS JS Loader [Support Thread]
Just a note for new installations. I just downloaded v3.0.5 from the plugins and, on inspection, the file /YOUR_ADMIN/includes/installers/css_js_loader/new_install.php will wipe out all settings in configuration_group_id = 0:
Code:
<?php
$configuration = $db->Execute("SELECT configuration_group_id FROM " . TABLE_CONFIGURATION_GROUP . " WHERE configuration_group_title = 'CSS/JS Loader' OR configuration_group_title = 'CSS/JS Loader Configuration';");
if ($configuration->RecordCount() > 0) {
while (!$configuration->EOF) {
$db->Execute("DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_group_id = " . $configuration->fields['configuration_group_id'] . ";");
$db->Execute("DELETE FROM " . TABLE_CONFIGURATION_GROUP . " WHERE configuration_group_id = " . $configuration->fields['configuration_group_id'] . ";");
$configuration->MoveNext();
}
}
$db->Execute("DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_group_id = 0;");
$db->Execute("DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = '';");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION_GROUP . " (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (NULL, 'CSS/JS Loader Configuration', 'Set CSS/JS Loader Options', '1', '1');");
$configuration_group_id = $db->Insert_ID();
$db->Execute("UPDATE " . TABLE_CONFIGURATION_GROUP . " SET sort_order = " . $configuration_group_id . " WHERE configuration_group_id = " . $configuration_group_id . ";");
This doesn't affect the operation of any Zen Cart v1.5.3 (or later) sites since the ZC development team took a pro-active step in that release to move those items into the "Modules" configuration group (id=6). For new installs on previous Zen Cart installations, the line highlighted above should be deleted prior to copying to your store.
Note: This issue was reported in the very first post on this thread. Neither of the two issues reported there have been corrected.
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
bislewl
Hello,
I installed CSS/ JS loader and still receive the following errors in Google insights: 'Consider Fixing:' Minify Javascript/ Minify CSS. Is my install corrupt?
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
Freddiec2385
Hello,
I installed CSS/ JS loader and still receive the following errors in Google insights: 'Consider Fixing:' Minify Javascript/ Minify CSS. Is my install corrupt?
Did you turn on minify JS & minify CSS
configuration -> css/js loader
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
bislewl
Did you turn on minify JS & minify CSS
configuration -> css/js loader
Yes, I am at a total lost.
-
Re: CSS JS Loader [Support Thread]
A link to your site would help us help you. It sounds like you didn't get a "proper" merge of the CSS/JS loader in your template's /common/html_header.php.
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
Freddiec2385
Yes, I am at a total lost.
It could also be your template several template bypass the html_header
-
Re: CSS JS Loader [Support Thread]
Here is the code on the html_header.php
Code:
<?php
/**
* Common Template
*
* outputs the html header. i,e, everything that comes before the \</head\> tag <br />
*
* @package templateSystem
* @copyright Copyright 2003-2014 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version GIT: $Id: Author: DrByte Jul 5 2014 Modified in v1.5.4 $
* Altered by rbarbour (ZCAdditions.com), Responsive DIY Template Default for 1.5.x (65)
* Modified by Anne (Picaflor-Azul.com) Winchester Black v1.0
*/
/**
* load the module for generating page meta-tags
*/
require(DIR_WS_MODULES . zen_get_module_directory('meta_tags.php'));
/**
* output main page HEAD tag and related headers/meta-tags, etc
*/
?>
<?php
// (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)
if (!class_exists('Mobile_Detect')) {
include_once(DIR_WS_CLASSES . 'Mobile_Detect.php');
$detect = new Mobile_Detect;
}
// (EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>
<head>
<title><?php echo META_TAG_TITLE; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
<meta name="keywords" content="<?php echo META_TAG_KEYWORDS; ?>" />
<meta name="description" content="<?php echo META_TAG_DESCRIPTION; ?>" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="author" content="The Zen Cart® Team. Responsive zen cart design by Picaflor Azul. " />
<meta name="generator" content="shopping cart program by Zen Cart®, http://www.zen-cart.com eCommerce" />
<?php // (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65) ?>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
<?php // (EOF - 2.1) Responsive DIY Template Default for 1.5.x (65) ?>
<?php if (defined('ROBOTS_PAGES_TO_SKIP') && in_array($current_page_base,explode(",",constant('ROBOTS_PAGES_TO_SKIP'))) || $current_page_base=='down_for_maintenance' || $robotsNoIndex === true) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } ?>
<?php if (defined('FAVICON')) { ?>
<link rel="icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<?php } //endif FAVICON ?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ); ?>" />
<?php if (isset($canonicalLink) && $canonicalLink != '') { ?>
<link rel="canonical" href="<?php echo $canonicalLink; ?>" />
<?php } ?>
<script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript type="text/javascript" src="//code.jquery.com/jquery-1.11.1.min.js"%3E%3C/script%3E'));</script>
<script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript type="text/javascript" src="<?php echo $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript'); ?>/jquery.min.js"%3E%3C/script%3E'));</script>
<?php
/**
* load the loader files
*/
if($RI_CJLoader->get('status') && (!isset($Ajax) || !$Ajax->status())){
$RI_CJLoader->autoloadLoaders();
$RI_CJLoader->loadCssJsFiles();
$files = $RI_CJLoader->header();
foreach($files['css'] as $file)
if($file['include']) {
include($file['src']);
} else if (!$RI_CJLoader->get('minify_css') || $file['external']) {
echo '<link rel="stylesheet" type="text/css" href="'.$file['src'].'" />'."\n";
} else {
echo '<link rel="stylesheet" type="text/css" href="min/?f='.$file['src'].'&'.$RI_CJLoader->get('minify_time').'" />'."\n";
}
foreach($files['jscript'] as $file)
if($file['include']) {
include($file['src']);
} else if(!$RI_CJLoader->get('minify_js') || $file['external']) {
echo '<script type="text/javascript" src="'.$file['src'].'"></script>'."\n";
} else {
echo '<script type="text/javascript" src="min/?f='.$file['src'].'&'.$RI_CJLoader->get('minify_time').'"></script>'."\n";
}
}
//DEBUG: echo '<!-- I SEE cat: ' . $current_category_id . ' || vs cpath: ' . $cPath . ' || page: ' . $current_page . ' || template: ' . $current_template . ' || main = ' . ($this_is_home_page ? 'YES' : 'NO') . ' -->';
?>
<?php
// (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)
if (COLUMN_WIDTH == '0' || (in_array($current_page_base,explode(",",'popup_image,popup_image_additional')) )) {
echo '';
} else {
$responsive_mobile = '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . 'responsive_mobile.css' . '" />';
require($template->get_template_dir('responsive_mobile.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/responsive_mobile.php');
$responsive_tablet = '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . 'responsive_tablet.css' . '" />';
require($template->get_template_dir('responsive_tablet.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/responsive_tablet.php');
$responsive_default = '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . 'responsive_default.css' . '" />';
echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . 'responsive.css' . '" />';
if ($detect->isMobile() && !$detect->isTablet() or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $_SESSION['display_mode']=='isMobile') {
echo $responsive_mobile;
} else if ($detect->isTablet() or $detect->isMobile() && $_SESSION['display_mode']=='isTablet' or $detect->isTablet() && $_SESSION['display_mode']=='isTablet' or $_SESSION['display_mode']=='isTablet'){
echo $responsive_tablet;
} else if ($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $_SESSION['display_mode']=='isNonResponsive'){
echo '';
} else {
echo $responsive_default;
}
}
if($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isNonResponsive' or $detect->isTablet() && $_SESSION['display_mode']=='isNonResponsive' or $_SESSION['display_mode']=='isNonResponsive'){
$fluidisFixed = 'fluidIsFixed';
} else {
$fluidisFixed = '';
}
// (EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)
?>
<script src="<?php echo $template->get_template_dir('css_browser_selector.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/css_browser_selector.js' ?>" type="text/javascript"></script>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.css" rel="stylesheet" />
</head>
<?php // NOTE: Blank line following is intended: ?>
-
Re: CSS JS Loader [Support Thread]
Based on the site URL that was PM'd, the CSS/JS loader is properly configured (there's a minified CSS file that's included in the page's rendered HTML). I don't know what the Google "issue" is based on.
-
Re: CSS JS Loader [Support Thread]
Thank you for checking on that lat9. There is something definitely fishy tho. It has nothing to do with FEC, but after this install the search box works in IE, but only works in Chrome if in SSL. Have you ever heard/had such a problem?
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
Freddiec2385
Here is the code on the html_header.php
Code:
<?php
/**
* Common Template
*
* outputs the html header. i,e, everything that comes before the \</head\> tag <br />
*
* @package templateSystem
* @copyright Copyright 2003-2014 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version GIT: $Id: Author: DrByte Jul 5 2014 Modified in v1.5.4 $
* Altered by rbarbour (ZCAdditions.com), Responsive DIY Template Default for 1.5.x (65)
* Modified by Anne (Picaflor-Azul.com) Winchester Black v1.0
*/
/**
* load the module for generating page meta-tags
*/
require(DIR_WS_MODULES . zen_get_module_directory('meta_tags.php'));
/**
* output main page HEAD tag and related headers/meta-tags, etc
*/
?>
<?php
// (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)
if (!class_exists('Mobile_Detect')) {
include_once(DIR_WS_CLASSES . 'Mobile_Detect.php');
$detect = new Mobile_Detect;
}
// (EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>
<head>
<title><?php echo META_TAG_TITLE; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
<meta name="keywords" content="<?php echo META_TAG_KEYWORDS; ?>" />
<meta name="description" content="<?php echo META_TAG_DESCRIPTION; ?>" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="author" content="The Zen Cart® Team. Responsive zen cart design by Picaflor Azul. " />
<meta name="generator" content="shopping cart program by Zen Cart®, http://www.zen-cart.com eCommerce" />
<?php // (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65) ?>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
<?php // (EOF - 2.1) Responsive DIY Template Default for 1.5.x (65) ?>
<?php if (defined('ROBOTS_PAGES_TO_SKIP') && in_array($current_page_base,explode(",",constant('ROBOTS_PAGES_TO_SKIP'))) || $current_page_base=='down_for_maintenance' || $robotsNoIndex === true) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } ?>
<?php if (defined('FAVICON')) { ?>
<link rel="icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<?php } //endif FAVICON ?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ); ?>" />
<?php if (isset($canonicalLink) && $canonicalLink != '') { ?>
<link rel="canonical" href="<?php echo $canonicalLink; ?>" />
<?php } ?>
<script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript type="text/javascript" src="//code.jquery.com/jquery-1.11.1.min.js"%3E%3C/script%3E'));</script>
<script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript type="text/javascript" src="<?php echo $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript'); ?>/jquery.min.js"%3E%3C/script%3E'));</script>
<?php
/**
* load the loader files
*/
if($RI_CJLoader->get('status') && (!isset($Ajax) || !$Ajax->status())){
$RI_CJLoader->autoloadLoaders();
$RI_CJLoader->loadCssJsFiles();
$files = $RI_CJLoader->header();
foreach($files['css'] as $file)
if($file['include']) {
include($file['src']);
} else if (!$RI_CJLoader->get('minify_css') || $file['external']) {
echo '<link rel="stylesheet" type="text/css" href="'.$file['src'].'" />'."\n";
} else {
echo '<link rel="stylesheet" type="text/css" href="min/?f='.$file['src'].'&'.$RI_CJLoader->get('minify_time').'" />'."\n";
}
foreach($files['jscript'] as $file)
if($file['include']) {
include($file['src']);
} else if(!$RI_CJLoader->get('minify_js') || $file['external']) {
echo '<script type="text/javascript" src="'.$file['src'].'"></script>'."\n";
} else {
echo '<script type="text/javascript" src="min/?f='.$file['src'].'&'.$RI_CJLoader->get('minify_time').'"></script>'."\n";
}
}
//DEBUG: echo '<!-- I SEE cat: ' . $current_category_id . ' || vs cpath: ' . $cPath . ' || page: ' . $current_page . ' || template: ' . $current_template . ' || main = ' . ($this_is_home_page ? 'YES' : 'NO') . ' -->';
?>
<?php
// (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)
if (COLUMN_WIDTH == '0' || (in_array($current_page_base,explode(",",'popup_image,popup_image_additional')) )) {
echo '';
} else {
$responsive_mobile = '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . 'responsive_mobile.css' . '" />';
require($template->get_template_dir('responsive_mobile.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/responsive_mobile.php');
$responsive_tablet = '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . 'responsive_tablet.css' . '" />';
require($template->get_template_dir('responsive_tablet.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/responsive_tablet.php');
$responsive_default = '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . 'responsive_default.css' . '" />';
echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . 'responsive.css' . '" />';
if ($detect->isMobile() && !$detect->isTablet() or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $_SESSION['display_mode']=='isMobile') {
echo $responsive_mobile;
} else if ($detect->isTablet() or $detect->isMobile() && $_SESSION['display_mode']=='isTablet' or $detect->isTablet() && $_SESSION['display_mode']=='isTablet' or $_SESSION['display_mode']=='isTablet'){
echo $responsive_tablet;
} else if ($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $_SESSION['display_mode']=='isNonResponsive'){
echo '';
} else {
echo $responsive_default;
}
}
if($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isNonResponsive' or $detect->isTablet() && $_SESSION['display_mode']=='isNonResponsive' or $_SESSION['display_mode']=='isNonResponsive'){
$fluidisFixed = 'fluidIsFixed';
} else {
$fluidisFixed = '';
}
// (EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)
?>
<script src="<?php echo $template->get_template_dir('css_browser_selector.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/css_browser_selector.js' ?>" type="text/javascript"></script>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.css" rel="stylesheet" />
</head>
<?php // NOTE: Blank line following is intended: ?>
There are a bunch of CSS and JS files that need to be removed from there and added to auto-loaders
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
bislewl
There are a bunch of CSS and JS files that need to be removed from there and added to auto-loaders
Anyone can point me in the right direction? I am totally lost here.
-
Re: CSS JS Loader [Support Thread]
zencart version 1.5.4
css_js_loader_3_0_5.zip
For some reason when I enable the css minify feature the css layout gets distorted. I checked my css files to see if there were any issue with closed tags etc… but all seems good. Can someone assist me or lead me in the right direction on what causes my css to break when I enable css minify.
My header:
<?php
/**
* Common Template
*
* outputs the html header. i,e, everything that comes before the \</head\> tag <br />
*
* @package templateSystem
* @copyright Copyright 2003-2010 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: html_header.php 6 2012-05-07 21:43:01Z numinix $
*/
/**
* load the module for generating page meta-tags
*/
require(DIR_WS_MODULES . zen_get_module_directory('meta_tags.php'));
/**
* output main page HEAD tag and related headers/meta-tags, etc
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>
<head>
<title><?php echo META_TAG_TITLE; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
<meta name="keywords" content="<?php echo META_TAG_KEYWORDS; ?>" />
<meta name="description" content="<?php echo META_TAG_DESCRIPTION; ?>" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="author" content="The Zen Cart™ Team and others" />
<meta name="generator" content="shopping cart program by Zen Cart™, http://www.zen-cart.com eCommerce" />
<?php if (defined('ROBOTS_PAGES_TO_SKIP') && in_array($current_page_base,explode(",",constant('ROBOTS_PAGES_TO_SKIP'))) || $current_page_base=='down_for_maintenance' || $robotsNoIndex === true) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } ?>
<?php if (defined('FAVICON')) { ?>
<link rel="icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<?php } //endif FAVICON ?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ); ?>" />
<?php if (isset($canonicalLink) && $canonicalLink != '') { ?>
<link rel="canonical" href="<?php echo $canonicalLink; ?>" />
<?php } ?>
<?php
/**
* load the loader files
*/
if($RI_CJLoader->get('status') && (!isset($Ajax) || !$Ajax->status())){
$RI_CJLoader->autoloadLoaders();
$RI_CJLoader->loadCssJsFiles();
$files = $RI_CJLoader->header();
foreach($files['css'] as $file)
if($file['include']) {
include($file['src']);
} else if (!$RI_CJLoader->get('minify_css') || $file['external']) {
echo '<link rel="stylesheet" type="text/css" href="'.$file['src'].'" />'."\n";
} else {
echo '<link rel="stylesheet" type="text/css" href="min/?f='.$file['src'].'&'.$RI_CJLoader->get('minify_time').'" />'."\n";
}
foreach($files['jscript'] as $file)
if($file['include']) {
include($file['src']);
} else if(!$RI_CJLoader->get('minify_js') || $file['external']) {
echo '<script type="text/javascript" src="'.$file['src'].'"></script>'."\n";
} else {
echo '<script type="text/javascript" src="min/?f='.$file['src'].'&'.$RI_CJLoader->get('minify_time').'"></script>'."\n";
}
}
//DEBUG: echo '<!-- I SEE cat: ' . $current_category_id . ' || vs cpath: ' . $cPath . ' || page: ' . $current_page . ' || template: ' . $current_template . ' || main = ' . ($this_is_home_page ? 'YES' : 'NO') . ' -->';
?>
<?php // NOTE: Blank line following is intended: ?>
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
chadlly2003
zencart version 1.5.4
css_js_loader_3_0_5.zip
For some reason when I enable the css minify feature the css layout gets distorted. I checked my css files to see if there were any issue with closed tags etc… but all seems good. Can someone assist me or lead me in the right direction on what causes my css to break when I enable css minify.
My header:
<?php
/**
* Common Template
*
* outputs the html header. i,e, everything that comes before the \</head\> tag <br />
*
* @package templateSystem
* @copyright Copyright 2003-2010 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license
http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: html_header.php 6 2012-05-07 21:43:01Z numinix $
*/
/**
* load the module for generating page meta-tags
*/
require(DIR_WS_MODULES . zen_get_module_directory('meta_tags.php'));
/**
* output main page HEAD tag and related headers/meta-tags, etc
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>
<head>
<title><?php echo META_TAG_TITLE; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
<meta name="keywords" content="<?php echo META_TAG_KEYWORDS; ?>" />
<meta name="description" content="<?php echo META_TAG_DESCRIPTION; ?>" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="author" content="The Zen Cart™ Team and others" />
<meta name="generator" content="shopping cart program by Zen Cart™,
http://www.zen-cart.com eCommerce" />
<?php if (defined('ROBOTS_PAGES_TO_SKIP') && in_array($current_page_base,explode(",",constant('ROBOTS_PAGES_TO_SKIP'))) || $current_page_base=='down_for_maintenance' || $robotsNoIndex === true) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } ?>
<?php if (defined('FAVICON')) { ?>
<link rel="icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<?php } //endif FAVICON ?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ); ?>" />
<?php if (isset($canonicalLink) && $canonicalLink != '') { ?>
<link rel="canonical" href="<?php echo $canonicalLink; ?>" />
<?php } ?>
<?php
/**
* load the loader files
*/
if($RI_CJLoader->get('status') && (!isset($Ajax) || !$Ajax->status())){
$RI_CJLoader->autoloadLoaders();
$RI_CJLoader->loadCssJsFiles();
$files = $RI_CJLoader->header();
foreach($files['css'] as $file)
if($file['include']) {
include($file['src']);
} else if (!$RI_CJLoader->get('minify_css') || $file['external']) {
echo '<link rel="stylesheet" type="text/css" href="'.$file['src'].'" />'."\n";
} else {
echo '<link rel="stylesheet" type="text/css" href="min/?f='.$file['src'].'&'.$RI_CJLoader->get('minify_time').'" />'."\n";
}
foreach($files['jscript'] as $file)
if($file['include']) {
include($file['src']);
} else if(!$RI_CJLoader->get('minify_js') || $file['external']) {
echo '<script type="text/javascript" src="'.$file['src'].'"></script>'."\n";
} else {
echo '<script type="text/javascript" src="min/?f='.$file['src'].'&'.$RI_CJLoader->get('minify_time').'"></script>'."\n";
}
}
//DEBUG: echo '<!-- I SEE cat: ' . $current_category_id . ' || vs cpath: ' . $cPath . ' || page: ' . $current_page . ' || template: ' . $current_template . ' || main = ' . ($this_is_home_page ? 'YES' : 'NO') . ' -->';
?>
<?php // NOTE: Blank line following is intended: ?>
1) Have you tried clearing the cache for CSS/JS loader (not your browser)
2) Try commenting out the each CSS file in the auto-loaders one at a time, the file that causes the same behavior perhaps has the issue.
-
Re: CSS JS Loader [Support Thread]
1) Have you tried clearing the cache for CSS/JS loader (not your browser)
Yes I have cleared the cache
2) Try commenting out the each CSS file in the auto-loaders one at a time, the file that causes the same behavior perhaps has the issue
Not sure what you mean by commenting out each css in the auto-loader. Could you elaborate a little bit more.
also when I do have css minify on it does break the css and slows down the site alot.
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
chadlly2003
1) Have you tried clearing the cache for CSS/JS loader (not your browser)
Yes I have cleared the cache
2) Try commenting out the each CSS file in the auto-loaders one at a time, the file that causes the same behavior perhaps has the issue
Not sure what you mean by commenting out each css in the auto-loader. Could you elaborate a little bit more.
also when I do have css minify on it does break the css and slows down the site alot.
ok for the CSS.
if you have something like this: (example I commented out "fec_confirmation.css")
PHP Code:
$loaders[] = array('conditions' => array('pages' => array(FILENAME_FEC_CONFIRMATION)),
'jscript_files' => array(
'jquery/jquery-1.10.2.min.js' => 1,
'jquery/jquery-migrate-1.2.1.min.js' => 2,
'jquery/jquery_fec_confirmation.php' => 3
),
'css_files' => array(
'fec_global.css' => 1,
'fec_confirmation.css' => 2,
'auto_loaders/fec_confirmation_overrides.css' => 3
)
);
try commenting each line with some trial and error like this:
PHP Code:
$loaders[] = array('conditions' => array('pages' => array(FILENAME_FEC_CONFIRMATION)),
'jscript_files' => array(
'jquery/jquery-1.10.2.min.js' => 1,
'jquery/jquery-migrate-1.2.1.min.js' => 2,
'jquery/jquery_fec_confirmation.php' => 3
),
'css_files' => array(
'fec_global.css' => 1,
// 'fec_confirmation.css' => 2,
'auto_loaders/fec_confirmation_overrides.css' => 3
)
);
Is commenting out a certain file in your in your loader does it create the same effect?
-
Re: CSS JS Loader [Support Thread]
That's what i thought you meant. I tried that with the same result. If I turn the default template on and it works well. Once I go back to my template it gets real slow and css does not display correctly. I even tried to change the max-URL-lenght but still same result. Any other ideas........
-
Re: CSS JS Loader [Support Thread]
What are the permissions on:
/public_html/cache/minify directory
-
Re: CSS JS Loader [Support Thread]
I am working on a local server xamp permissions are 777
-
Re: CSS JS Loader [Support Thread]
not sure if this helps but it looks like in the minify folder it is dupllicating everything
-
Re: CSS JS Loader [Support Thread]
Hello, I just installed this addon and there is an issue with my CSS, possibly caused by errors when minifying.
My problem is - the only options I have in the ADMIN > CONFIGURATION > CSS JS LOADER section are:
Version
Max URL Length
Minify Cache Time
Latest Cache Time
There is no option to turn off CSS / JS Minifying... has something gone wrong?! Or am I missing the options elsewhere?
I will probably uninstall, but would like to try the Easy Checkout module that requires this addon.
Thanks for any help!
Zen cart 1.5.4
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
fobes77
Hello, I just installed this addon and there is an issue with my CSS, possibly caused by errors when minifying.
My problem is - the only options I have in the ADMIN > CONFIGURATION > CSS JS LOADER section are:
Version
Max URL Length
Minify Cache Time
Latest Cache Time
There is no option to turn off CSS / JS Minifying... has something gone wrong?! Or am I missing the options elsewhere?
I will probably uninstall, but would like to try the Easy Checkout module that requires this addon.
Thanks for any help!
Zen cart 1.5.4
Try LEAVING the files but run the uninstall.sql
-
Re: CSS JS Loader [Support Thread]
Thanks. Tried that and it removes the CSS JA Loader from the Configuration menu completely. Do I need to re-install it again now somehow? The files are still in place. Cheers!
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
fobes77
Thanks. Tried that and it removes the CSS JA Loader from the Configuration menu completely. Do I need to re-install it again now somehow? The files are still in place. Cheers!
CSS/JS loader admin files are designed to automatically install. What version are you using?
Thanks,
Larry
-
Re: CSS JS Loader [Support Thread]
Thanks Larry.
I wondered if it should auto-install again, but no sign of that.
I am using Zen 1.5.4 and I assume the latest version of CSS/JS Loader - I downloaded it from the Numinix website a few days ago. I can't see any version information although the zipped direcorty has the suffix - 89cbf0a
Shall I try reuploading the files?
Cheers
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
fobes77
Thanks Larry.
I wondered if it should auto-install again, but no sign of that.
I am using Zen 1.5.4 and I assume the latest version of CSS/JS Loader - I downloaded it from the Numinix website a few days ago. I can't see any version information although the zipped direcorty has the suffix - 89cbf0a
Shall I try reuploading the files?
Cheers
If the files are installed correctly. I think there is a bug in the most recent version. I'll check they code and get back to you later.
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
fobes77
Thanks Larry.
I wondered if it should auto-install again, but no sign of that.
I am using Zen 1.5.4 and I assume the latest version of CSS/JS Loader - I downloaded it from the Numinix website a few days ago. I can't see any version information although the zipped direcorty has the suffix - 89cbf0a
Shall I try reuploading the files?
Cheers
Try using their most recent version, looks like they are working on 4.0.0 right now.
Here is a link to a zip of their most recent version: https://github.com/numinix/css_js_lo...ive/master.zip
-
Re: CSS JS Loader [Support Thread]
Thanks - I've tried that, and got a successful installation message at top of page, but.... there is still no CSS/JS configuration section in the admin menu!
-
Re: CSS JS Loader [Support Thread]
I have installed this and at the top I got this error:
// (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65) if (COLUMN_WIDTH == '0' || (in_array($current_page_base,explode(",",'popup_image,popup_image_additional')) )) { echo ''; } else { $responsive_mobile = ''; require($template->get_template_dir('responsive_mobile.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/responsive_mobile.php'); $responsive_tablet = ''; require($template->get_template_dir('responsive_tablet.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/responsive_tablet.php'); $responsive_default = ''; echo ''; if ($detect->isMobile() && !$detect->isTablet() or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $_SESSION['display_mode']=='isMobile') { echo $responsive_mobile; } else if ($detect->isTablet() or $detect->isMobile() && $_SESSION['display_mode']=='isTablet' or $detect->isTablet() && $_SESSION['display_mode']=='isTablet' or $_SESSION['display_mode']=='isTablet'){ echo $responsive_tablet; } else if ($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $_SESSION['display_mode']=='isNonResponsive'){ echo ''; } else { echo $responsive_default; } } if($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isNonResponsive' or $detect->isTablet() && $_SESSION['display_mode']=='isNonResponsive' or $_SESSION['display_mode']=='isNonResponsive'){ $fluidisFixed = 'fluidIsFixed'; } else { $fluidisFixed = ''; } // (EOF - 2.1) Responsive DIY Template Default for 1.5.x (65) ?>
-
Re: CSS JS Loader [Support Thread]
Ok, I got rid of the error and when I try to share an product to Facebook I got a blank image but with product name and description. Why is that?
-
Re: CSS JS Loader [Support Thread]
Ok, I have installed CSS JS Loader because its require for Facebook Open Graph then When I share a product to Facebook I got NO image when sharing.
Here is a link to an image to see what I am talking about.
http://www.morrisgiftshop.biz/images/fbimage.png
-
Re: CSS JS Loader [Support Thread]
Not sure if I am in the right place for this question :blush:
I down loaded CSS JS Loader and Product Image Zoom on my test site and everything worked fine.
Then I moved it to my live site and everything seems to work OK except I have no zoom and see the normal cursor; no cross hair. :(
I see as expected CONFIGURATION > CSS/JS LOADER CONFIGURATION OK.
When I "inspect" a product info image on my live site (the one with no zoom), I see the following
Code:
<div id="productMainImage" class="centeredContent back">
<img src="images/medium/TGLBE-10326 Graceful Sky_MED.jpg" alt="Anmutiger Himmel TGLBE-10326" title=" Anmutiger Himmel TGLBE-10326 " width="400" height="425.14285714286" data-zoom-image="images/large/TGLBE-10326 Graceful Sky_LRG.jpg"></div>
On my test site (working zoom) inspect of the same image shows me
Code:
<div class="zoomContainer" style="-webkit-transform: translateZ(0);position:absolute;left:294.015625px;top:431.390625px;height:425px;width:400px;"><div class="zoomWindowContainer" style="width: 400px;"><div style="z-index: 999; overflow: hidden; margin-left: 0px; margin-top: 0px; width: 400px; height: 425px; float: left; cursor: crosshair; position: absolute; top: 0px; left: 0px; background-image: url("images/large/TGLBE-10326 Graceful Sky_LRG.jpg"); background-position: -200px -78.1418px; background-repeat: no-repeat;" class="zoomWindow"> </div></div></div>
I am using CSS/JS LOADER 4.0.2, Product Image Zoom - latest version from Zucando.com.
Zen cart 1.51 with the green classic template.
I checked the logs but no errors today.
I assume I loaded one of these two incorrectly on my live site but I fail to see where.
Site is www.simmar.ch/catalog
-
Re: CSS JS Loader [Support Thread]
Couple more points
I checked the logs and no messages
I downloaded my database from my live site to my test site and the zoom continued to work OK on my test site.
-
Re: CSS JS Loader [Support Thread]
Couple of other possible clues
When I view source on the correctly working test site (chrome Browser) I see the following; but it is not on the live site (with not working image zoom).
Code:
</script><script type="text/javascript" src="min/?f=/zencart151/includes/templates/responsive_template_default/jscript/jquery/jquery-1.10.2.min.js,/zencart151/includes/templates/responsive_template_default/jscript/jquery/jquery.elevateZoom-3.0.8.min.js,/zencart151/includes/templates/responsive_template_default/jscript/jquery/jquery_product_image_zoom.js&1463221628"></script>
When I use Chrome developer tools on the live site with no zoom I see the following, so I assume jquery works ok
Code:
$(document).ready(function () {
if(_docready)
{
console.log("jquery duplicate ready");
return;
}
_docready = true;
console.log("jquery doc ready");
console.log("document.readyState = "+document.readyState);
OnPageload();
-
Re: CSS JS Loader [Support Thread]
I ran the online SeoSiteCheckup tests and got 100% for CSS and JS uploading so I assume my CSS JS loader is working OK? Or is there other functionality I should check?
-
Re: CSS JS Loader [Support Thread]
Today I re-installed the Google Analytics tag and now the Image zoom is working on my live site.
I have no clue why and I do not know of any logical ink between Google Analytics tag and the Image zoom?
Only theory that I have is that there was some failure on the tpl_main_page.php that was fixed when I uploaded the new version; but I do not have much faith in my theory :unsure:
-
Re: CSS JS Loader [Support Thread]
html_header.php file missing from Version: 4.0.2 Download package 3 Mar 2016
Ref: plugin download page: https://www.zen-cart.com/downloads.php?do=file&id=1774
Is this file truly missing from the package, or is it just me?
/includes/templates/YOUR_TEMPLATE/common/html_header.php
The 4.0.2 installation documentation requires extensive changes to the html_header.php file which should be included, but in my repeated download the file is missing.
Perhaps the file html_header.php is unchanged from the earlier version: 3.0.5, and if so one might use that file?
Any thoughts please
Terry
-
Re: CSS JS Loader [Support Thread]
@RedSpinnaker, it looks like the installation instructions for the plugin have changed. The changes needed for your template's /common/html_header.php are now covered in the readme itself.
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
lat9
@RedSpinnaker, it looks like the installation instructions for the plugin have changed. The changes needed for your template's /common/html_header.php are now covered in the readme itself.
Yes thanks Lat i see that. But my problem is that I can not find the new /common/html_header.php file included in the CSS JS download package.
Cheers
Terry
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
RedSpinnaker
Yes thanks Lat i see that. But my problem is that I can not find the new /common/html_header.php file included in the CSS JS download package.
Cheers
Terry
Right, my point was that the file itself is no longer part of that distribution (so you can stop looking). The readme's installation instructions have been updated to identify the code section to change in your template's version of /common/html_header.php.
-
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
lat9
Right, my point was that the file itself is no longer part of that distribution (so you can stop looking). The readme's installation instructions have been updated to identify the code section to change in your template's version of /common/html_header.php.
OK understood - though I was hoping that was not the case since making the changes to the existing /html_header.php as per the 4.0.2 readme stuffs up the header layout (can't show you as running on local host). I am able to run 3.0.5 without a problem, so will just stay with that pending any further findings.
Cheers
-
Re: CSS JS Loader [Support Thread]
Hi all. I'm using Zen Cart v154 and CSS/JS Loader 4.0.2
I installed the loader to install FEC, both of which I've used with other templates and Zen Cart versions with no issue.
Before installing the loader, Tabbed Products Pro and my mobile site worked fine, but my checkout process definitely needed FEC. I'm using a responsive template, Winchester Black, and the mobile site worked without glitches.
Now, TPP doesn't create tabs, all the info that was before in tabs is now all on each product page, not a huge deal, and I read that TPP and CSS/JS Loader don't really work together now. This isn't a huge issue to me.
The main issue is that on my mobile site, the responsive dropdown menu isn't there, the options that would be in the menu are laying over my logo, but they aren't clickable. For instance, Categories is one of these links, it can't be clicked on, therefore there isn't access to all the products. So really, the mobile site can't be used.
I've gone over the instructions for the loader over and over, I know that I replaced the code correctly in the html_header.php file. There IS extra code in this file for the responsive template than is included in the default template, it seems to be the code needed to make it responsive. If I replace the html_header file with the default file included with my template, the mobile site works fine, but FEC doesn't.
I read somewhere that Winchester Black is used with FEC successfully, so there should be a way to make this work. Should I uninstall TPP since I can't use it anyway? Maybe the code is interfering, even though it's turned off in admin.
FEC and mobile are both important for my sales!! Any ideas?
Thank you!!
In case it helps, here is my current html_header.php file, with the merged loader code:
PHP Code:
<?php
/**
* Common Template
*
* outputs the html header. i,e, everything that comes before the \</head\> tag <br />
*
* @package templateSystem
* @copyright Copyright 2003-2014 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version GIT: $Id: Author: DrByte Jul 5 2014 Modified in v1.5.4 $
* Altered by rbarbour (ZCAdditions.com), Responsive DIY Template Default for 1.5.x (65)
* Modified by Anne (Picaflor-Azul.com) Winchester Black v1.0
*/
/**
* load the module for generating page meta-tags
*/
require(DIR_WS_MODULES . zen_get_module_directory('meta_tags.php'));
/**
* output main page HEAD tag and related headers/meta-tags, etc
*/
?>
<?php
// (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)
if (!class_exists('Mobile_Detect')) {
include_once(DIR_WS_CLASSES . 'Mobile_Detect.php');
$detect = new Mobile_Detect;
}
// (EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>
<head>
<title><?php echo META_TAG_TITLE; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
<meta name="keywords" content="<?php echo META_TAG_KEYWORDS; ?>" />
<meta name="description" content="<?php echo META_TAG_DESCRIPTION; ?>" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="author" content="The Zen Cart® Team. Responsive zen cart design by Picaflor Azul. " />
<meta name="generator" content="shopping cart program by Zen Cart®, http://www.zen-cart.com eCommerce" />
<?php // (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65) ?>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
<?php // (EOF - 2.1) Responsive DIY Template Default for 1.5.x (65) ?>
<?php if (defined('ROBOTS_PAGES_TO_SKIP') && in_array($current_page_base,explode(",",constant('ROBOTS_PAGES_TO_SKIP'))) || $current_page_base=='down_for_maintenance' || $robotsNoIndex === true) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } ?>
<?php if (defined('FAVICON')) { ?>
<link rel="icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<?php } //endif FAVICON ?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ); ?>" />
<?php if (isset($canonicalLink) && $canonicalLink != '') { ?>
<link rel="canonical" href="<?php echo $canonicalLink; ?>" />
<?php } ?>
<?php
/**
* load the loader files
*/
$RC_loader_files = array();
if($RI_CJLoader->get('status') && (!isset($Ajax) || !$Ajax->status())){
$RI_CJLoader->autoloadLoaders();
$RI_CJLoader->loadCssJsFiles();
$RC_loader_files = $RI_CJLoader->header();
foreach($RC_loader_files['meta'] as $file) {
include($file['src']);
echo "\n";
}
foreach($RC_loader_files['css'] as $file){
if($file['include']) {
include($file['src']);
} else if (!$RI_CJLoader->get('minify_css') || $file['external']) {
//$link = $file['src'];
echo '<link rel="stylesheet" type="text/css" href="'.$file['src'] .'" />'."\n";
} else {
//$link = 'min/?f='.$file['src'].'&'.$RI_CJLoader->get('minify_time');
echo '<link rel="stylesheet" type="text/css" href="min/?f='.$file['src'].'&'.$RI_CJLoader->get('minify_time').'" />'."\n";
}
}
}
//DEBUG: echo '<!-- I SEE cat: ' . $current_category_id . ' || vs cpath: ' . $cPath . ' || page: ' . $current_page . ' || template: ' . $current_template . ' || main = ' . ($this_is_home_page ? 'YES' : 'NO') . ' -->';
// (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)
if (COLUMN_WIDTH == '0' || (in_array($current_page_base,explode(",",'popup_image,popup_image_additional')) )) {
echo '';
} else {
$responsive_mobile = '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . 'responsive_mobile.css' . '" />';
require($template->get_template_dir('responsive_mobile.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/responsive_mobile.php');
$responsive_tablet = '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . 'responsive_tablet.css' . '" />';
require($template->get_template_dir('responsive_tablet.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/responsive_tablet.php');
$responsive_default = '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . 'responsive_default.css' . '" />';
echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . 'responsive.css' . '" />';
if ($detect->isMobile() && !$detect->isTablet() or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $_SESSION['display_mode']=='isMobile') {
echo $responsive_mobile;
} else if ($detect->isTablet() or $detect->isMobile() && $_SESSION['display_mode']=='isTablet' or $detect->isTablet() && $_SESSION['display_mode']=='isTablet' or $_SESSION['display_mode']=='isTablet'){
echo $responsive_tablet;
} else if ($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $_SESSION['display_mode']=='isNonResponsive'){
echo '';
} else {
echo $responsive_default;
}
}
if($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isNonResponsive' or $detect->isTablet() && $_SESSION['display_mode']=='isNonResponsive' or $_SESSION['display_mode']=='isNonResponsive'){
$fluidisFixed = 'fluidIsFixed';
} else {
$fluidisFixed = '';
}
// (EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)
?>
<script src="<?php echo $template->get_template_dir('css_browser_selector.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/css_browser_selector.js' ?>" type="text/javascript"></script>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.css" rel="stylesheet" />
</head>
<?php // NOTE: Blank line following is intended: ?>
-
Re: CSS JS Loader [Support Thread]
I fixed my mobile site and FEC is installed, I followed Design75's advice on this page, used his html_header code and it worked: https://www.zen-cart.com/showthread....-v1-5-x/page30