Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Copy a whole Category

Quote Reply
Copy a whole Category
Hello,

the programm is great but I still have an question....

I will have a lot of categories (Citys) an within these categories I will have always the same subcategories.
My Problem is: is it possible to copy one city (main categorie) and rename it.
Reasen: I do not want to type in all those hundred of subcategories, because they are always the same for each city.

Could you please help me?

Sincerly Yours
Mark
Quote Reply
Re: [MarkBT] Copy a whole Category In reply to
Use a text editor (wordpad, textpad, etc) and create the structure you need, with the city name variable to be replaced in the next step:

city_name/category/subcategory_1
city_name/category/subcategory_2

Use this as a template, copy and paste it, then use search/replace to change each city name as you go:

search for: city_name
replace with: Phoenix

Your list will grow like so:

Phoenix/category/subcategory_1
Phoenix/category/subcategory_2
Tucson/category/subcategory_1
Tucson/category/subcategory_2
city_name/category/subcategory_1
city_name/category/subcategory_2

Be sure to save your work as you go! Now you need to get this info into the categories.db file. The default fields are:

ID, Name, Description, Related, Meta Description, Meta Keywords, Header, and Footer.

So you will have lines like:

25|Phoenix/category/subcategory_1||||||
26|Phoenix/category/subcategory_2||||||
27|Phoenix/category/subcategory_3||||||

This assumes no entries in the other fields. Only the first two fields are required. Once you have the list of categories, you can go through and add the numbers to the beginning, then use search/replace again to add the empty fields to the end:

search for: subcategory_1
replace with: subcategory_1||||||

Once it's all done, just copy it directly into the categories.db. Remember also to update the categories.txt (a number). There may be an easier way to do it, but this will work.


Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: Dec 28, 2005, 9:29 PM
Quote Reply
Re: [PerlFlunkie] Copy a whole Category In reply to
HI Thanks a lot - but I have seen i had postet in the wrong categorie. I am using links sql.

Does it work as well there?

Sincerly Yours
Mark
Quote Reply
Re: [MarkBT] Copy a whole Category In reply to
I doubt it. I suspect you will have to work with an SQL database, and I do not know how to do that directly. Someone on that forum may be able to help...


Leonard
aka PerlFlunkie