Multiple (flash) headers with multiple languages
Hi all,
I've altered my header with flash content. To do so I created the map MyTemplate/common and copied an altered version of the tlp_header file in there. All works fine.
Now, I have installed a second language pack (English & Dutch). Since my flash header contains navigation, I would like to use 2 types of headers --> English and Dutch, depending on the selected language by the user.
I didn't manage to get it done myself... Hope one of you can inform me on how to go about with this issue.
Thanks in advance!
Jurjen
Zen Cart v1.3.8
Re: Multiple (flash) headers with multiple languages
How much do you need to change? Is it *only* the flash you want to change?
(I gather the rest of your content already changes languages properly?)
Can you post your tpl_header.php contents here?
Re: Multiple (flash) headers with multiple languages
Thanks for you reply.
Yes, everything else changes properly, and I only want to change the flash header to another lanuage when the user chooses so.
My tlp_header:
<?php
/**
* Common Template - tpl_header.php
*
* this file can be copied to /templates/your_template_dir/pagename<br />
* example: to override the privacy page<br />
* make a directory /templates/my_template/privacy<br />
* copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_header.php<br />
* to override the global settings and turn off the footer un-comment the following line:<br />
* <br />
* $flag_disable_header = true;<br />
*
* @package templateSystem
* @copyright Copyright 2003-2006 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: tpl_header.php 4813 2006-10-23 02:13:53Z drbyte $
*/
?>
<?php
// Display all header alerts via messageStack:
if ($messageStack->size('header') > 0) {
echo $messageStack->output('header');
}
if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) {
echo htmlspecialchars(urldecode($_GET['error_message']));
}
if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) {
echo htmlspecialchars($_GET['info_message']);
} else {
}
?>
<!--bof-header logo and navigation display-->
<?php
if (!isset($flag_disable_header) || !$flag_disable_header) {
?>
<div id="headerWrapper">
<!--bof-navigation display-->
<div id="navMainWrapper">
<div id="navMain">
<ul class="back">
<li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
<?php if ($_SESSION['customer_id']) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li>
<li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>
<?php
} else {
if (STORE_STATUS == '0') {
?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li>
<?php } } ?>
<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
<li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
<?php }?>
</ul>
</div>
<div id="navMainSearch"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div>
<br class="clearBoth" />
</div>
<!--eof-navigation display-->
<!--bof-branding display-->
<div id="logoWrapper">
<script type="text/javascript" src="includes/templates/charroutemplate/jscript/swfobject.js"></script>
<div id="flashcontent">
This text is replaced by the Flash movie.
</div>
<script type="text/javascript">
var so = new SWFObject("includes/templates/charroutemplate/images/flash/charrou.swf", "charrou", "950", "370", "3", "#000000");
so.write("flashcontent");
</script>
</div>
<br class="clearBoth" />
<!--eof-branding display-->
<!--eof-header logo and navigation display-->
<!--bof-optional categories tabs navigation display-->
<?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?>
<!--eof-optional categories tabs navigation display-->
<!--bof-header ezpage links-->
<?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?>
<?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?>
<?php } ?>
<!--eof-header ezpage links-->
</div>
<?php } ?>
Thanks,
Jurjen
Re: Multiple (flash) headers with multiple languages
Try replacing this:
Code:
new SWFObject("includes/templates/charroutemplate/images/flash/charrou.swf", "charrou",
with this:
Code:
new SWFObject("<?php echo HEADER_SWF; ?>", "charrou",
and then in your /includes/languages/english/charroutemplate/header.php file, add this:
Code:
define('HEADER_SWF', 'includes/templates/charroutemplate/images/flash/charrou_en.swf');
and for /includes/languages/dutch/charroutemplate/header.php
Code:
define('HEADER_SWF', 'includes/templates/charroutemplate/images/flash/charrou_nl.swf');
(This assumes you already have a header.php file in each of your charroutemplate language folders ... if you don't already have one, copy it from the /includes/languages/english/header.php and modify appropriately.)
Re: Multiple (flash) headers with multiple languages
Awesome! works perfectly.
You're the best, thanks a lot!
Regards,
Jurjen
Re: Multiple (flash) headers with multiple languages
Hi,
In IE the changing flash headers work perfectly, but I just found out that now my flash content is not loaded in Firefox... Any ideas?
Thanks,
Jurjen
Re: Multiple (flash) headers with multiple languages
Quote:
Originally Posted by
jurjenruben
I just found out that now my flash content is not loaded in Firefox... Any ideas?
The HTML and JavaScript code you're using to load your flash objects may not be compatible with FireFox.
You may have to tweak it or find another method of loading your flash scripts which is compatible with multiple browsers.
Re: Multiple (flash) headers with multiple languages
Quote:
Originally Posted by
jurjenruben
Hi,
In IE the changing flash headers work perfectly, but I just found out that now my flash content is not loaded in Firefox... Any ideas?
Thanks,
Jurjen
I think you are calling flash incorrectly..below my own code that
works when browsing using IE7, Firefox and Safari.
Placed in /includes/templates/mytemplate/common/tpl_header.php
Code:
<!--bof-branding display-->
<script type="text/javascript" src="includes/templates/mytemplate/js/swfobject.js"></script>
<div id="flashcontent">
<center>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0"
id="Movie3" width="760" height="194">
<param name="movie" value="Movie3.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#FFCCCC">
<embed name="Movie3" src="Movie3.swf" quality="high" bgcolor="#FFCCCC"
width="760" height="194"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</embed>
</object>
</center>
<script type="text/javascript">
var so = new SWFObject("includes/templates/mytemplate/Movie3.swf", "YOUR_HEADER", "760", "194", "7", "#FFCCCC");
so.write("flashcontent");
</script>
</div>
<!--eof-branding display-->
HTH
Re: Multiple (flash) headers with multiple languages
Quote:
Originally Posted by
misty
I think you are calling flash incorrectly..
I think it works now :bigups:
Thanks a lot!!
Re: Multiple (flash) headers with multiple languages
If you post url of your zencart store
or send me pm with details, will check in
all 3 browsers for you, just to make sure..