Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
rah_flat -- need help getting started
Rah_flat, with some very helpful instructions on getting started. Alas, I seem to be missing something.
Plugin is installed and enabled. I have visited http://example.com/?rah_flat_key={yourKey}
with my URL and the key from the Admin Settings page, and I get {"success":true}
. However, no folder with template files, and the forms and pages and everything still showing up on the backend.
Is there a more explicit “getting started” guide for this plugin than what’s on GitHub?
Yes, I have tried turning it off and on.
Offline
Re: rah_flat -- need help getting started
If you’re not seeing anything, that usually means your path to the templates directory is not correct, or you don’t have the folders set up in that directory.
What you need to do is:
- Create your own folder for your templates with the subfolders
pages
,forms
(andstyles
andsections
if you want to manage those with flat files too). Put your own template files in those folders using the naming convention Jukka specifies – see Jukka’s example setup. - Go into Admin > Preferences and set the location of your templates directory. The path must be relative to your textpattern directory. Jukka explains that in his readme.
- in Admin > Preferences set site status to
testing
. In testing mode, you don’t need the update link and key at all, only when you set the site status to live.
If you have that working, you should no longer have access to the “Presentation > Pages” and “Presentation > Forms” panes in txp and your front-end should update to match your templates. You can then work on your flat files and sync them to your templates folder. A reload is sufficient to update the site.
Important: as it says in the instructions, it will remove any page and form templates already saved in textpattern. rah_flat is one-way only: it syncs from flat files to the database, replacing wholesale whatever is stored in txp.
If you need your existing templates from the database, you must copy them out into files first (or use maniqui’s scripts). Making a backup before you start is a good idea.
If you need some of the default pages and forms, you’ll find the v4.5.7 ones here, and the most recent v4.6 one’s in the github repo (note: the default form templates in the repo use a different naming convention to rah_flat ({form-type}.{name}.txp
). Either you rename these to {name}.{form-type}.txp
or you use oui_flat which is a fork of rah_flat that uses that naming convention).
TXP Builders – finely-crafted code, design and txp
Offline
Re: rah_flat -- need help getting started
… it will remove any page and form templates already saved in textpattern. rah_flat is one-way only: it syncs from flat files to the database, replacing wholesale whatever is stored in txp.
Thanks — this is the part I was missing. I have a lot of forms, so I’ll give the scripts a shot.
Funny, I recall a couple of years ago using a plugin that did this exact thing, but on first run it created the files based on existing forms and pages. Am I dreaming this?
Yes, I have tried turning it off and on.
Offline
Re: rah_flat -- need help getting started
I think you’re right that one of the template plugins once did that but rah_flat doesn’t …
TXP Builders – finely-crafted code, design and txp
Offline
Re: rah_flat -- need help getting started
Ugh—this seems impossible. I have
- Got Vagrant running and my textpattern website getting served locally
- Saved maniqui’s form import python script in
templates/forms
and entered my db login details - SSH’d into the vm and found templates/forms public folder
So, drum roll, I run python script.ph
and I get ImportError: No module named MySQLdb
. Now I’m ready to give up on version control and go back to editing my forms in the textpattern interface!
Yes, I have tried turning it off and on.
Offline
Re: rah_flat -- need help getting started
I had no luck with maniqui’s scripts either. It had something to do with the mac’s mysqldb implementation and python and after much fiddling I gave up and did it manually via cut and paste. You save the time again further on down the line when working with the flat files. You might want to temporarily install and try mcw_templates (I think it was called) to export your templates once.
TXP Builders – finely-crafted code, design and txp
Offline
Re: rah_flat -- need help getting started
alesh: you can try installing MySQL python interface:
$ sudo pip install mysql-python
Or, on Debian based distros:
apt-get install python-mysqldb
alesh wrote:
Now I’m ready to give up on version control and go back to editing my forms in the textpattern interface!
Even if you can’t get the python scripts working and have to manually create each form, the gainings on the short and long term are worth it. The sole idea of editing forms & pages through the Textpattern interface… gives me shivers.
Note: some comments on this thread are missing, what happened?
Offline
Re: rah_flat -- need help getting started
alesh wrote #299729:
Now I’m ready to give up on version control and go back to editing my forms in the textpattern interface!
Nope. Don’t bother with all that command line faff.
Seriously. Just run mem_templates for the export, that’s what I’ve been doing for years now.
I generally setup a /templates/import(for rah_flat) and /templates/export (for mem_templates) then manually copy export to import for the first run.
Then your’re off to the races. You may need to rename one or two directory names, but that’s it…
Offline
Re: rah_flat -- need help getting started
Yesssss — the men_templates strategy totally worked. Thanks all!
I am posting the full step-by-step here.
Yes, I have tried turning it off and on.
Offline
#10 2016-06-15 13:10:50
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,304
Re: rah_flat -- need help getting started
alesh wrote #299752:
I am posting the full step-by-step here.
That’d be great, yes! I’ve had a tough time of it, too, with making flat_anything work.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Offline
Pages: 1