Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-06-13 18:45:41

alesh
Member
From: Miami, FL
Registered: 2005-04-13
Posts: 228
Website

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

#2 2016-06-13 21:27:12

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,596
Website

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 (and styles and sections 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

#3 2016-06-14 12:05:40

alesh
Member
From: Miami, FL
Registered: 2005-04-13
Posts: 228
Website

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

#4 2016-06-14 12:19:23

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,596
Website

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

#5 2016-06-14 13:03:17

alesh
Member
From: Miami, FL
Registered: 2005-04-13
Posts: 228
Website

Re: rah_flat -- need help getting started

Ugh—this seems impossible. I have

  1. Got Vagrant running and my textpattern website getting served locally
  2. Saved maniqui’s form import python script in templates/forms and entered my db login details
  3. 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

#6 2016-06-14 13:17:18

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,596
Website

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

#7 2016-06-14 16:06:37

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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?


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#8 2016-06-14 17:06:13

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

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

#9 2016-06-15 13:04:19

alesh
Member
From: Miami, FL
Registered: 2005-04-13
Posts: 228
Website

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

#11 2016-06-15 17:50:21

alesh
Member
From: Miami, FL
Registered: 2005-04-13
Posts: 228
Website

Re: rah_flat -- need help getting started

uli wrote #299753:

That’d be great, yes! I’ve had a tough time of it, too, with making flat__anything_ work.

Viola!


Yes, I have tried turning it off and on.

Offline

Board footer

Powered by FluxBB