Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1
    Join Date
    Jul 2007
    Location
    UK? US?
    Posts
    118
    Plugin Contributions
    0

    Default custom template woes

    I am having a hard time working out what I need to do to solve my problem with custom templates and files and I need someone to put me back on the right track....please!!!!!

    I am making changes to files and uploading them and nothing is happening.

    What I cannot get my head around is how, if I make a folder called "custom" and slot it in say includes/languages/CUSTOM/english how is the program supposed to "find" it when it has been moved???


    I am sure this is a lot simpler than I am making it but I am really very confused.
    I recognise it is not a good thing to edit the "core files" because of future upgrades but I dont understand how the template overriddes work.

    I have tried on a numerous occasions to work out how to add a custom template and right now I have 3 templates in my admin.

    one called "custom" which when previewed results in this error
    cart/includes/templates/custom/images/scr_template_default.jpg

    one called "newfiles" which when previewed, results in this error
    cart/includes/templates/newfiles/images

    and the default template which is now called MY classic contemporary green. I do remember adding the word "my" when I was trying to "clone" the classic green template so I could edit that without touching the original as per a suggestion from someone on the forum.

    Right now I have custom folders added to different folders EVERYWHERE and 3 custom templates of which only one works (the one that was there already) and I don't know how to delete the faulty ones and I am getting increasingly frustrated.

    Can anyone explain the concept to me in easier terms than I am reading so I can find the files I need, makes the changes, upload them back to the correct folder while NOT changing any of the existing files??????

    It's a minefield to me and my head hurts :)

    Thanks in advance.

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

    Default Re: custom template woes

    The simplest description of override files is that Zen Cart is programmed, every time it needs to run a file, to look in the current template's directory for a copy of that file. If it doesn't find one, it uses the default copy.

  3. #3
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,174
    Plugin Contributions
    0

    Default Re: custom template woes

    To create a very basic custom template (you can build from there), you need:
    • includes/languages/YOUR_TEMPLATE/english.php
    • includes/languages/english/YOUR_TEMPLATE/index.php
    • includes/languages/english/YOUR_TEMPLATE/header.php (to change the logo)
    • includes/templates/YOUR_TEMPLATE/template_info.php
    • includes/templates/YOUR_TEMPLATE/common/tpl_header.php
    • includes/templates/YOUR_TEMPLATE/common/tpl_footer.php
    • includes/templates/YOUR_TEMPLATE/images/logo.gif
    • includes/templates/YOUR_TEMPLATE/css/stylesheet.css


    Anywhere you see a /classic/ folder, you can create a folder for your custom template. You can copy the necessary files from either the /classic/ folder, the /template_default/ folder or the parent folder.

    Edit includes/templates/YOUR_TEMPLATE/template_info.php to give your template identifying information so you'll recognize it in the admin under tools->template selection.

    Once you select your template in the admin, ZC will know where to look for the custom information you created.

  4. #4
    Join Date
    Dec 2005
    Posts
    1,059
    Plugin Contributions
    2

    Default Re: custom template woes

    If you're like me, a visual aid helps a lot in understanding the overrides system!
    Go here and print out the page, or to the link at the bottom of that page for a chart in the downloads section:

    https://www.zen-cart.com/tutorials/i...hp?article=143
    [FONT=Arial]Country Kitty Crafts[/FONT][FONT=Arial]
    [/FONT] [FONT=Garamond]
    [/FONT]

  5. #5
    Join Date
    Jul 2007
    Location
    UK? US?
    Posts
    118
    Plugin Contributions
    0

    Default Re: custom template woes

    Quote Originally Posted by gjh42 View Post
    The simplest description of override files is that Zen Cart is programmed, every time it needs to run a file, to look in the current template's directory for a copy of that file. If it doesn't find one, it uses the default copy.
    Thank you, thank you, thank you!!!!!!

    That helps sooo much in one area!

  6. #6
    Join Date
    Jul 2007
    Location
    UK? US?
    Posts
    118
    Plugin Contributions
    0

    Default Re: custom template woes

    Quote Originally Posted by afo View Post
    To create a very basic custom template (you can build from there), you need:
    • includes/languages/YOUR_TEMPLATE/english.php
    • includes/languages/english/YOUR_TEMPLATE/index.php
    • includes/languages/english/YOUR_TEMPLATE/header.php (to change the logo)
    • includes/templates/YOUR_TEMPLATE/template_info.php
    • includes/templates/YOUR_TEMPLATE/common/tpl_header.php
    • includes/templates/YOUR_TEMPLATE/common/tpl_footer.php
    • includes/templates/YOUR_TEMPLATE/images/logo.gif
    • includes/templates/YOUR_TEMPLATE/css/stylesheet.css


    Anywhere you see a /classic/ folder, you can create a folder for your custom template. You can copy the necessary files from either the /classic/ folder, the /template_default/ folder or the parent folder.

    Edit includes/templates/YOUR_TEMPLATE/template_info.php to give your template identifying information so you'll recognize it in the admin under tools->template selection.

    Once you select your template in the admin, ZC will know where to look for the custom information you created.
    Thanks for your help. I need to re-read this a couple of times and I am sure it will be very valuable


    thanks again.

  7. #7
    Join Date
    Jul 2007
    Location
    UK? US?
    Posts
    118
    Plugin Contributions
    0

    Default Re: custom template woes

    Quote Originally Posted by TShooters View Post
    If you're like me, a visual aid helps a lot in understanding the overrides system!
    Go here and print out the page, or to the link at the bottom of that page for a chart in the downloads section:

    https://www.zen-cart.com/tutorials/i...hp?article=143
    Thanks

  8. #8
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,174
    Plugin Contributions
    0

    Default Re: custom template woes

    Hi Peggy,

    If you duplicate my list, you can play with the files in the YOUR_TEMPLATE directory to your heart's content. If you make a major oopsie , you can simply copy the original file and start over. That's the great beauty of the template system. There's definitely a learning curve involved, but once you get past it, you'll wonder why you thought it was so difficult.

    Good Luck and Happy Zenning!

  9. #9
    Join Date
    Jul 2007
    Location
    UK? US?
    Posts
    118
    Plugin Contributions
    0

    Default Re: custom template woes

    Quote Originally Posted by afo View Post
    Hi Peggy,

    If you duplicate my list, you can play with the files in the YOUR_TEMPLATE directory to your heart's content. If you make a major oopsie , you can simply copy the original file and start over. That's the great beauty of the template system. There's definitely a learning curve involved, but once you get past it, you'll wonder why you thought it was so difficult.

    Good Luck and Happy Zenning!
    Yes your post was invaluable. I finally got it figured out.
    I think I was doing it correct (mostly..lol) all along
    I think the frustrations came because my editor seemed to have a bug. I could never find the corresponding files in it.
    However if I found them in windows first then opened them from there I was SURE to have the correct file to edit.

    thanks again

  10. #10
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,174
    Plugin Contributions
    0

    Default Re: custom template woes

    I have a copy of ZC (multiples, actually) unzipped on my local drive. I can't run ZC locally, but I find it much easier to locate, create and edit folders and files locally and then upload (FTP) them to the appropriate place on the website. Since the folder/file structure is the same, it's pretty easy to match them up.

    Always use a text editor to edit php files. Notepad and Crimson Editor are fine. If you have CPanel as your webmaster interface, NEVER use the CPanel editor to edit php files. It messes them up.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. Template selection page not viewable after uploading custom template
    By mek113 in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 28 Apr 2011, 05:16 PM
  2. Custom template not showing in admin Template Selection
    By erinl in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 10 Aug 2008, 07:51 PM
  3. Custom Template Doesn't Appear in Tools : Template Selection
    By frogtaco in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 15 Nov 2006, 07:53 PM
  4. Template Woes
    By Shelia in forum General Questions
    Replies: 2
    Last Post: 7 Jul 2006, 07:20 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