Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Finding the right files

Finding the right files

Views: 876

Results 1 to 12 of 12
7 Jul 2011, 8:29 PM
#1
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Finding the right files

Please show me the correct procedure to find the correct file. I always go to a wrong file.

In this instance, I look for where to remove the zen cart image from the home page. (Have you got yours yet? etc.)

I use Firefox to look at the site and fire bug to show different elements.

I select the element in Firefox and Fire bug shows this element

<div id="indexDefaultMainContent" class="content">

So now I take "indexDefaultMainContent" and use Developer Tools in Admin to find the file.

I look up in all files - All files Catalog/Admin - PHP and CSS.

I find this:
file is in /public_html/includes/templates/template_default/templates/tpl_index_default.php
The code is "Line #38 : <div id="indexDefaultMainContent" class="content"><?php require($define_page); ?></div> "

So now I know which file to go to but there is nothing what I want to change!!

I do not know PHP yet but I think the reference here is to another file, $define_page. I cannot find this file anywhere. I look all over the file structure for hours so now I ask if it exists at all.

Also please, is what I do, the correct way or must I do something different?

thank you
Ivanna

7 Jul 2011, 8:55 PM
#2
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Finding the right files

Now I find how to make the changes in Admin/Tools?Define Pages Editor.

This edits the page public_html/includes/languages/english/html_includes/define_main_page.php

So now a new questions also arises. the file did not save in my folder for instance

public_html/includes/languages/barebones/html_includes/define_main_page.php

Should it save in barebones or in english folder?

I understand all changes must be in barebones folders.

Am I doing this wrong also?

thank you
Ivanna

7 Jul 2011, 9:28 PM
#3
shoplittlemissk avatar

shoplittlemissk

New Zenner

Join Date:
Jul 2011
Location:
Illinois
Posts:
20
Plugin Contributions:
0

Re: Finding the right files

When looking for the files I need to edit, I use this tutorial:
https://www.zen-cart.com/tutorials/index.php?article=132

I actually printed it out, and keep it near my computer for quick reference. It's been really helpful in finding the default files to download and change. To upload them back, I just follow the file path, making sure to include my custom template folder at the end.

7 Jul 2011, 11:33 PM
#5
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Finding the right files

Thank you both for your replies but I do not think the questions are answered.

In my first question I ask if I am doing the search correct. From the tutorial, I think perhaps I am but maybe with not the right words because sometimes I do not find the files.

I also have the list of folders and files but for instance, if I look for something that I think is perhaps in includes/languages/english/*.php there are 73 files to go through. I think it is because I am not searching correct that I become frustrated. Sometimes it is ok and I go straight to a file and the line I want, other times it is hard.

I think I must just practice at that.

In my second question I ask if anything that is changed in Admin should be in my template folder. Today I make a change in Admin to define_main_page.

This change is saved in public_html/includes/languages/english/html_includes/define_main_page.php

My question is this, should it have saved to public_html/includes/languages/barebones/html_includes/define_main_page.php ?

Thank you both for your help
Ivanna

8 Jul 2011, 12:11 AM
#6
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Finding the right files

Ivanna:

In my first question I ask if I am doing the search correct. From the tutorial, I think perhaps I am but maybe with not the right words because sometimes I do not find the files.
I'm sure what you've been told is correct, but it's not the only way to find things. I almost never have used the admin tools to find things. I have a complete and untouched set of 1.3.9h files and a complete up-to-date backup of my site files here on my local hard drive. I use a programmer's text editor which has the ability to do a multi-file search across specified folders. That, plus the use of Firebug in Firefox, give me the ability to quickly and eaily find anything I want to find in Zen Cart. I look at the site in Firefox/Firebug to get a clue as to what I'm trying to find, then I search for that in the files here, comparing untouched files to my modified (perhaps) site files as needed.

Of course, it took some time and practice to figure out the subtler aspects of what to look for, but that will come as you work with Zen Cart.

Ivanna:

In my second question I ask if anything that is changed in Admin should be in my template folder. Today I make a change in Admin to define_main_page.

This change is saved in public_html/includes/languages/english/html_includes/define_main_page.php

My question is this, should it have saved to public_html/includes/languages/barebones/html_includes/define_main_page.php ?
I find that my changes are recorded in the first of those paths. I do not have an html_includes folder in the second of those paths you mention.

Rob

8 Jul 2011, 1:07 PM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Finding the right files

By default, your define page edits will be saved in the base /includes/languages/english/html_includes/ folder.
If you manually copy the file to /includes/languages/english/html_includes/your_template/, the Define Page Editor will then save further changes in it to your custom template folder.

Also, you would always use a folder path like /includes/languages/english/html_includes/barebones/, not
/includes/languages/english/barebones/html_includes/.

8 Jul 2011, 4:11 PM
#8
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Finding the right files

Once again thank you for your help with this matter. I understand much more now.

Rob, please what is the editor that you use? I use notepad2 but I do not think it does the things like multi-file search :no:

I need to do it right. If I can show my boss I can do it he said he will pay for college. :smartalec:

thank you
Ivanna

8 Jul 2011, 4:21 PM
#9
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Finding the right files

Notepad++ does have the ability to search in whole folders etc. Click on "Find..." under Search and look at the "Find in Files" options. I haven't used these yet, but it looks pretty powerful.

8 Jul 2011, 4:21 PM
#10
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Finding the right files

I use BBEdit, but it only runs on Mac OS. There are similar editors for Windows, but I don't know what they might be.

Rob

8 Jul 2011, 6:21 PM
#11
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Finding the right files

I found Crimson Editor which can search all files so I will try that.

I am looking for a good way to do things that is easy and faster than how I do it now. Also I write down everything I do and where I do it so I can go over it again and perhaps also use in my next project.

My boss says I should always do this he says it is a big failure with programmers and administrators.

8 Jul 2011, 7:14 PM
#12
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Finding the right files

I tried Crimson Editor to search multi-files and can only say :clap: WOW. :clap:

I cannot say how this helps me. Thank you so much. :yes:

Ivanna