Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-01-26 15:53:58

alanfluff
Member
From: Ottawa, Canada
Registered: 2008-09-15
Posts: 222
Website

Using an external editor

Hi, Sorry if this is ‘old-hat’, an unapproved practice or in some other way not seen as a good thing, but, I couldn’t find, at a cursory search, any reference to this technique and so I wanted to share in case it helps anyone or anyone cleverer than me (lots of you) sees something bad about it and is kind enough to educate me.

When developing sites locally, I have wanted to use an external editor for TXP code (Forms, Pages) for some time. I already do for CSS as my CSS is included in TXP thus:

@import url('/_myfolder/style/mystyle.css');

…and then I use an external editor. But for Pages and Forms, I edit externally (in Coda) and copy/paste into the relevant TXP Form or Page.

This discipline forces me to keep a copy of each Form or Page I develop in a like-named file, external to TXP. A pain or a benefit, your mileage may vary, but for me, a benefit, as external editors offer many advantages.

So, I recently thought, “why can’t I [include] my external copies of the Forms / Pages and then edits to the external file will be reflected in TXP?”. So I just added this to a Form that usually represents most of one main Page:

<txp:php>include("_myfolder/forms/delme.php");</txp:php>

…and it worked. Hurrah!

So it looks like if I step-repeat this, I will be able to externally edit all the Forms / Pages and save, during dev/design at least, myself a lot of copy/pasting.

Does anyone know if leaving a production site operating like this would be bad/inefficient? I had assumed it might be, and so at go-live time I was going to copy back the actual code in place of the include statement.

Hope this is helpful and interested in comments — guessing perhaps I am miles behind and maybe everyone does this already and I just missed the boat ;)

Cheers, -Alan


At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A

Offline

#2 2009-01-26 16:09:10

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,538
Website GitHub Twitter

Re: Using an external editor

Hi

For me i use a firefox extention “it’s all texte” that let edit any html field into an externat editor (like notepad++) and after i save on the editor, the html field is automatically updated, i have to clic the save button to complete the process, and that work online.

Cheers

Offline

#3 2009-01-26 16:51:17

alanfluff
Member
From: Ottawa, Canada
Registered: 2008-09-15
Posts: 222
Website

Re: Using an external editor

Hi Dragondz, thanks for your comment about “it’s all texte” — I will look at that :) Cheers, -Alan


At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A

Offline

#4 2009-01-26 17:06:09

alanfluff
Member
From: Ottawa, Canada
Registered: 2008-09-15
Posts: 222
Website

Re: Using an external editor

:( running into ‘robustness issues’.

Drat. Works fine for the main Form driving the main Page – if I get it working for other Forms too, or fail, I’ll post back here.

So far, seems the Firefox extension is a slightly more complex answer if you’re a Mac user, but will look at that if I can’t solve this route.

Last edited by alanfluff (2009-01-26 17:06:39)


At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A

Offline

#5 2009-01-26 17:17:15

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

Re: Using an external editor

alanfluff

Does cnk_versioning do anything for you, or does that do things “the wrong way round” for your needs?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2009-01-26 17:46:06

alanfluff
Member
From: Ottawa, Canada
Registered: 2008-09-15
Posts: 222
Website

Re: Using an external editor

I think cnk_versioning might well be the answer, if my cludge cannot do it for me. Tks for the link, never tried this one before. Cheers, -Alan


At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A

Offline

Board footer

Powered by FluxBB