Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2022-10-21 23:36:03

emge
New Member
Registered: 2022-10-21
Posts: 6

Editing Pages, Forms, Styles etc. in external program.

Is using an external editor like VSCode to edit pages and styles going to cause any issues? The in browser editor is nice but with syntax highlighting and being able to tab and things like that, I’d prefer to edit files in a real editor if possible.

Edit: just now realizing that pages, etc., are all stored in the database. So it looks like it would be trickier than just simply opening the files in a local text editor. I guess maybe I can just copy and paste them back and forth.

Last edited by emge (2022-10-22 00:21:51)

Offline

#2 2022-10-22 06:16:53

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,225
Website

Re: Editing Pages, Forms, Styles etc. in external program.

emge wrote #333999:

Is using an external editor like VSCode to edit pages and styles going to cause any issues?

There is a way to do it, although not as direct as you first wished… I use it all the time

  • On the Presentation > Themes tab, select your theme and from the multi-edit widget below the table, choose “Export to disk” (in a default configuration, it is exported to a Themes folder at the root of your site).
  • Through a FTP app or eventually directly if you editor support it, open the file(s) you want to edit and start working1.
  • Save
  • Back in Textpattern, Presentation > Themes tab, select your theme and from the multi-edit widget choose “Update from disk”.

IIRC, there is a plugin somewhere that tell Textpattern to use the Pages/Forms files directly from disk instead of from the DB, I forgot the name though.

–^–

1 My editor, BBEdit, has a basic FTP widget that allows direct opening/editing of files on a remote server.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#3 2022-10-22 07:49:55

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

Re: Editing Pages, Forms, Styles etc. in external program.

phiw13 wrote #334000:

IIRC, there is a plugin somewhere that tell Textpattern to use the Pages/Forms files directly from disk instead of from the DB, I forgot the name though.

Yes, it’s called etc_flat and it allows you to work directly with the template files on disk while you are in debugging or testing production mode. Before you switch the site to live, you need to import your files to the database. There are a few caveats – like txp will not know about new forms or templates until you have imported the files to the database – but overall, though, it works brilliantly for development, especially when working on a local webserver. See also this thread for a description.


TXP Builders – finely-crafted code, design and txp

Offline

#4 2022-10-22 10:22:57

emge
New Member
Registered: 2022-10-21
Posts: 6

Re: Editing Pages, Forms, Styles etc. in external program.

Awesome! Thanks so much to you both for explaining. I will be giving this a try shortly here. I am working on a server developing the theme so this sounds perfect. Appreciate your help.

Offline

Board footer

Powered by FluxBB