X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   edit home page off line (https://forum.x-cart.com/showthread.php?t=43543)

swifty1 11-10-2008 02:12 AM

edit home page off line
 
Hi can anyone tell me how i can take my home page (which uses the built in wysiwyg for the layout) off the server then be able to edit the layout etc on my local hard drive before uploading back to my server so as i can play around with the look etc without interfering with the live site, only updateing the home page once i am happy with the look.

JWait 11-10-2008 07:59 AM

Re: edit home page off line
 
I'm not sure what you mean by "home page", are you referring to home.php? Since that is actually made up of several templates I don't understand what you mean by using a WYSIWYG editor. Please explain.

swifty1 11-10-2008 08:18 AM

Re: edit home page off line
 
By the home page i mean the page that loads up first customer/home.tpl, i understand that this page is made up of several templates ie head, bottom and all the side menu box templates. The central area below the company logo has a wysiwyg applied to it i assume by the company that set the site up, they did this so that i was able to change the layout table around, upload images and change the text etc.
I can change the look of this area in webmaster mode but for me to save the changes that i do will also change the live site which i do not want until i am satisfied with the new layout is ok which may take me a few days to do, so what i would like to do is be able to work on the home.php wysiwyg tables etc then when i am satisfied upload the new home wysiwyg layout to the live server.
I hope this makes sense.

JWait 11-10-2008 08:58 AM

Re: edit home page off line
 
Ok. It sounds like the area you are talking about is skin1/customer/main/welcome.tpl, and probably the $lng.txt_welcome language variable.

Take a look at skin1_original/customer/main/welcome.tpl and compare it to skin1/customer/main/welcome.tpl. If there are no changes then you don't need to worry about that.

For $lng.txt_welcome, in admin click on "languages" then chose your language from the drop down box at the top of the page. Next enter txt_welcome as the filter. You should see $lng.txt_welcome as one of your results. Copy what is in the box to your favorite text editor. Add <html>and <body> to the top, and </body>and </html> to the bottom and save as a html file. You can then open the file in your web browser to see what that portion of the home page will look like. When you are done editing, you can copy your file between the "body"s and paste it into the $lng.txt_welcome area in the admin "languages" section.

swifty1 11-10-2008 09:25 AM

Re: edit home page off line
 
Fantastic it is so easy when you know how a million thanks for that one JWAIT you know your x-cart.

Is there a proper way to delete the file that is on the server before i copy and paste the new updated file.

Checked out skin1 against skin1/original and there is no difference what if there had been a difference here

JWait 11-10-2008 10:48 AM

Re: edit home page off line
 
Did you find the problem?
You don't need to worry about the old file as the new one will over-write it (provided it has exactly the same name). One thing I usually do is rename the file I am replacing to filename.tpl-old and upload the new one using FTP. That way if you have a problem you can just rename the old one back like it was and the problem will be gone, once you clear the template cache.

swifty1 11-19-2008 03:55 AM

Re: edit home page off line
 
Hi J Wait i have saved the file and tried to view in my browser putting the DOCTYPE etc at the top, enclosing the code in <html> and <body> tags but all i get is the code text line for line, no layout of page etc any ideas as to why.
Pulling my hair out as i have tried everything that i can think of.

JWait 11-19-2008 04:17 AM

Re: edit home page off line
 
If "the file" is one of x-cart's templates it is not html. The templates usually have smarty tags throughout them so they can't be displayed as html. If you are trying to edit the "$lng.txt_welcome" language variable,then you can do as I suggested earlier...
"For $lng.txt_welcome, in admin click on "languages" then chose your language from the drop down box at the top of the page. Next enter txt_welcome as the filter. You should see $lng.txt_welcome as one of your results. Copy what is in the box to your favorite text editor. Add <html>and <body> to the top, and </body>and </html> to the bottom and save as a html file. You can then open the file in your web browser to see what that portion of the home page will look like. When you are done editing, you can copy your file between the "body"s and paste it into the $lng.txt_welcome area in the admin "languages" section."

If you are going to be doing a lot of editing, and don't want to disturb the live site, then maybe you should create a clone of your live site in a sub-folder. Remember to clone your database also, and change the new config.php to point to the proper locations. Also, block the sub-folder from search engines by disallowing it in robots.txt.

swifty1 11-20-2008 02:20 AM

Re: edit home page off line
 
I have an upto date copy of my site on my local hard drive, is it possible to use this copy to edit and view with my browser locally.

JWait 11-20-2008 04:05 AM

Re: edit home page off line
 
You can, and a thread discussing this subject is here http://forum.x-cart.com/showthread.php?t=12496

I have never done it, and it doesn't address some issues that can only be discovered running the exact same configuration as the live site does. It should work fine for simple template edits though.

swifty1 11-29-2008 07:23 AM

Re: edit home page off line
 
Thanks for the advice JWAIT, i have now edited the template but i am unsure as to how to find the txt_welcome file with my FTPEditor, all that i can find is the welcome_tpl not the txt_welcome file.
I have found the txt_welcome file in languages in admin but this does not allow me to rename a copy of the original before i replace with the edited file,
is it possible to see this file in my FTPEditor if so how and how do i clear the template catche as per your quote below.

"One thing I usually do is rename the file I am replacing to filename.tpl-old and upload the new one using FTP. That way if you have a problem you can just rename the old one back like it was and the problem will be gone, once you clear the template cache."

JWait 11-29-2008 07:51 AM

Re: edit home page off line
 
txt_welcome is a language variable. you can use the WYSIWG editor in x-cart to get some idea of what it will look like, or you can just paste what is there to a good text editor (I prefer PSPad (www.pspad.com) , add <html> and <body> tags, save it as a html page and look at it in a browser (or in PSPad, there is a view as html button).

Once you are satisfied just copy between the <body> tags and paste it into the x-cart txt_welcome languages box.

I don't really like FTPeditor because the changes you make are pretty much immediate, and if you screw up too badly it is sometimes very difficult to fix.

To clear the templates cache, there are 3 ways... enter www.yoursite.com/cleanup.php in your browser... in admin click summary, then tools, scroll down to "clear templates cache" and click "clear", or using FTP, delete all of the files in var/templates_c folder.

swifty1 11-29-2008 08:01 AM

Re: edit home page off line
 
What is the purpose of the template cache for and i asume that when you clear the template cache no harm comes to the web site.

JWait 11-29-2008 08:19 AM

Re: edit home page off line
 
The templates cache stores the compiled templates, making your site run a little faster. If/when you make changes, the templates need to be recompiled in order to see the changes. This happens automatically the first time you visit a page. Over time, every page on your site will be compiled and put in the templates cache. It only compiles the page as it is visited, and only by the first person that visits that page. It is pretty unnoticeable, taking a second or two longer to load that particular page.

You may also need to clear your web browser's cache also. Most times this happens when you close the browser and restart it.

These are the primary reasons people will pose a question like "I made changes but don't see them, why?"

swifty1 11-29-2008 08:38 AM

Re: edit home page off line
 
Thanks i take it then that when you replace with a new updated template the old one will be removed when you vist the new page for the first time or does this happen when you clear the template cache.
I have uploaded my new txt.welcome file only to see that it has pushed the bottom template right over to the far right hand side, any suggestions as to why.

JWait 11-29-2008 09:27 AM

Re: edit home page off line
 
Sometimes the changes to the template are immediately seen, sometimes not. One thing for certain is once the templates cache is cleared, all changes to all templates will be seen.

Your txt_welcome language variable should not have anything to do with the bottom.tpl being "pushed". Can you post what you have for txt_welcome?

swifty1 11-29-2008 09:50 AM

Re: edit home page off line
 
Have sent a copy of txt_welcome via private message, what i did notice was that when i viewed the txt_welcome in webmaster mode with the built in wysiwyg was that it had put all of the images in one column to the left, the paragraph text was of a larger font size that what i had originally done, it looks like the wysiwyg has re-coded the table layout.

JWait 11-29-2008 10:08 AM

Re: edit home page off line
 
I didn't get the entire thing. I think there is a limit to what you can post without making it an attachment. If you click "Go Advanced" in replying to this thread you should have the ability to attach a file to your post.

swifty1 11-29-2008 10:22 AM

Re: edit home page off line
 
Not sure if this has worked but here goes

JWait 11-29-2008 11:39 AM

Re: edit home page off line
 
OK, one thing I can see right off the bat is you didn't close your table. Other than that it looks like it might work.

swifty1 11-29-2008 11:58 AM

Re: edit home page off line
 
Wow.... such a simple basic mistake makes all the difference, Thanks for that JWAIT, now working on the background colour.


All times are GMT -8. The time now is 05:37 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.