Zen Cart Logo
Forums / Addon Templates / Responsive DIY Template Default for v1.5.x

Responsive DIY Template Default for v1.5.x

Views: 48,099

Results 281 to 300 of 332
3 Sep 2015, 12:33 AM
#281
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Responsive DIY Template Default for v1.5.x

I just checked and your stylesheets are being loaded, so not sure if you fixed it or you're talking about a particular stylesheet?. These are being loaded:

<link rel="stylesheet" type="text/css" href="includes/templates/shakatours/css/styleShaka.css" />
<link rel="stylesheet" type="text/css" href="includes/templates/shakatours/css/stylesheet.css" />
<link rel="stylesheet" type="text/css" href="includes/templates/shakatours/css/stylesheet_categories_dressing.css" />
<link rel="stylesheet" type="text/css" href="includes/templates/shakatours/css/stylesheet_chcategories_dressing.css" />
<link rel="stylesheet" type="text/css" href="includes/templates/shakatours/css/stylesheet_flexible_attributes.css" />
3 Sep 2015, 12:45 AM
#282
mike_d_1 avatar

mike_d_1

New Zenner

Join Date:
Sep 2013
Location:
Honolulu, HI
Posts:
88
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

s_mack:

I just checked and your stylesheets are being loaded, so not sure if you fixed it or you're talking about a particular stylesheet?. These are being loaded:

<link rel="stylesheet" type="text/css" href="includes/templates/shakatours/css/styleShaka.css" /> <link rel="stylesheet" type="text/css" href="includes/templates/shakatours/css/stylesheet.css" /> <link rel="stylesheet" type="text/css" href="includes/templates/shakatours/css/stylesheet_categories_dressing.css" /> <link rel="stylesheet" type="text/css" href="includes/templates/shakatours/css/stylesheet_chcategories_dressing.css" /> <link rel="stylesheet" type="text/css" href="includes/templates/shakatours/css/stylesheet_flexible_attributes.css" /> ```

I mean the responsive stylesheets. They load for my other pages but not the main pages.

8 Sep 2015, 3:34 AM
#283
mike_d_1 avatar

mike_d_1

New Zenner

Join Date:
Sep 2013
Location:
Honolulu, HI
Posts:
88
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

Still working on this, have not yet found a solution.

I've uncommented a debug line in the html_header.php file and I get <!-- I SEE cat: 0 || vs cpath: || page: index || template: || main = YES --> so I know that it recognizes we're on the main index page, but it's not loading the responsive stylesheets (responsive_default/mobile/tablet.php).

I've been going through looking for anything that pops out at me as wrong but I'm no expert, for all I know I might be scanning right over the issue. Does anybody have a similar problem or know what I should be checking?

8 Sep 2015, 7:15 AM
#284
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

I am no expert either but I see you have a line

<script src="includes/templates/shakatours/jscript/jscript_(fadeslideshowoptions).js" type="text/javascript"></script>

Have you tried?

<script src="includes/templates/**responsive_default**/shakatours/jscript/jscript_(fadeslideshowoptions).js" type="text/javascript"></script>
9 Sep 2015, 1:30 AM
#285
mike_d_1 avatar

mike_d_1

New Zenner

Join Date:
Sep 2013
Location:
Honolulu, HI
Posts:
88
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

marton_1:

I am no expert either but I see you have a line

<script src="includes/templates/shakatours/jscript/jscript_(fadeslideshowoptions).js" type="text/javascript"></script>

Have you tried?

<script src="includes/templates/**responsive_default**/shakatours/jscript/jscript_(fadeslideshowoptions).js" type="text/javascript"></script>

No dice. I've added responsive_default and responsive_template_default directories with common, css, jscript, and shakatours (the name of my template) subdirectories with the corresponding files in those subdirectories and still the same result.

9 Sep 2015, 1:46 AM
#286
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: Responsive DIY Template Default for v1.5.x

I wish I could point you to exactly where your mistake is... but I think the reality is you're going to have to use a tool like Winmerge and download a fresh copy of the template and compare the files until you find where you've goofed. As simple (and annoyingly tedious) as that.

9 Sep 2015, 1:59 AM
#287
mike_d_1 avatar

mike_d_1

New Zenner

Join Date:
Sep 2013
Location:
Honolulu, HI
Posts:
88
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

s_mack:

I wish I could point you to exactly where your mistake is... but I think the reality is you're going to have to use a tool like Winmerge and download a fresh copy of the template and compare the files until you find where you've goofed. As simple (and annoyingly tedious) as that.

Alrighty, I'll give that a try. I can live with tedious. It's not knowing what or where I should be looking that kills me.

Thanks for trying to help me out.

9 Sep 2015, 2:16 AM
#288
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: Responsive DIY Template Default for v1.5.x

I wish I could have been more help. I'm really not sure why it would load in the other pages and not your home page. I'm kinda not even seeing how that's possible, but obviously it is the case.

9 Sep 2015, 2:49 AM
#289
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Responsive DIY Template Default for v1.5.x

Mike D:

You need to merge the code into your existing template files, so all file paths should point to:
includes/templates/shakatours/

The stylesheets should be being called from the:
/includes/templates/shakatours/common/html_header.php file

By looking at your source code I would guess you merged the code incorrectly.

This should NOT appear in source code so IMO it would be a good place to start.

<!-- I SEE cat: 0 || vs cpath: || page: index || template: || main = YES -->
9 Sep 2015, 5:24 PM
#290
joshs avatar

joshs

New Zenner

Join Date:
Dec 2010
Posts:
15
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

I installed the new Version 1.0FREE and was having problems logging in as a customer. The session_start(); in zca_responsive_functions.php was the problem. I commented that line out and can now login. Is that line critical? Has anyone else had login issues?

8 Oct 2015, 9:16 PM
#291
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Responsive DIY Template Default for v1.5.x

Unfortunately it is critical in order for mobile-detect to function properly, I have solved the issue and will post shortly.

JoshS:

I installed the new Version 1.0FREE and was having problems logging in as a customer. The session_start(); in zca_responsive_functions.php was the problem. I commented that line out and can now login. Is that line critical? Has anyone else had login issues?

16 Nov 2015, 8:13 AM
#292
mike_d_1 avatar

mike_d_1

New Zenner

Join Date:
Sep 2013
Location:
Honolulu, HI
Posts:
88
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

Mike D:

Alrighty, I'll give that a try. I can live with tedious. It's not knowing what or where I should be looking that kills me.

Thanks for trying to help me out.

OK, so since my problem wasn't obvious to me I figured I'd upgrade my site from 1.5.1 to 1.5.4, which I was really dreading but I figured it'd help bring the problems to light.

I think the culprit is numinix's CSS/JS Loader add-on I have installed which I was required to install in order to run the Fast and Easy Checkout plugin. At the time I installed it I really wanted to have an expedited checkout process with the option to not have to create an account. I still would rather prefer to have a fast-as-possible checkout process 'without account' but now it's absolutely necessary that my site is responsive.

The problem seems to be that the CSS/JS Loader changes the html_header.php file to:

<?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: ?>

Would it be as easy as changing a few lines in that html_header.php file so that the responsive things fire the way they're supposed to? It seems if I want to retain my current plugins I may have to delve into auto_loaders, which I'm not dying to get into right now.

I'm also considering, much to my chagrin, ditching the plugins in order to get this to work as the SEO aspects of having my site responsive I think outweigh an expedited checkout process.

Any thoughts? I appreciate everybody's input on the matter.

16 Nov 2015, 10:05 AM
#293
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Responsive DIY Template Default for v1.5.x

Mike D:

OK, so since my problem wasn't obvious to me I figured I'd upgrade my site from 1.5.1 to 1.5.4, which I was really dreading but I figured it'd help bring the problems to light.

I think the culprit is numinix's CSS/JS Loader add-on I have installed which I was required to install in order to run the Fast and Easy Checkout plugin. At the time I installed it I really wanted to have an expedited checkout process with the option to not have to create an account. I still would rather prefer to have a fast-as-possible checkout process 'without account' but now it's absolutely necessary that my site is responsive.

The problem seems to be that the CSS/JS Loader changes the html_header.php file to:

<?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: ?> ``` > > Would it be as easy as changing a few lines in that html_header.php file so that the responsive things fire the way they're supposed to? It seems if I want to retain my current plugins I may have to delve into auto_loaders, which I'm not dying to get into right now. > > I'm also considering, much to my chagrin, ditching the plugins in order to get this to work as the SEO aspects of having my site responsive I think outweigh an expedited checkout process. > > Any thoughts? I appreciate everybody's input on the matter.

I am using the css loader too, without any problems. This is how my merged html_header looks like.```php

<?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 $Id: html_header.php 6 2012-05-07 21:43:01Z numinix $ * Altered by rbarbour (ZCAdditions.com), Responsive DIY Template Default for 1.5.x (65) * Modified by Anne (Picaflor-Azul.com) Winchester Respnsive 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="Zen4All" /> <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, maximum-scale=1.0, minimum-scale=1.0, user-scalable=yes" /> <?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') . ' -->';
// (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" type="text/css"/>

</head> <?php // NOTE: Blank line following is intended: ?> ```
16 Nov 2015, 10:01 PM
#294
mike_d_1 avatar

mike_d_1

New Zenner

Join Date:
Sep 2013
Location:
Honolulu, HI
Posts:
88
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

Design75:

I am using the css loader too, without any problems. This is how my merged html_header looks like.```php

<?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 $Id: html_header.php 6 2012-05-07 21:43:01Z numinix $ * Altered by rbarbour (ZCAdditions.com), Responsive DIY Template Default for 1.5.x (65) * Modified by Anne (Picaflor-Azul.com) Winchester Respnsive 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="Zen4All" /> <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, maximum-scale=1.0, minimum-scale=1.0, user-scalable=yes" /> <?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') . ' -->';
// (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" type="text/css"/>

</head> <?php // NOTE: Blank line following is intended: ?> ```

Happy Day! I'm going to make sure I've done my site upgrade correctly and I'll test to see if this works. Thanks so much Design75

19 Nov 2015, 2:41 PM
#295
brittainmark avatar

brittainmark

Totally Zenned

Join Date:
Apr 2009
Posts:
507
Plugin Contributions:
1

Re: Responsive DIY Template Default for v1.5.x

Have been looking at site optimisation for search engines and found that for google to properly understand that we supply different pages for different devices we should set```php
header('Vary: User-Agent');

20 Nov 2015, 12:03 AM
#296
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Responsive DIY Template Default for v1.5.x

This template uses mobileDetect which uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.

Which is added in the templates html_header file by including mobiledetect on every page. Site optimization is done by using the mobileDetect sessions to correctly call mobile specific files only for mobile users.

Most detection scripts detect the UA and redirects the user to a mobile.site which google says to avoid and ```php
header('Vary: User-Agent');


This is my understanding and opinion only. Others may weigh in differently!

As for me, I'm off to Fiji, see everyone next year!

> **brittainmark:**
>
> Have been looking at site optimisation for search engines and found that for google to properly understand that we supply different pages for different devices we should set```php
 header('Vary: User-Agent');
``` somewhere to let google know that we serve different code and css for different devices.  I have had a look through the code and cannot see that this is set but do not understand enough to say if you are stetting other header information to make this unnecessary. My question is if this is necessary where should it go in the code? If not sorry to bother you.
23 Nov 2015, 10:24 PM
#297
mike_d_1 avatar

mike_d_1

New Zenner

Join Date:
Sep 2013
Location:
Honolulu, HI
Posts:
88
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

Mike D:

Happy Day! I'm going to make sure I've done my site upgrade correctly and I'll test to see if this works. Thanks so much Design75

Gosh, I don't know what's wrong. I've upgraded my site from 1.5.1 to 1.5.4, that has gone smoothly and without any hitches, I even cleaned up some things that should've been in overrides the whole time.

But I'm getting the same result: Main pages on all devices do not load responsive stylesheets. Something seems to foul up at that part of the html_header.

I'm now just straight up using Design75s html_header because the last bit about loading the awesome-fonts lets me know it's still loading that part, just not the bit right before it where it selects which responsive stylesheet to use.

Another thing is that I need to have the "Display the Desktop/Mobile/Tablet View Link on ##########" set to false or the main page comes up with an "Error! Unable to determine page link" message on whichever device I'm using.

Any ideas? I don't seem to be generating any error files in my logs folder either.

http://www.shakatourshawaii.com/test/

24 Nov 2015, 2:53 PM
#298
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Location:
picaflor-azul.com
Posts:
6,940
Plugin Contributions:
28

Re: Responsive DIY Template Default for v1.5.x

Mike D:

Gosh, I don't know what's wrong. I've upgraded my site from 1.5.1 to 1.5.4, that has gone smoothly and without any hitches, I even cleaned up some things that should've been in overrides the whole time.

But I'm getting the same result: Main pages on all devices do not load responsive stylesheets. Something seems to foul up at that part of the html_header.

I'm now just straight up using Design75s html_header because the last bit about loading the awesome-fonts lets me know it's still loading that part, just not the bit right before it where it selects which responsive stylesheet to use.

Another thing is that I need to have the "Display the Desktop/Mobile/Tablet View Link on ##########" set to false or the main page comes up with an "Error! Unable to determine page link" message on whichever device I'm using.

Any ideas? I don't seem to be generating any error files in my logs folder either.

http://www.shakatourshawaii.com/test/

If I have to guess I would say that the problem is in either the html_header.php file or the tpl_main_page.php file. Did you check very carefully to see that you have all of the package files on your server in the correct places?

Thanks,

Anne

25 Nov 2015, 12:23 AM
#299
mike_d_1 avatar

mike_d_1

New Zenner

Join Date:
Sep 2013
Location:
Honolulu, HI
Posts:
88
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

picaflor-azul:

If I have to guess I would say that the problem is in either the html_header.php file or the tpl_main_page.php file. Did you check very carefully to see that you have all of the package files on your server in the correct places?

Thanks,

Anne

Actually it turns out I didn't change the directory that the modules were in (column_left.php and column_right.php) so I renamed that to my template name but it doesn't appear to have changed anything.

I also changed another directory in the admin (zadmin>includes>installers>responsive_default>2_1b.php) from responsive_default to my template name but that also doesn't appear to have changed anything. The other files appear to be where they should be.

I also notice that in the template description it says that a file logo.jpg is required but I don't have such a file. Could that be hanging me up? And if so where should I be putting that file?

I'm now poking through the html_header and tpl_main_page files. I'm guessing because the problem seems to be that the responsive stylesheets aren't loading for only the main pages I should be looking for things that involve $this_is_home_page or main_page?

25 Nov 2015, 5:09 AM
#300
mike_d_1 avatar

mike_d_1

New Zenner

Join Date:
Sep 2013
Location:
Honolulu, HI
Posts:
88
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

OK so I loaded the original responsive default common files onto my site instead of my edited ones and I'm still getting the same problem (no responsive stylesheets on main pages and mobile/tablet/desktop links breaking the page) so now I'm led to believe it's something else entirely. I don't know why I didn't think to try that sooner. I'm now going to systematically switch to the default docs to be sure it is or isn't something there.