Setting up my override directories
I have been trying to figure out template overrides, and I downloaded the chart from the download section that shows the overrides and it is really helpful and I think I am understanding it. I am using a template that I downloaded but have created directories for such things as the header, and the define pages, etc. into the new directories called "sage" because that is the template I am using.
I went through and created a new sage directory in every location that was on the chart which appears to be basically everywhere that a classic directory exists. I notice that all those classic directories are empty. Am I supposed to put files into the new sage directories I created, or leave them empty to?
For example /includes/modules/sideboxes contains several php files along with the directories classic and sage which are both empty. Am I supposed to copy all of those php files into the new directory I created? And if so, is the purpose of it just so to preserve the file structure when zen cart is updated?
Re: Setting up my override directories
You only need to copy files into your /sage/ folders if/when you modify them. The /classic/ folders are mainly markers; many of them do not have contents.
A major purpose of the override folders is to identify which files you have modified. You will still need to merge any changes if an upgrade modifies the core file, but you can tell at a glance which files you need to compare and which ones you can ignore.
Re: Setting up my override directories
You should only put files that you've altered in your template overrides files.
Example: I've downloaded the About Us contribution, and I want to use it to
make several new pages w/links that will be in my Information sidebox.
In order to do that, I'll need to alter the file includes/modules/sideboxes/information.php. I make my changes/additions to
a copy of that file, and upload my information.php file to includes/modules/sideboxes/my_template. Now my changes are in place, and safe when it comes time to upgrade.
The chart is to show you where you **may** make a custom template folder...a quick visual reference.
Hope this helps. I know it took me quite a while to figure it out and understand
it. You're doin' great!
Re: Setting up my override directories
Ok I think i get it. So it is ok that I just made all those directories and leave them empty as markers. When you say only to move files you've altered, does that mean files that you actually go into and edit the code, or files that may change automatically (such as if you make edits in the admin section). The reason I ask that is because if that happens, how do you know which files have been altered?
As far as your example, when you changed the information.php, did you just copy that file only to your directory, or did you copy every file in the sideboxes directory into yours?
Does it just automatically look for files in your custom template directory first and if it doesnt find anything, it uses the default?
Thanks
Re: Setting up my override directories
Yep, that's the way it works.
You only copy the actual file you have edited into your template folder.
Any files you edit in the Define Pages Editor will be saved in the default versions; you should copy all of those to /your_template/, and then future changes in the Define Pages Editor will be saved to your template version.
Re: Setting up my override directories
this thread helps clears up the purpose of the many empty file directories for me too, thanks!
i just went through and added directories for 4 templates. now need to go back through them and pull out any duplicate files.
i found some questionable directory placements of sideboxes in "templates" rather then "modules" for download templates. moved the files to "modules>sideboxes>my_template"
been up all night till i am cross-eyed as i cram on mods for future website in development.
fashions
Re: Setting up my override directories
Cross-check those files with /template_default/ ... there are supposed to be some files in /your_template/sideboxes/, and some filenames look like they ought to be in /modules/ but really do belong in /templates/....
Re: Setting up my override directories
Quote:
Originally Posted by
gjh42
Cross-check those files with /template_default/ ... there are supposed to be some files in /your_template/sideboxes/, and some filenames look like they ought to be in /modules/ but really do belong in /templates/....
am doing just that and came up with "html_header.php" in includes>templates>my_directory, and so far find no reference to that being there. now the question is where does it go? i'll keep digging till i hear otherwise.
CSS FLyout header 1.4
barebones template
CSS_dropdown_menu
Alternative header 1.1a
fashions
Re: Setting up my override directories
Take a distinctive snippet from your copy (one that would be the same in the original) and look that up in Tools > Developers Toolkit. Paste the snippet in the lower left box, select all files and search.
That will show you where else the file exists.
Re: Setting up my override directories
/includes/templates/your_template/common/html_header.php