Difference between revisions of "Page Templates:Creating Your First Template"
(New page: This section assumes you have a completed html/css page that will be used to build this template. Identifying key page elements: Print the page.) |
|||
Line 1: | Line 1: | ||
This section assumes you have a completed html/css page that will be used to build this template. | This section assumes you have a completed html/css page that will be used to build this template. | ||
− | + | Start by pasting the full code of the home page into your HTML editor of choice. | |
− | + | ||
+ | Escape quotes | ||
+ | As the template code is in PHP and all this content will have to be 'echo'd' be sure to escape all quotes so the echo statements do not fail. Search and Replace double quote (") with escaped double quote (\") | ||
+ | |||
+ | Replace image / file paths | ||
+ | Chances are the html was built referencing file and image paths that are not the same as the file structure set up on the ecommerce platform website. Search all file paths and replace with the path to the file on the new server. For example if the originating html uses "images/x/filename.jpg" and the images are located on the ecommerce platform website in "/files/imageshere/" you may want to search "images/" with "/files/imageshere". Don't forget to repath any javascript source and css files (I recommend creating css and js folders under the file folder designated for the site). Double check your files and images are uploaded to the correct folders on the ecommerce platform website. | ||
+ | |||
+ | Echo the whole thing | ||
+ | Place an "echo" statement at the top and close the echo statement at the end: | ||
+ | |||
+ | <source lang="php"> | ||
+ | // start echo | ||
+ | echo " | ||
+ | ... all html here ... | ||
+ | "; | ||
+ | // end echo with "; | ||
+ | </source> |
Revision as of 12:24, 1 October 2008
This section assumes you have a completed html/css page that will be used to build this template.
Start by pasting the full code of the home page into your HTML editor of choice.
Escape quotes As the template code is in PHP and all this content will have to be 'echo'd' be sure to escape all quotes so the echo statements do not fail. Search and Replace double quote (") with escaped double quote (\")
Replace image / file paths Chances are the html was built referencing file and image paths that are not the same as the file structure set up on the ecommerce platform website. Search all file paths and replace with the path to the file on the new server. For example if the originating html uses "images/x/filename.jpg" and the images are located on the ecommerce platform website in "/files/imageshere/" you may want to search "images/" with "/files/imageshere". Don't forget to repath any javascript source and css files (I recommend creating css and js folders under the file folder designated for the site). Double check your files and images are uploaded to the correct folders on the ecommerce platform website.
Echo the whole thing Place an "echo" statement at the top and close the echo statement at the end:
// start echo echo " ... all html here ... "; // end echo with ";