Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2006
    Posts
    2
    Plugin Contributions
    0

    Default Adding a stylesheet to a language pack?

    Sorry if someone has covered this, but I did a seach and cannot find the answer.

    I have a background image with text in it in the main wrapper. You can see the design here:

    http//:www.jim-hill.com/catalog/index.php

    Unfortunately, the French Language selection keeps the same image (of course). Can I put a stylesheet into the French section to select a different image? If so, how should I set it up.

    All suggestions gratefully accepted. Thanks.

  2. #2
    Join Date
    Aug 2006
    Posts
    6
    Plugin Contributions
    0

    Default Re: Adding a stylesheet to a language pack?

    i did the following:

    back up first

    1. i opened /includes/functions/html-output
    2. search for the function "function zen_image_button"
    3. after this function (after the closing tag } ) i made a new function with a new name:
    Code:
    //// added by Brainiack
    /// outputs an image from includes - templates - MY_TEMPLATE - images - language
    // Output a function button in the selected language
    
      function brainiack_image_button($image, $alt = '', $parameters = '') {
        global $template, $current_page_base;
        return zen_image($template->get_template_dir($image, DIR_WS_TEMPLATE, 'images/' . $_SESSION['language'] . '/') . $image, $alt, '', '', $parameters);
    //    return zen_image($template->get_template_dir($image, DIR_WS_TEMPLATE, $current_page_base, 'images/' . $_SESSION['language'] . '/') . $image, $alt, '', '', $parameters);
      }
    now on every page where i want i change the call to the standard image function (zen_image_button) from zencart to brainiack_image_button. For example in document_product_info.php or other files.

    4. now you need to create a subfolder under /includes/templates/YOUR_TEMPLATE/images/ with the name of the language. In my case i have dutch added as "nederlands", so i have a subfolder nederlands .

    5. To get things going smoothly and not messing up al kind of image names in differentfolders i made a new file brainiack_image_names.php in every folder of /includes/languages/YOUR_LANGUAGE. This might come in handy when you want to have filenames in french and filenames in english. just add lines of defines like:
    Code:
    define('MORE_INFO', 'button_info.jpg');
    define('MORE_INFO_ALT', 'Meer informatie aanvragen');
    6. to make point 5 work you have to add an additional line in filenames.php in includes/ like define('FILENAME_BRAINIACK_IMAGES_NAMES','brainiack_images_names.php');

    7. you also have to alter /includes/languages/YOUR_LANGUAGE.PHP. Add the following code just at the end of the document before the closing ?> tag
    Code:
    //  include template specific brainiack image name defines
      if (file_exists(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir . '/' . FILENAME_BRAINIACK_IMAGES_NAMES)) {
        $template_dir_select = $template_dir . '/';
      } else {
        $template_dir_select = '';
      }
      require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir_select . FILENAME_BRAINIACK_IMAGES_NAMES);
    8. example of calling the function:
    Code:
    <?php echo brainiack_image_button(MORE INFO , MORE INFO_ALT); ?>
    MORE_INFO_ALT is the text that will be displayed when the image is missing or when you hoover over this image with the mouse.


    if you have any questions post them here. If things get messed up, don't blame me.

  3. #3
    Join Date
    Sep 2006
    Posts
    2
    Plugin Contributions
    0

    Default Re: Adding a stylesheet to a language pack?

    Thanks, i'll give that a try and let you know how I get on.

    Cheers.

  4. #4
    Join Date
    Aug 2006
    Posts
    6
    Plugin Contributions
    0

    Default Re: Adding a stylesheet to a language pack?

    cheers!

    CHEERS

    Here it is friday and i gonna have weekend!!

  5. #5
    Join Date
    May 2004
    Location
    Hong Kong
    Posts
    1,291
    Plugin Contributions
    1

    Default Re: Adding a stylesheet to a language pack?

    For information, there is a docs in the docs directory of the default Zen Cart installation.
    docs/readme_css_system.html

    Code:
                  style*.css // are always loaded and at least ONE should contain site-wide properties.
    language_stylesheet.css // changes to ALL pages, when that language is used
              page_name.css // changes to one page
     language_page_name.css // changes to one page, when that language is used
                c_??_??.css // changes to all info pages in a category
       language_c_??_??.css // changes to all info pages in a category, when that language is used
                   m_??.css // changes to a manufacturer's listing page
          language_m_??.css // changes to a manufacturer's listing page, when that language is used
                   p_??.css // changes to a product's info page
          language_p_??.css // changes to a product's info page, when that language is used
                 print*.css // printer-friendly global usage site-wide changes for printing-only
    A New Starter again

 

 

Similar Threads

  1. Redirects broken after adding the language pack
    By Solartist in forum General Questions
    Replies: 2
    Last Post: 2 Nov 2014, 04:51 AM
  2. Help with PayPal sidebox after adding French Language pack
    By scottmcclean in forum Addon Language Packs
    Replies: 2
    Last Post: 8 Nov 2011, 08:41 PM
  3. HTTP 500 Error when accessing admin area after adding language pack
    By mottaguedes in forum Basic Configuration
    Replies: 2
    Last Post: 27 Jul 2011, 04:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg