Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Changing case from UPPERCASE to Title Case for certain feilds
Thanks again, Joe!
I’m not handy with SQL at all, but I finally found a method that worked:
- Export the table as a text file in .sql format.
- Open the file in Textmate (which I already had handy).
- Select the rows with UPPERCASE data.
- Choose “Convert” from the “Text” menu, and select “to Titlecase”.
- Find and replace each instance of
'Article', 'Root'
with the correct lowercase values. - Find and replace each instance of
INSERT INTO `Txp_Category` (`Col1`, `Col2`, `Etc`, ...) VALUES
with the correct lowercase values. - Import the table back into the database.
- Use
UPDATE txp_category SET name=LOWER(name);
to reset lowercase values for the columns that should be lowercase (i.e. categoryname
s).
This method is a bit too messy for the textpattern
table, but the Category1 and Category2 columns were easy to update using another query:
UPDATE textpattern SET Category1=LOWER(Category1);
UPDATE textpattern SET Category2=LOWER(Category2);
For the title data, I’d be willing to use something like cnn_title_case.
Thanks for your guidance and support!
Last edited by johnstephens (2009-07-28 03:42:44)
Offline