Page 6 of 6 FirstFirst ... 456
Results 51 to 60 of 60
  1. #51
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Switching templates at run time

    You could use a switch like this:
    PHP Code:
    switch($_SESSION['language']){
      case 
    'english':
        
    $template_dir 'english_template';
        break;
      case 
    'french':
        
    $template_dir 'french_template';
        break;
      case 
    'portugues':
        
    $template_dir 'portugues_template';
        break;


  2. #52
    Join Date
    Mar 2008
    Posts
    55
    Plugin Contributions
    0

    Default Re: Switching templates at run time

    Thanks, yes, that looks simple to implement, but does it only switch for the user who selects the language, or does it switch for all users.
    If I connect and switch to French, and then Bill connects, does he see French? or the default English.

    Thanks for your help, can you point me at what file that switch actually goes in to achieve what I want please. I'm just starting with this language switching thing, although I am familiar with PHP. I do have the messages from this thread too.

    thanks

  3. #53
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Switching templates at run time

    This would be a switch that would operate at run-time, and only for the individual user.

    As for the file, I haven't looked at the code involved in a long time, so your best bet is to examine it for yourself.

  4. #54
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Switching templates at run time

    Guys, you're over-complicating this. Templates by language is already built into Zen Cart.

    If you go to Admin > Tools > Template Select there's a new language button. Click on that and you can select specific templates for each language that you have installed.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  5. #55
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Switching templates at run time

    One of the downsides of only using English... never had to look at language selections:)

  6. #56
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Switching templates at run time

    If it's any consolation, I don't recall ever having seen this mentioned before in this forum, and it gets just a one line reference in "the book".
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  7. #57
    Join Date
    Mar 2008
    Posts
    55
    Plugin Contributions
    0

    Default Re: Switching templates at run time

    ah. Well the problem I am seeing is that the new template has different layouts for the side boxes etc. Changing languages, and changing templates fails because the side-boxes no longer match.
    The template I want to change to is completly different to the 'standard' template, but has to completly replace each other depending on language switch.
    I don't think it can be don, unless there is a switch also in there to 'reset' the layout.

  8. #58
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Switching templates at run time

    There's no a switch, but each template can have its own arrangement of layout boxes. You have to have the template you want to change as the default template, and then go to Admin > Tools > Layout Boxes controller and set the layout boxes for that template. When you've finished, you'll probably want to set the default template back to what it was originally.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  9. #59
    Join Date
    Jul 2006
    Location
    Johannesburg
    Posts
    447
    Plugin Contributions
    1

    Default Re: Switching templates at run time

    or you can use this contribution to safe your current template sideboxes as default and just update your other templates with a single click.

    Save your sideboxes layout as the default

  10. #60
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Switching templates at run time

    I considered recommending that mod (it was written and submitted by my wife) but, useful though it is, it's really designed for when people want to use the same layout box configuration across several templates, rather than a different layout for each template.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

 

 
Page 6 of 6 FirstFirst ... 456

Similar Threads

  1. switching templates
    By RichardH in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 23 Jul 2008, 10:36 PM
  2. Switching php version in WAMP5 causes install to run
    By GreggShort in forum Installing on a Windows Server
    Replies: 2
    Last Post: 27 Jul 2007, 06:06 AM
  3. switching between templates
    By fairview in forum General Questions
    Replies: 4
    Last Post: 9 Apr 2007, 02:44 PM
  4. switching templates
    By onakat in forum Customization from the Admin
    Replies: 6
    Last Post: 3 Apr 2007, 10:18 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR