Removing a directory and copying its files only
I am trying to follow instructions in Manual but they are outdated and refer to File Manager.
As a proud Linux user I wouldn't touch that stuff with a ten foot pole.
But I messed up because the author recommends to change files into a custom directory to void customization being broken by an update to /includes/templates/responsive_classic.
So I decided to create a directory called mein and copying files from responsive_classic to mein.
But I ended up with a copy of responsive_classic directory inside mein.
There are several solutions to this:
1. remove the responsive directory inside mein and then copy files from responsive into it
2. Rename the responsive directory to mein using the mv command and then create an empty responsive classic at /includes/templates, so the update will update that one, and leave mein alone, which will be set as default in configuration settings.
Problem with 1. is that I get error saying that directory is not empty, I understand that is a syntax error form my part.
The most important thing is that now I think that author's advice is wrong because I might be able to save my customizations but I might lose important file updates to the responsive template.
Please help.
Re: Removing a directory and copying its files only
I'm not exactly sure what you're trying to do, but it sounds like you want to create a custom template based on the responsive_classic template. This excellent plugin makes that easy - https://www.zen-cart.com/downloads.php?do=file&id=2087. I don't understand your Linux comment. The instructions you read probably are referring to the CPanel File Manager, which is usable with any browser, regardless of OS.
Re: Removing a directory and copying its files only
The Unix "cp" command is easy to mess up. When you say,
>So I decided to create a directory called mein and copying files from responsive_classic to mein.
> But I ended up with a copy of responsive_classic directory inside mein.
This tells me you did (something like)
mkdir mein
cp -r responsive_classic mein
This will copy the resposive classic folder into mein.
Clean up:
rm -rf mein
cp -r responsive_classic mein
This creates a new folder called mein with the contents of responsive classic.
If you want to create the folder first then copy, you can do this, but the syntax is different from what you did:
mkdir mein
cp -r responsive_classic/* mein/
Re: Removing a directory and copying its files only
Great post, thank you.
What do you think of author's (Richard Underwood) advice to create a different directory so customizations won't be overwritten by updates?
I think I will delete the mein directory and keep the defaults even at the cost of losing customizations. I prefer to keep updates to files.
Re: Removing a directory and copying its files only
Quote:
Originally Posted by
earp
I'm not exactly sure what you're trying to do, but it sounds like you want to create a custom template based on the responsive_classic template. This excellent plugin makes that easy -
https://www.zen-cart.com/downloads.php?do=file&id=2087. I don't understand your Linux comment. The instructions you read probably are referring to the CPanel File Manager, which is usable with any browser, regardless of OS.
I don't know anything about CPanel and wish to stay in blissful ignorance of it, since I only know it is unnecessary if you use Linux, same as so many things that books on ZenCart state and even tutorials on this website. I don't think plugin is necessary but thanks anyway. I am a software minimalist and use only what I need, don't want to cram my computers or my phone with apps.
Re: Removing a directory and copying its files only
Quote:
Originally Posted by
ckosloff
I am trying to follow instructions in Manual but they are outdated and refer to File Manager.
As a proud Linux user I wouldn't touch that stuff with a ten foot pole.
But I messed up because the author recommends to change files into a custom directory to void customization being broken by an update to /includes/templates/responsive_classic.
So I decided to create a directory called mein and copying files from responsive_classic to mein.
But I ended up with a copy of responsive_classic directory inside mein.
There are several solutions to this:
1. remove the responsive directory inside mein and then copy files from responsive into it
2. Rename the responsive directory to mein using the mv command and then create an empty responsive classic at /includes/templates, so the update will update that one, and leave mein alone, which will be set as default in configuration settings.
Problem with 1. is that I get error saying that directory is not empty, I understand that is a syntax error form my part.
The most important thing is that now I think that author's advice is wrong because I might be able to save my customizations but I might lose important file updates to the responsive template.
Please help.
You are right about what I did.
Now I am about to clean up the extra directory that I created and stay with the default template.
Re: Removing a directory and copying its files only
Quote:
Originally Posted by
swguy
The Unix "cp" command is easy to mess up. When you say,
>So I decided to create a directory called mein and copying files from responsive_classic to mein.
> But I ended up with a copy of responsive_classic directory inside mein.
This tells me you did (something like)
mkdir mein
cp -r responsive_classic mein
This will copy the resposive classic folder into mein.
Clean up:
rm -rf mein
cp -r responsive_classic mein
This creates a new folder called mein with the contents of responsive classic.
If you want to create the folder first then copy, you can do this, but the syntax is different from what you did:
mkdir mein
cp -r responsive_classic/* mein/
Sorry about my mistake.
My last post was intended for you, but I quoted myself, should stop playing chess online until 3am. I am not fully awake.
Re: Removing a directory and copying its files only
Quote:
Originally Posted by
earp
I'm not exactly sure what you're trying to do, but it sounds like you want to create a custom template based on the responsive_classic template. This excellent plugin makes that easy -
https://www.zen-cart.com/downloads.php?do=file&id=2087. I don't understand your Linux comment. The instructions you read probably are referring to the CPanel File Manager, which is usable with any browser, regardless of OS.
Thanks for tip on module, but I don't think that I will use it.
Regarding CPanel I don't know anything about it, except that it is unnecessary for a Linux user like so many things in Zen Cart books.
Re: Removing a directory and copying its files only
> What do you think of author's (Richard Underwood) advice to create a different directory so customizations won't be overwritten by updates?
I don't know who he is or what you are referring to. But I would encourage you to read the official help pages on this.
Yes, you want to use template overrides.
https://docs.zen-cart.com/user/templ...ate_overrides/
Re: Removing a directory and copying its files only
Quote:
Originally Posted by
swguy
> What do you think of author's (Richard Underwood) advice to create a different directory so customizations won't be overwritten by updates?
I don't know who he is or what you are referring to. But I would encourage you to read the official help pages on this.
Yes, you want to use template overrides.
https://docs.zen-cart.com/user/templ...ate_overrides/
Richard Underwood is the author of a Zen Cart Manual, there are more than one, my choice is the one by Go Koon Hoek, that is how I learned Zen Cart a long time ago, forgot a lot.
Thanks for the document I will implement overrides, but I have a doubt my overrides cannot have the same name as the downloaded files, so if an update comes like 1.5.8 it will load different files that will not go to my overriden folders, so I will miss the update.
Am I right, what is the procedure then, compare files and chose?
Re: Removing a directory and copying its files only
The whole idea about overrides is that they are not overwritten on update. Thus preserving them for use later.
It's old but it still works well. Get a copy of lat9's cheatsheet and follow it when making changes. You'll thank me later. :P
https://www.zen-cart.com/downloads.php?do=file&id=1393
Re: Removing a directory and copying its files only
Quote:
Originally Posted by
dbltoe
The whole idea about overrides is that they are not overwritten on update. Thus preserving them for use later.
It's old but it still works well. Get a copy of lat9's cheatsheet and follow it when making changes. You'll thank me later. :P
https://www.zen-cart.com/downloads.php?do=file&id=1393
I can thank you now, I will compare that file with the official one which swguy sent in this thread.
My only problem is that it is old as I surmised and to restore customizations wouldn't be that difficult.
I will give it a sink.
Thank you,