Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2004-06-22 21:36:42

swf
Plugin Author
From: Saskatoon, Saskatchewan Canada
Registered: 2004-06-21
Posts: 109
Website

I made some scripts that import/export templates, forms and css

Hi, my name is Scott and I am a former MT user. I loved the feeling of editing my templates and css in an application and rebuilding to use the updated template.

I’ve created a simple export script that iterates through your forms, templates and css and exports them to a folder. the second script updates the database with the exported files.

Is anyone else interested in a script like this? If there, I will package it up and make it available.

Offline

#2 2004-06-23 03:43:06

Daragh
Member
From: Toronto Canada
Registered: 2004-05-26
Posts: 60
Website

Re: I made some scripts that import/export templates, forms and css

So this is a TXP version of MT’s “link this template to a file”? Yes, I’d be interested in that.

Offline

#3 2004-06-23 04:01:39

swf
Plugin Author
From: Saskatoon, Saskatchewan Canada
Registered: 2004-06-21
Posts: 109
Website

Re: I made some scripts that import/export templates, forms and css

I’ll go over it some more tonight and test a bit more just to make sure it doesn’t toast anyones database and make it available tomorrow

Offline

#4 2004-06-23 12:43:07

swf
Plugin Author
From: Saskatoon, Saskatchewan Canada
Registered: 2004-06-21
Posts: 109
Website

Re: I made some scripts that import/export templates, forms and css

txp_link2template_v1.0 is now available

let me know what you think.

update:

download

Last edited by swf (2005-06-25 16:45:43)

Offline

#5 2004-06-23 12:48:52

DougBTX
Archived Plugin Author
Registered: 2004-05-23
Posts: 22

Re: I made some scripts that import/export templates, forms and css

> Is anyone else interested in a script like this?

Hell yea

D/L ing…

Douglas

Offline

#6 2004-06-23 12:59:18

DougBTX
Archived Plugin Author
Registered: 2004-05-23
Posts: 22

Re: I made some scripts that import/export templates, forms and css

swf: can you extend this script to Store TXP pages in the filesystem?

Douglas

Offline

#7 2004-06-23 13:46:34

marco
Member
From: Montreal
Registered: 2004-02-24
Posts: 62

Re: I made some scripts that import/export templates, forms and css

> DougBTX wrote:

> swf: can you extend this script to Store TXP pages in the filesystem?

Douglas

That would be a very nice, if possible; we’d be able to edit and develop using a decent editor…

Offline

#8 2004-06-23 14:27:42

Hans
Member
From: Everywhere
Registered: 2004-03-07
Posts: 99
Website

Re: I made some scripts that import/export templates, forms and css

Holy guacamole! The answer to our prayers!
Mind if I kiss you? ;)


Lumilux – A Photoblog

Offline

#9 2004-06-23 20:55:18

swf
Plugin Author
From: Saskatoon, Saskatchewan Canada
Registered: 2004-06-21
Posts: 109
Website

Re: I made some scripts that import/export templates, forms and css

After reading the entry about importing new styles I remembered one thing I was planning on adding, I just didn’t have access to the internet for help at the time.

There should be an option in the config file to allows you to import new pages, css and forms into the database. I tried to create a conditional check if something was found in the database but i’m not sure how i can do this $updated = safe_update(….) always returned 1 even when there was no db entry to update. Suggestions? Maybe I’ll dig through the txp code some more and try to find a place where and update was checked.

This could probably be used to bypass the database entirely and allow you to just use the filesystem, but textpattern files would have to be changed and the next update would wipe it out. It might be easier just to hit the template-import.php link after you save. It has the same advantages without having to hack the txp code.

Offline

#10 2004-06-23 22:39:04

DougBTX
Archived Plugin Author
Registered: 2004-05-23
Posts: 22

Re: I made some scripts that import/export templates, forms and css

> the next update would wipe it out.

True true – unless the hacks added enough value to get into the next release. I’ve not seen any word from Dean about this templating stuff.

Douglas

Offline

#11 2004-06-25 15:30:54

marco
Member
From: Montreal
Registered: 2004-02-24
Posts: 62

Re: I made some scripts that import/export templates, forms and css

Having the option to use the filesystem would be good. It could also allow us to easily keep track of templates with their own sets of pages, styles, and forms. Right now it us a pain to see what what page/template uses what form.

BTW, I have some warnigns come up when I run the export; the export still happens ok, as far as I can see:

<code>
Warning: main(/include/txp_auth.php): failed to open stream: No such file or directory in c:/easyphp/www/textpattern/ textpattern/ template-export.php on line 17

Warning: main(): Failed opening ‘/include/txp_auth.php’ for inclusion (include_path=’.;c:/easyPHP/php/includes’) in c:/easyphp/www/textpattern /textpattern/template-export.php on line 17

Warning: main(/lib/txplib_head.php): failed to open stream: No such file or directory in c:/easyphp/www/textpattern/textpattern/template-export.php on line 18

Warning: main(): Failed opening ‘/lib/txplib_head.php’ for inclusion (include_path=’.;c:/easyPHP/php/includes’) in c:/easyphp/www/ textpattern/textpattern/template-export.php on line 18
</code>

Last edited by marco (2004-06-25 15:36:03)

Offline

#12 2004-06-25 22:07:52

swf
Plugin Author
From: Saskatoon, Saskatchewan Canada
Registered: 2004-06-21
Posts: 109
Website

Re: I made some scripts that import/export templates, forms and css

This has to do with php’s ini file that specifies include paths. I noticed this happens on one of my servers too so i just included a @ symbol to suppress the error messages.

change: include $txpath.’/include/txp_auth.php’; include $txpath.’/lib/txplib_head.php’;
to: include $txpath.'/include/txp_auth.php'; include $txpath.’/lib/txplib_head.php’;

or on second thought you can remove those two lines had initially included those in an attempt to requre user autentication cookie to be present. (something to work on for the next version i guess)

Offline

Board footer

Powered by FluxBB