Results 1 to 10 of 62

Hybrid View

  1. #1
    Join Date
    Apr 2004
    Location
    vienna
    Posts
    198
    Plugin Contributions
    9

    Default Re: template switch addon

    Quote Originally Posted by MyDigitalFixation View Post
    If I have css buttons turned on in admin settings, is there a file I can override on a per template basis to hardcode turning off css buttons?
    one way could be to change the database-entry IMAGE_USE_CSS_BUTTONS
    Code:
    UPDATE configuration SET configuration_key = 'IMAGE_USE_CSS_BUTTONS_' WHERE configuration_key = 'IMAGE_USE_CSS_BUTTONS' LIMIT 1;
    this files make use from the constant IMAGE_USE_CSS_BUTTONS
    Code:
    includes\functions\html_output.php (267:20)
    includes\functions\html_output.php (293:20)
    includes\templates\template_default\sideboxes\tpl_search.php (17:18)
    includes\templates\template_default\sideboxes\tpl_search_header.php (16:18)
    you have now to create or modify the file includes\templates\YOUR_TEMPLATE\common\main_template_vars.php

    add a line with
    Code:
    define('IMAGE_USE_CSS_BUTTONS', 'no')
    you can see it
    - http://demo.zen-cart.at/index.php?ma..._switch_id=css == CSS buttons
    http://demo.zen-cart.at/index.php?ma...witch_id=XAJAX == image buttons

  2. #2
    Join Date
    Nov 2009
    Posts
    6
    Plugin Contributions
    0

    Default Re: template switch addon

    Thank you very much!

    I've revised code to alter the look of zencart but have never revised the functional code (except for installing mods) so I better run this by you first to be sure I get it correct.



    From includes\functions\html_output.php

    line 267

    if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes' && strlen($alt)<30) return zenCssButton($image, $alt, 'submit', $sec_class /*, $parameters = ''*/ );
    line 293

    if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') return zenCssButton($image, $alt, 'button', $sec_class, $parameters = '');

    From includes/templates/template_default/sideboxes - the code referencing IMAGE_USE_CSS_BUTTONS

    your line 17, in my file is at line 33

    if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') {

    From includes/templates/template_default/sideboxes - the code referencing IMAGE_USE_CSS_BUTTONS

    your line 16, in my file is at line 31

    if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') {

    for the above strings, after they have been revised, is this how they should look?


    From includes\functions\html_output.php

    line 267

    if (strtolower(UPDATE configuration SET configuration_key = 'IMAGE_USE_CSS_BUTTONS_' WHERE configuration_key = 'IMAGE_USE_CSS_BUTTONS' LIMIT 1;) == 'yes' && strlen($alt)<30) return zenCssButton($image, $alt, 'submit', $sec_class /*, $parameters = ''*/ );
    line 293

    if (strtolower(UPDATE configuration SET configuration_key = 'IMAGE_USE_CSS_BUTTONS_' WHERE configuration_key = 'IMAGE_USE_CSS_BUTTONS' LIMIT 1;) == 'yes') return zenCssButton($image, $alt, 'button', $sec_class, $parameters = '');




    From includes/templates/template_default/sideboxes - the code referencing IMAGE_USE_CSS_BUTTONS

    your line 17, in my file is at line 33

    if (strtolower(UPDATE configuration SET configuration_key = 'IMAGE_USE_CSS_BUTTONS_' WHERE configuration_key = 'IMAGE_USE_CSS_BUTTONS' LIMIT 1;) == 'yes') {



    From includes/templates/template_default/sideboxes - the code referencing IMAGE_USE_CSS_BUTTONS

    your line 16, in my file is at line 31

    if (strtolower(UPDATE configuration SET configuration_key = 'IMAGE_USE_CSS_BUTTONS_' WHERE configuration_key = 'IMAGE_USE_CSS_BUTTONS' LIMIT 1;) == 'yes') {

  3. #3
    Join Date
    Aug 2005
    Location
    Trujillo Alto, Puerto Rico
    Posts
    1,550
    Plugin Contributions
    9

    Default Re: template switch addon

    Can someone PLEASE, answer my question?
    IDEAS Girl
    IDEAS Creative Group
    = Your image... our business!

  4. #4
    Join Date
    Apr 2004
    Location
    vienna
    Posts
    198
    Plugin Contributions
    9

    Default Re: template switch addon

    sorry for confusion

    1)
    you have only to manipulate 1 template file :: includes\templates\YOUR_TEMPLATE\common\main_template_vars.php
    if the file does not exist, copy the one from template_default
    now add a line with
    Code:
      if (file_exists(DIR_WS_MODULES . 'pages/' . $current_page_base . '/main_template_vars.php')) {
        $body_code = DIR_WS_MODULES . 'pages/' . $current_page_base . '/main_template_vars.php';
      } else {
        $body_code = $template->get_template_dir('tpl_' . preg_replace('/.php/', '',$_GET['main_page']) . '_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_' . $_GET['main_page'] . '_default.php';
      }
    
    // template-switch
    define('IMAGE_USE_CSS_BUTTONS', 'no');
    2) use zen-cart admin
    tools > install sql patches and run
    Code:
    UPDATE configuration SET configuration_key = 'IMAGE_USE_CSS_BUTTONS_', configuration_title = 'CSS Buttons (functionless)' WHERE configuration_key = 'IMAGE_USE_CSS_BUTTONS' LIMIT 1;

  5. #5
    Join Date
    Apr 2004
    Location
    vienna
    Posts
    198
    Plugin Contributions
    9

    Default Re: template switch addon

    @ideasgirl
    look at :: http://demo.zen-cart.at/index.php?ma...id=viennablood

    viennablood == the standard german-template; 800px
    XAJAX == 1024px & ajax for products
    css == zen-cart international = screen wide
    hugo13_orange == smarty based template (never finished)

  6. #6
    Join Date
    Aug 2005
    Location
    Trujillo Alto, Puerto Rico
    Posts
    1,550
    Plugin Contributions
    9

    Default Re: template switch addon

    Quote Originally Posted by hugo13 View Post
    @ideasgirl
    look at :: http://demo.zen-cart.at/index.php?ma...id=viennablood

    viennablood == the standard german-template; 800px
    XAJAX == 1024px & ajax for products
    css == zen-cart international = screen wide
    hugo13_orange == smarty based template (never finished)
    Yes Hugo, but my question goes to "if it fixed" and not fluid. See, your templates (and other I've seen) are with fluid backgrounds (colors and bars) but I haven't seen it with different columns and boxes with different fixed width (which usually you have to change in admin panel).
    IDEAS Girl
    IDEAS Creative Group
    = Your image... our business!

  7. #7
    Join Date
    Nov 2009
    Posts
    6
    Plugin Contributions
    0

    Default Re: template switch addon

    That works perfectly. Thank you very much for the mod and the extra help!

  8. #8
    Join Date
    Apr 2004
    Location
    vienna
    Posts
    198
    Plugin Contributions
    9

    Default Re: template switch addon

    I think you can do all what you can do with css
    look at: http://demo.zen-cart.at/index.php?ma..._switch_id=css

    Code:
    #navColumnTwo {
      width: 111px !IMPORTANT;
    }
    
    #templateswitch {
    	position:absolute;
    	width:400px !IMPORTANT;
    	height:15px;
    	z-index:1;
    	left: 333px;
    	top: 77px;
    }
    #categories{
    	position:absolute;
    	width:200px !IMPORTANT;
    	height:15px;
    	z-index:1;
    	left: 3px;
    	top: 77px;
    }

  9. #9
    Join Date
    Aug 2005
    Location
    Trujillo Alto, Puerto Rico
    Posts
    1,550
    Plugin Contributions
    9

    Default Re: template switch addon

    Ok, great! I'll give it a try...
    IDEAS Girl
    IDEAS Creative Group
    = Your image... our business!

 

 

Similar Threads

  1. v151 Title tag on my template pages missing - cannot switch to default template
    By mrcastle in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 6 Aug 2014, 12:00 AM
  2. Lose my template style when I switch to my URL
    By ak6000 in forum Upgrading to 1.5.x
    Replies: 2
    Last Post: 19 Jun 2012, 04:30 PM
  3. Template overide/switch for one category
    By Davx in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 12 Sep 2011, 06:15 PM
  4. trying to install and switch to another template
    By sdpamperin in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 7 Sep 2009, 09:32 PM
  5. Fatal Error in UK Switch/Maesto cc_uk addon
    By hutting in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 16 May 2006, 10:02 AM

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