Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jan 2009
    Location
    Iowa, USA
    Posts
    68
    Plugin Contributions
    0

    Default Problems creating my own Template

    I'm following the instructions in:

    Storeowner Docs / Template System / Creating your own Template

    and:

    Storeowner Docs / Template System / Creating the template_info.php file

    So, created the folder structure and copied Responsive *.css files as well as tpl_header.php and tpl_footer.php, and created the template_info file, including the line of code required for 2.1.0.

    Then set my Template to the newly made one.

    My Store is blank, unless I remove tpl_header.php from the new template.

    Any insights would be deeply appreciated!!!!

  2. #2
    Join Date
    Jan 2009
    Location
    Iowa, USA
    Posts
    68
    Plugin Contributions
    0

    Default Re: Problems creating my own Temaplate

    Added this earlier but apparently I didn't properly comment the code:

    Debug Log:

    text/plain myDEBUG-20260208-184645-064063-warning.log ( ASCII text )
    [08-Feb-2026 18:46:45 UTC] Request URI: /dev-2026/, IP address: 46.110.82.133, Language id 1
    #0 /home/samad616/public_html/dev-2026/includes/templates/soldiers_custom/common/tpl_header.php(45): zen_debug_error_handler()
    #1 /home/samad616/public_html/dev-2026/includes/templates/template_default/common/tpl_main_page.php(93): require('/home/samad616/...')
    #2 /home/samad616/public_html/dev-2026/index.php(94): require('/home/samad616/...')
    --> PHP Warning: Undefined variable $detect in /home/samad616/public_html/dev-2026/includes/templates/soldiers_custom/common/tpl_header.php on line 45.

    [08-Feb-2026 18:46:45 UTC] PHP Fatal error: Uncaught Error: Call to a member function isMobile() on null in /home/samad616/public_html/dev-2026/includes/templates/soldiers_custom/common/tpl_header.php:45
    Stack trace:
    #0 /home/samad616/public_html/dev-2026/includes/templates/template_default/common/tpl_main_page.php(93): require()
    #1 /home/samad616/public_html/dev-2026/index.php(94): require('/home/samad616/...')
    #2 {main}
    thrown in /home/samad616/public_html/dev-2026/includes/templates/soldiers_custom/common/tpl_header.php on line 45

    [08-Feb-2026 18:46:45 UTC] Request URI: /dev-2026/, IP address: 46.110.82.133
    --> PHP Fatal error: Uncaught Error: Call to a member function isMobile() on null in /home/samad616/public_html/dev-2026/includes/templates/soldiers_custom/common/tpl_header.php:45
    Stack trace:
    #0 /home/samad616/public_html/dev-2026/includes/templates/template_default/common/tpl_main_page.php(93): require()
    #1 /home/samad616/public_html/dev-2026/index.php(94): require('/home/samad616/...')
    #2 {main}
    thrown in /home/samad616/public_html/dev-2026/includes/templates/soldiers_custom/common/tpl_header.php on line 45.

    [08-Feb-2026 18:46:45 UTC] Request URI: /dev-2026/, IP address: 46.110.82.133
    --> PHP Fatal error: Uncaught Error: Call to a member function isMobile() on null in /home/samad616/public_html/dev-2026/includes/templates/soldiers_custom/common/tpl_header.php:45
    Stack trace:
    #0 /home/samad616/public_html/dev-2026/includes/templates/template_default/common/tpl_main_page.php(93): require()
    #1 /home/samad616/public_html/dev-2026/index.php(94): require('/home/samad616/...')
    #2 {main}
    thrown in /home/samad616/public_html/dev-2026/includes/templates/soldiers_custom/common/tpl_header.php on line 45.


    tpl_header.php starting at line 44:

    PHP Code:
    <?php
     
    if ( $detect->isMobile() && !$detect->isTablet() || $_SESSION['layoutType'] == 'mobile' ) {
    echo 
    '<div class="header Fixed"><a href="#menu" title="Menu"><i class="fa-solid fa-bars"></i></a></div>';
     } else if ( 
    $detect->isTablet() || $_SESSION['layoutType'] == 'tablet' ){
    echo 
    '<div class="header Fixed"><a href="#menu" title="Menu"><i class="fa-solid fa-bars"></i></a></div>';
    } else {
    //
    }

  3. #3
    Join Date
    Jan 2009
    Location
    Iowa, USA
    Posts
    68
    Plugin Contributions
    0

    Default Re: Problems creating my own Template

    Added this earlier but apparently I didn't properly comment the code:

    Debug Log:

    Code:
    text/plain myDEBUG-20260208-184645-064063-warning.log ( ASCII text )
    [08-Feb-2026 18:46:45 UTC] Request URI: /dev-2026/, IP address: 46.110.82.133, Language id 1
    #0 /home/samad616/public_html/dev-2026/includes/templates/soldiers_custom/common/tpl_header.php(45): zen_debug_error_handler()
    #1 /home/samad616/public_html/dev-2026/includes/templates/template_default/common/tpl_main_page.php(93): require('/home/samad616/...')
    #2 /home/samad616/public_html/dev-2026/index.php(94): require('/home/samad616/...')
    --> PHP Warning: Undefined variable $detect in /home/samad616/public_html/dev-2026/includes/templates/soldiers_custom/common/tpl_header.php on line 45.
    
    [08-Feb-2026 18:46:45 UTC] PHP Fatal error:  Uncaught Error: Call to a member function isMobile() on null in /home/samad616/public_html/dev-2026/includes/templates/soldiers_custom/common/tpl_header.php:45
    Stack trace:
    #0 /home/samad616/public_html/dev-2026/includes/templates/template_default/common/tpl_main_page.php(93): require()
    #1 /home/samad616/public_html/dev-2026/index.php(94): require('/home/samad616/...')
    #2 {main}
      thrown in /home/samad616/public_html/dev-2026/includes/templates/soldiers_custom/common/tpl_header.php on line 45
    
    [08-Feb-2026 18:46:45 UTC] Request URI: /dev-2026/, IP address: 46.110.82.133
    --> PHP Fatal error: Uncaught Error: Call to a member function isMobile() on null in /home/samad616/public_html/dev-2026/includes/templates/soldiers_custom/common/tpl_header.php:45
    Stack trace:
    #0 /home/samad616/public_html/dev-2026/includes/templates/template_default/common/tpl_main_page.php(93): require()
    #1 /home/samad616/public_html/dev-2026/index.php(94): require('/home/samad616/...')
    #2 {main}
      thrown in /home/samad616/public_html/dev-2026/includes/templates/soldiers_custom/common/tpl_header.php on line 45.
    
    [08-Feb-2026 18:46:45 UTC] Request URI: /dev-2026/, IP address: 46.110.82.133
    --> PHP Fatal error: Uncaught Error: Call to a member function isMobile() on null in /home/samad616/public_html/dev-2026/includes/templates/soldiers_custom/common/tpl_header.php:45
    Stack trace:
    #0 /home/samad616/public_html/dev-2026/includes/templates/template_default/common/tpl_main_page.php(93): require()
    #1 /home/samad616/public_html/dev-2026/index.php(94): require('/home/samad616/...')
    #2 {main}
      thrown in /home/samad616/public_html/dev-2026/includes/templates/soldiers_custom/common/tpl_header.php on line 45.

    tpl_header.php starting at line 44:

    PHP Code:
    <?php
     
    if ( $detect->isMobile() && !$detect->isTablet() || $_SESSION['layoutType'] == 'mobile' ) {
    echo 
    '<div class="header Fixed"><a href="#menu" title="Menu"><i class="fa-solid fa-bars"></i></a></div>';
     } else if ( 
    $detect->isTablet() || $_SESSION['layoutType'] == 'tablet' ){
    echo 
    '<div class="header Fixed"><a href="#menu" title="Menu"><i class="fa-solid fa-bars"></i></a></div>';
    } else {
    //
    }

  4. #4
    Join Date
    Jan 2009
    Location
    Iowa, USA
    Posts
    68
    Plugin Contributions
    0

    Default Re: Problems creating my own Temaplate

    Tried posting the debug log but not working so posting a screenshot of it:

    Name:  Screenshot 2026-02-09 135533.jpg
Views: 38
Size:  66.2 KB

  5. #5
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,511
    Plugin Contributions
    126

    Default Re: Problems creating my own Temaplate

    You're not creating an instance of the MobileDetect class.

    See includes/templates/responsive_classic/common/main_template_vars.php

    lines 36-39 in 2.1.0.

    Having said that ... creating a new template is a HUGE job. You'd be better off starting the the Responsive Classic Redesign and tweaking to taste.

    https://docs.zen-cart.com/user/templ...ssic_redesign/
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  6. #6
    Join Date
    Jan 2009
    Location
    Iowa, USA
    Posts
    68
    Plugin Contributions
    0

    Default Re: Problems creating my own Temaplate

    Thanks SWGUY - I wasn't even aware of this template. Will get right on it.

    BTW - I may have many more questions as time goes by.

  7. #7
    Join Date
    Jan 2009
    Location
    Iowa, USA
    Posts
    68
    Plugin Contributions
    0

    Default Re: Problems creating my own Temaplate

    Sorry but I'm easily confused, and have changed direction several times during this move to 2.1.0.

    Responsive Classic Redesign and Responsive Classic are the same? "Creating your own Template" instructions for customizing Responsive Classic are not accurate? So should I make style changes directly in the Responsive Classic template?

    Trying to get on true bearing here before moving forward.

  8. #8
    Join Date
    Jan 2009
    Location
    Iowa, USA
    Posts
    68
    Plugin Contributions
    0

    Default Re: Problems creating my own Template

    Okay it's starting to soak in. I'm just so enthusiastic about upgrading that I'm tripping over my own feet at every turn.

    Please try to bear with me.

  9. #9
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,511
    Plugin Contributions
    126

    Default Re: Problems creating my own Template

    Upgrading is good and enthusiastic is good! So, double good. :).

    You may not be aware that there's another template called Bootstrap which is also available and might be a good starting point for you:

    https://docs.zen-cart.com/user/template/bootstrap/
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  10. #10
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,684
    Plugin Contributions
    11

    Default Re: Problems creating my own Template

    Regardless of which template you choose to manipulate to your liking, I would suggest you use the clone a template mod before you start changing things.

    You'll always have a test/base template to fall back on when things go bump in the night.
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Creating your own template - HELP
    By nxsteven in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 16 Feb 2010, 05:17 PM
  2. Creating your own template???
    By thestampnomad in forum General Questions
    Replies: 2
    Last Post: 21 Oct 2009, 04:20 AM
  3. Base template to use for creating my own customized template?
    By liya in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 9 Mar 2007, 10:28 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