Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Having trouble customizing title

Having trouble customizing title

Locked

Views: 1,633

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
2 Oct 2009, 5:44 PM
#1
onesister avatar

onesister

New Zenner

Join Date:
Sep 2009
Posts:
23
Plugin Contributions:
0

Having trouble customizing title

I’ve just begun to customize my new installation of the classic template. I don’t want anything fancy, just want to customize it. So I read the instructions about the override system and thought I was doing it correctly. Apparently not! Now I’m afraid I’ve done something seriously wrong and am wondering how to return to ground zero.

I began with the title change. When it said to create a directory /includes/languages/english/CUSTOM I did, then copied a fresh meta_tags.php into it and made the appropriate changes. However I did not do this before I created a /includes/languages/CUSTOM as well. Although I can’t find it now, but some of the reams of information I read said to do that, but that now the ‘title’ had been moved.

So. Now I have two new CUSTOM directories. One with an english.php in it and one with a meta_tags.php in it. Both with the edited ‘title’. Of course it doesn’t work. I then see that I have to use the name of the template NOT ‘CUSTOM’. I go to Admin-Tools-Template Selection to see the name of the template is Classic Contemporary Green, which, I think, cannot be correct…spaces and all… At this point I guess the template is called ‘classic’ and I rename my two directories ‘classic’. This is where I fear I went seriously wrong.

I still have the default ‘title’ in the title bar (Zen Cart! The Art...) and now I realize I have too many ‘classic’ directories. includes/languages/classic has a empty.txt file in it not the one I copied and includes/languages/english/classic has a header.php in it that I didn’t put there. I do not see the two files I edited and copied anywhere.

I hope you can follow this and I particularly hope someone can help me. What is the next step for me?

This is the latest version of zc on a Linux box, if you need to know that. Thank you in advance.

2 Oct 2009, 6:17 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Having trouble customizing title

OneSister:

Now I’m afraid I’ve done something seriously wrong ...No, not seriously wrong.
Just need to clear up your understanding of how it works.
And ... you're well on your way to that already.

OneSister:

I began with the title change. When it said to create a directory /includes/languages/english/CUSTOM I did, then copied a fresh meta_tags.php into it and made the appropriate changes. However I did not do this before I created a /includes/languages/CUSTOM as well. Although I can’t find it now, but some of the reams of information I read said to do that, but that now the ‘title’ had been moved.

So. Now I have two new CUSTOM directories. One with an english.php in it and one with a meta_tags.php in it. Both with the edited ‘title’. Of course it doesn’t work.Understandable, and not actually "wrong", but ... > OneSister:

I then see that I have to use the name of the template NOT ‘CUSTOM’.... as long as "CUSTOM" is the name of your template's folder, then using "CUSTOM" is fine.

OneSister:

I go to Admin-Tools-Template Selection to see the name of the template is Classic Contemporary Green, which, I think, cannot be correct…spaces and all… At this point I guess the template is called ‘classic’ and I rename my two directories ‘classic’.Correct.

OneSister:

This is where I fear I went seriously wrong.No. Not seriously wrong.

You need to understand that "classic" is the name of the example/custom template that comes with Zen Cart. As such, some folders already have a folder named "classic" in them.
So, in that case, you have 2 options:

a) keep using "classic" ... in which case you'd use the existing "classic" folders (no need to make your own). The downside to this is that there might be a new "classic" folder in the next upgrade, and thus you'll have to be very careful to identify and preserve your unique changes compared to the ones that come with the next version.

b) or make your own custom template too, calling it "CUSTOM" ... and then the language folders you've created will automatically be grandfathered into use.

OneSister:

I still have the default ‘title’ in the title bar (Zen Cart! The Art...) and now I realize I have too many ‘classic’ directories.Not sure what you mean by "too many".> OneSister:

includes/languages/classic has a empty.txt file in itYes, that's the one that comes with Zen Cart. If you're going to just keep using "classic", then copy your customized english.php file into that folder.
OneSister:

and includes/languages/english/classic has a header.php in it that I didn’t put there.Right. That one comes with Zen Cart too. Again, if you're going to continue with using "classic", you'll need to put your customized meta_tags.php file there.

There's a lot of useful info and links in the rest of the discussion in this same thread, above.
Some people have found this map useful (link posted earlier too): http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_54&products_id=298

2 Oct 2009, 6:41 PM
#3
onesister avatar

onesister

New Zenner

Join Date:
Sep 2009
Posts:
23
Plugin Contributions:
0

Re: Having trouble customizing title

Thanks again for such a quick reply. I'm trying to get this straight. I first created two dirs called CUSTOM. Then renamed 'classic'. I didn't need to do this as there was already enough 'classic' dirs, is that right?

Okay, next problem with my understanding: In the includes/templates dir there is a 'classic'. Of course that's the default that came with the install. I just want to tweak this classic to work for us so, yes, we want to keep that one for now. But to avoid the problem you stipulate in a) above, I should create my own CUSTOM template, as you say.

But - when I made dirs named CUSTOM they didn't work and when I thought about it, they shouldn't have, because the program didn't know to look for them. So, are you saying that I first need to copy the /includes/templates/classic and make a new dir in /includes/templates named CUSTOM to copy it into? Then continue with the instructions?

2 Oct 2009, 6:48 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Having trouble customizing title

The procedure for creating your own custom template (whether it's named "CUSTOM" or "billysplace" or "greeneggsandham") is fairly simple, and documented in the FAQ area ... some links to it area discussed elsewhere in this same thread, on previous pages above.

You don't "have to" use something other than "classic", but we generally recommend you do.

For now, I suggest you just use classic to prove to yourself that the software works as advertised.

As to "renaming your CUSTOM folder to 'classic'", I'm absolutely certain that you didn't do that successfully, because your server wouldn't let you rename "CUSTOM" to "classic" if "classic" already existed. That's why your customized files didn't show up in the "classic" folders. Your fastest route to seeing immediate results is to copy your customized files into their respective "classic" folders.

Then you can work on building and activating your own custom template according to the documentation, and moving your stuff out of "classic" and into your own new folders.

2 Oct 2009, 7:43 PM
#5
onesister avatar

onesister

New Zenner

Join Date:
Sep 2009
Posts:
23
Plugin Contributions:
0

Re: Having trouble customizing title

I would be happy to just use the classic for now, but of course I would want to customize it - title, text, etc. I know this will take some advanced study to accomplish all we might want to do for the future, but for now I just wanted to get a cart up so my non-profit could take donations.

To just use the "classic" theme I created dirs called CUSTOM in includes/languages/CUSTOM with an edited english.php and one in includes/languages/english/CUSTOM with an edited meta_tags.php in it. This did not change the title.

I know I have a lot to learn, but I was hoping to get something very simple running quickly.

2 Oct 2009, 8:24 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Having trouble customizing title

OneSister:

To just use the "classic" theme I created dirs called CUSTOM in includes/languages/CUSTOM with an edited english.php and one in includes/languages/english/CUSTOM with an edited meta_tags.php in it. This did not change the title.
So, as I said, move THOSE files OUT of your "CUSTOM" folder into the "classic" folders, and you'll see results quickly.

You can work on making your own template afterwards.

2 Oct 2009, 8:33 PM
#7
onesister avatar

onesister

New Zenner

Join Date:
Sep 2009
Posts:
23
Plugin Contributions:
0

Re: Having trouble customizing title

I tried to prove to myself that it works by just editing the existing meta_tags.php and saving it with a new title. This did not change the title either. Then I went back to thinking that I needed to work in the CUSTOM directory as the instructions explained. I believe I followed all the directions (and double and triple checked my work) and when I activate the new CUSTOM template and reset the layout boxes controller the screen is blank when I refreshed. When I tried to get back into admin -IT'S BLANK TOO.

2 Oct 2009, 8:38 PM
#8
onesister avatar

onesister

New Zenner

Join Date:
Sep 2009
Posts:
23
Plugin Contributions:
0

Re: Having trouble customizing title

I stepped on your reply and missed it until after I posted again. But what have I done to make the whole thing go blank? Do I have to reinstall? OMG...

2 Oct 2009, 8:44 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Having trouble customizing title

At the risk of duplicating stuff already in all the docs and FAQs, this is a summary of the very basic steps one can do to change the 'title' that shows in your browser:

  1. Edit /includes/languages/english/meta_tags.php and change the TITLE definition. Save to your server.
  2. Load the site in your browser, and you'll see the change.

Now, if you want to properly separate your customized files from the original default files, you would do your edits in a copy of that file instead of editing the original:

  1. Choose which template you're going to use. You can only use templates properly built and accessible via the Template Select tool in your admin.
  2. Assuming you've selected "classic" then you'll make a copy of the /includes/languages/english/meta_tags.php file into /include/languages/english/classic/meta_tags.php, and do your edits there.
  3. Make sure "classic" is set as the active template in your admin Template Select tool. Load the site in your browser, and you'll see your changes.

So, now, in YOUR case, if you've put the files in folders named "CUSTOM", but don't have a template properly built in /includes/templates/CUSTOM (with the required files in that folder (as described in other FAQ articles)), then your changes saved to the "CUSTOM" language folders will NOT show on your site.

So ... I'm going to tell you to DELETE all your folders named "CUSTOM", and start all your edits again, using the existing "classic" folders.

It seems like you're making all this WAY more complicated than it really is.

2 Oct 2009, 8:46 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Having trouble customizing title

Blank pages are a result of making errors in your PHP edits, including mismatching quotation marks and leaving blank lines at the top or bottom of the file before the <?php or closing ?>

Related FAQ: https://www.zen-cart.com/tutorials/index.php?article=87

2 Oct 2009, 9:03 PM
#11
onesister avatar

onesister

New Zenner

Join Date:
Sep 2009
Posts:
23
Plugin Contributions:
0

Re: Having trouble customizing title

Yep. the meta_tags.php didn't like that the title of the page has an apostrophe in it. When I changed it back to Zen Cart! it worked again, which allowed me to change templates again.

I'm going to start all over again as you suggest. I hope I know enough to be embarrassed about making it "WAY more complicated than it really is".

One more question before I stop taking up any more of your time, pleae. As php didn't like the apostrophe in the title, is there a syntax that works when you need one?

2 Oct 2009, 9:16 PM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Having trouble customizing title

Yes, using ' instead of ' will let it use an apostrophe inside a pair of ' marks.

So, you could use this:```
define('TITLE', 'Mary[B]'[/B]s Store');

Or, if you really needed to get adventurous, you could change the pair of single-quotes to double-quotes, and then you could use your apostrophe inside, like this:```
define('TITLE', [B]"[/B]Mary's Store[B]"[/B]);
```The idea is to use consistency when marking the beginning/ending of the text string.