Please note that you may have been redirected (you might like to make a note of the URL in the address bar of your browser and update accordingly) This is a permanent archvie but is no longer actively maintained. Please visit http://joshuaink.com for the latest updates.
Rebuild Day 3
Monday October 25, 2004
I have decided to document my rebuild quite thoroughly, two reasons:
- It may be useful for an absolute beginner sometime.
- If I do something stupid, I am sure some passing guru will let me know.
This session will cover setting up image uploads and clean URL's.
Images
I am going to want to do some screen shots to help me explain things, so first stop in the textpattern admin is Content > Images and here we find a warning to the effect "Please change file permissions to 777". I use WST_FTP Pro for all my FTP needs, so that's what the screenshots below show.
Select, create or upload the folder "images" on to the root of your server, right clicking this will produce a menu as as shown below. Scroll down to Operations > FTP Commands > CHMOD (unix).
Note: when I say "server root" I mean the public folder, the same place as your textpattern folder resides, this may be something like www_root or htdocs.

This will bring up the permissions window and all we need to do is change the permissions to 777, job done.

It is worth noting that texpattern will rename your images when it uploads them so you need to make a choice as to whether you do want to let the software organize your image folder; first time round I used FTP but I am going to give it a whirl as it looks pretty good. From here on in it's pretty self explanatory but I note that when you click on the XHTML link associated with an image (and handy way to find out the path to the renamed image) it produces a tag containing inline styles, I won't be using these and I won't be hardwiring their width and heights either, you can view the source of this page to see the XHTML I have used for images.
Clean URL's
Are they really necessary, clean URL's? Who knows but they seem like a bit of a right of passage in the blogging world so we better set them up.
Before we do anything, open up your FTP client and see if you have an existing .htaccess file on your server, it may be hidden, in WS_FTP there is a small text input area and typing the letters: -al will show all files on the sever. If there is a .htaccess file in there download it and keep it somewhere safe as a backup. If you are not confident about .htaccess, it might be worth checking with your hosting provider what purpose it plays on your sever before you go messing with it.

In the textpattern admin go to Presentation > Sections and you will see that there are already two sections in place, articles and about. In the textpattern download there are two files called articles and about, bingo! Upload these two files to the root of your server. Textpattern also comes with a .htaccess file and as it suggests there are several ways to create clean URL's. I went for the FilesMatch method and within the provided .htaccess you will find the following:
- #<FilesMatch "^([^\.]+)$">
- #ForceType application/x-httpd-php
- #</FilesMatch>
Simply remove the hashes from the beginning of lines 1,2 and 3 and upload the file to your server, or if you need to keep your existing .htaccess file in tact, add this code to the bottom. In the textpattern admin go to Admin > Preferences and look for the URL mode, this is probably already set to "/" but if it is set to messy, change it to "/clean/" and you are done.
For every textpattern section you create you need a corresponding file on the sever, easiest way to do this is to open up the "articles" file, modify it and save a copy with the exact name of the section. For example to create an ARCHIVES section I would open up "articles", save it as "archives" then modify the code thus:
- <?php
- include "./*******/****.php";
- $s = "archives";
- include $txpcfg['txpath']."/*****.php";
- textpattern();
- ?>
Note: I have removed the paths to specific files and replaced them with xxxxx, obviously you don't need to do this!
With this done pop back to textpattern Presentation > Sections and create a new section called archives, job done and I have done it here, if you go to /archives you will find a spot ready for all the riveting content to come.

That's it for now, time for a nice cup of tea!




Ray
1964 days ago
John Oxton
1964 days ago
Ray
1964 days ago
John Oxton
1964 days ago
Daniel
1953 days ago
John Oxton
1953 days ago