Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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
Offline
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
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
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
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
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