Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-12-22 16:06:18

milosevic
Member
From: Madrid, Spain
Registered: 2005-09-19
Posts: 390

Create a lot of categories

Hello:

There is a way (plugin) to create a lot of new categories at one time or must I create one per one manually? I’m thinking in create a category per country and similar things, it is slow, boring and gives opportunity to type mismach to create this kind of stuff handmade one per one.


<txp:rocks/>

Offline

#2 2011-12-22 16:37:10

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Create a lot of categories

Look at the function cat_event_category_create in textpattern/include/txp_category.php
Specifically these two lines (first line needs to be executed for each new category, the second when you’re finished adding categories):

safe_insert('txp_category', "name = '".doSlash($name)."', title = '".doSlash($title)."', type = '".doSlash($event)."', parent = 'root'");
rebuild_tree_full($event);

Offline

#3 2011-12-22 17:02:28

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,549
Website GitHub Twitter

Re: Create a lot of categories

Hi there is a plugin dzd_multicat_creator for that

Offline

Board footer

Powered by FluxBB