Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-06-20 12:12:07

geoff777
Plugin Author
From: Benarrabá Andalucía Spain
Registered: 2008-02-19
Posts: 282
Website

[request] Sections import/export

Is there anyway to write a plugin to import/export Sections?

I’ve asked Bert Garcia if it’s possible to expand his hcg_templates plugin to do this but I don’t know if it’s possible or if he has the time/inclination to do this.

So a standalone Sections import/export plugin would really help me at the moment.

Section_Name.section as the text filename

with a CSV list of contents :- To include the following eight fields.

Section name,
Section title,
Uses page,
Uses style,
Selected by default? No Yes,
On front page? No Yes,
Syndicate? No Yes,
Include in site search No Yes,

So something like …

Section name,
Section title,
Uses page,
Uses style,
Y,
N,
Y,
N

This would save me so much time if it’s possible.
As I have a lot of Sections.
If its easy for anyone to write this I would really appreciate this.

If it’s not possible does anyone know the SQL needed to add a section + fields to the dB?

Thanks Geoff

Last edited by geoff777 (2008-06-20 12:20:34)


There are 10 types of people in the world: those who understand binary, and those who don’t.

Offline

#2 2008-06-20 13:18:25

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: [request] Sections import/export

I don’t want to keep anybody from writing a plugin for this, I always like using a consistent UI. And this would be perfect for hcg_templates, the whole presentation tab being covered by just one plugin.
But if you fear for your 150+ sections until it is written, I think the job could be done with just PHPmyAdmin. Or even easier from the “DB manager” tab of rss_admin_db_manager, where you’re capable of doing backups for each table in the TXP db separately.

Last edited by uli (2008-06-20 13:19:25)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2008-06-20 13:30:05

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: [request] Sections import/export

geoff777 wrote:

If it’s not possible does anyone know the SQL needed to add a section + fields to the dB?

Try this, extracted from an SQL export:

INSERT INTO `txp_section` VALUES ('placeholder', 'default', 'default', 0, 1, 1, 1, 'placeholder');


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#4 2008-06-20 13:40:01

geoff777
Plugin Author
From: Benarrabá Andalucía Spain
Registered: 2008-02-19
Posts: 282
Website

Re: [request] Sections import/export

Thanks Uli

I agree it would be perfect to have this as part of hcg_templates it would complete an excellent plugin.

I do use rss_admin_db_manager to do backups.

Thanks for your SQL I’ll check out the db structure in PHP myAdmin – I wasn’t sure if this was the only table I needed to change.

I can hold on over the weekend before I need to add more Sections ;-)

Geoff


There are 10 types of people in the world: those who understand binary, and those who don’t.

Offline

#5 2008-06-20 15:16:31

hcgtv
Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: [request] Sections import/export

geoff777 wrote:

I’ve asked Bert Garcia if it’s possible to expand his hcg_templates plugin to do this but I don’t know if it’s possible or if he has the time/inclination to do this.

Hey Geoff,

I wouldn’t mind adding this to the plugin, just don’t know when I’d get around to it.

For now phpMyAdmin has a CSV export option you can use, here’s my PHPXref site:

"news","default","default","0","1","0","1","PHPXref News"
"default","default","default","0","1","1","1","default"
"about","default","default","0","0","0","1","What is PHPXref?"
"cms","default","default","0","0","0","1","CMS"
"portal","default","default","0","0","0","1","Portal"
"blog","default","default","0","0","0","1","Blog"
"forum","default","default","0","0","0","1","Forum"
"gallery","default","default","0","0","0","1","Gallery"
"wiki","default","default","0","0","0","1","Wiki"
"workspace","default","default","0","0","0","1","Workspace"
"customer","default","default","0","0","0","1","Customer"
"learning","default","default","0","0","0","1","Learning"
"utility","default","default","0","0","0","1","Utility"
"program","default","default","0","0","0","1","Program"
"specs","default","default","0","0","0","1","System Specs"
"stats","default","default","0","0","0","1","Visitor Stats"
"feeds","default","default","0","0","0","1","Industry Feeds"
"code","default","default","0","0","0","1","Code Library"
"rasmus","default","default","0","0","0","1","Rasmus Lerdorf"
"home","default","default","1","0","1","1","Home"

What site is this for?

Last edited by hcgtv (2008-06-20 15:26:39)

Offline

#6 2008-06-20 16:44:29

geoff777
Plugin Author
From: Benarrabá Andalucía Spain
Registered: 2008-02-19
Posts: 282
Website

Re: [request] Sections import/export

Hi Bert,

It would be fantastic if you could incorporate ‘Sections’ into your excellent plugin (which has already saved me hours of tedious work)

I’m using the Insert SQL code Uli suggested with rss_admin_db_manager to insert ‘Sections’ as the Sections Tab is now unusable.

I can use phpMyAdmin to do any amendments.

But your plugin would be far easier as I can import locally and then use Dreamweaver and it’s Find & Replace tool.

Thanks Geoff


There are 10 types of people in the world: those who understand binary, and those who don’t.

Offline

#7 2008-06-20 17:27:55

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: [request] Sections import/export

out of honest curiosity: why would one need that many sections?

Offline

#8 2008-06-20 18:01:56

geoff777
Plugin Author
From: Benarrabá Andalucía Spain
Registered: 2008-02-19
Posts: 282
Website

Re: [request] Sections import/export

I’m writing a portal/website for Gibraltar which is like a small town and a country at the same time.

So it as Olympic and National Associations + Tourism + Tax Haven status + everything a small country would have.

I did think during the planning stage of using Categories but it would have been a spaghetti of if/else statements. Which would have meant less Sections & Pages but after time had passed and memory of the design/coding fails, would have been a nightmare to maintain.

So I decided to create a Section for almost each Page which means I avoid having to do any thinking :-)
… I will post a link once it is up and running.

I’ve tested a few sections and I’m very pleased with the layout etc

What I’ve done works well and is surprisingly flexible. It has become a far bigger task than I expected but it’ll be better/richer website because of this.

I’ll be glad when I can concentrate on getting to Gibraltar a few times a week and adding content.


There are 10 types of people in the world: those who understand binary, and those who don’t.

Offline

Board footer

Powered by FluxBB