Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Aug 2009
    Posts
    368
    Plugin Contributions
    0

    Default load tpl_header based on device type

    For my new project I have decided to create 3 different files tpl_header_xxx.php ( desktop, mobile, tablet ) an load them into tpl_main_page.php based on device detection software.

    What do think about this strategy ?

    thx

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: load tpl_header based on device type

    What is your business reasoning for doing this?
    What specific problem are you hoping to solve?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,845
    Plugin Contributions
    25

    Default Re: load tpl_header based on device type

    see the Responsive DIY Template Default for 1.5.x . It uses 3 different header files one for each scenario.

  4. #4
    Join Date
    Sep 2008
    Posts
    210
    Plugin Contributions
    21

    Default Re: load tpl_header based on device type

    Quote Originally Posted by Design75 View Post
    see the Responsive DIY Template Default for 1.5.x . It uses 3 different header files one for each scenario.
    You should only use 1 for all devices :)
    Our Site: http://zucando.com
    Marketing Plugins: Marketing Modules
    Free Response Templates: Responsive Templates

  5. #5
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,845
    Plugin Contributions
    25

    Default Re: load tpl_header based on device type

    Quote Originally Posted by cvhainb View Post
    You should only use 1 for all devices :)
    That's a matter of opinion. You can use one big file, or three smaller ones. Using three makes it a lot easier to know what you are doing.

  6. #6
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: load tpl_header based on device type

    Quote Originally Posted by DrByte View Post
    What is your business reasoning for doing this?
    What specific problem are you hoping to solve?
    I was waiting for a reply to above questions.

    Quote Originally Posted by Design75 View Post
    see the Responsive DIY Template Default for 1.5.x . It uses 3 different header files one for each scenario.
    It does only to show an "example" that you can.

    Quote Originally Posted by Design75 View Post
    That's a matter of opinion. You can use one big file, or three smaller ones. Using three makes it a lot easier to know what you are doing.
    Nods in agreement

    Basically if you have a site that already exists and the header itself is customized and jammed packed with a ton of plugins, it might be easier to separate into device specific files.

    If starting a project from scratch and it's a responsive project one should use the mobile-first approach (stack to horizontal) and device specific files won't be needed.

    You can simply use "mobile detect" to call device specific jquery, javascript and even css.
    Last edited by rbarbour; 21 Mar 2016 at 09:21 AM.

 

 

Similar Threads

  1. v139h custom tpl_header based on language
    By Ruts67 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 18 Feb 2012, 07:18 AM
  2. Shipping based on Product type?
    By snowgoose in forum Built-in Shipping and Payment Modules
    Replies: 6
    Last Post: 12 Jul 2011, 01:14 AM
  3. Payment options based on customer type
    By scottmcclean in forum Managing Customers and Orders
    Replies: 3
    Last Post: 18 Dec 2009, 09:34 AM
  4. tpl_footer & tpl_header text based on language
    By shocker in forum Addon Language Packs
    Replies: 24
    Last Post: 28 Dec 2008, 10:48 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