Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2011-01-03 18:56:09

hcgtv
Archived Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: edit template files in an external text editor?

johnstephens wrote:

And since you don’t have to install or run cnk_versioning, you’re free to use Textpattern’s admin area if that’s your preference. What am I missing?

You could also try out rah_post_versions if you want keep track of changes.

Personally, whenever I launch a new site or decide to make major changes to an existing site, I do it locally. On my local install, the Textpattern admin is plenty fast for my needs. About the only time I enlist a text editor is when I’m converting an existing XHTML design into Textpattern.

I know we all work differently, but having multiple tabs open in Firefox is just the same to me as having multiple tabs opened up in Notepad++ or any other text editor.

Like I said before, I’d like to see the admin area enhanced to facilitate template creation or maintenance. We all have larger monitors these days and with a few tweaks here and there, the admin can be a better place for all of us to hang out in.

Offline

#26 2011-01-03 21:32:25

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: edit template files in an external text editor?

Have you had any issues with deleted files? The way you have described your work flow does make me want to try that as it seems to give me what i want: editing via textmate.

No, I haven’t, but it was confusing the first time I installed and enabled cnk_versioning. It’s always wise to back up your database before doing stuff.

I recommend creating your template directory first, and the enclosed css, forms, and pages directories, and making sure that the permissions on those directories are correct. Then you can install and edit cnk_versioning to include the path to your templates directory. After that, activate the plugin and go to the “Versioning” tab under “Presentation”. You will need to “Install” the database table used to track the versions, then write out the current template files. To import changes to the templates, just change your site’s “Production Status” to “Testing” or “Debugging” and reload any public page on the site.

If anything goes wrong, just restore your database backup, but I’ve never lost anything. If you’re still anxious about it, you can do a trial run on a clean Textpattern install. Once you’ve set it up once or twice, it goes pretty smoothly.

Last edited by johnstephens (2011-01-03 21:33:10)

Offline

#27 2011-01-03 23:50:04

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,136
Website Mastodon

Re: edit template files in an external text editor?

johnstephens wrote:

No, I haven’t, but it was confusing the first time I installed and enabled cnk_versioning. It’s always wise to back up your database before doing stuff.
I recommend creating your template directory first, and the enclosed css, forms, and pages directories, and making sure that the permissions on those directories are correct. Then you can install and edit cnk_versioning to include the path to your templates directory. After that, activate the plugin and go to the “Versioning” tab under “Presentation”. You will need to “Install” the database table used to track the versions, then write out the current template files. To import changes to the templates, just change your site’s “Production Status” to “Testing” or “Debugging” and reload any public page on the site.

Thanks for this John. The way you have described the use of cnk makes good sense. As I backup by SQL DB on a monthly basis i don’t see much of a downside.

Will give it a go on my current development site on my local drive.

Last edited by bici (2011-01-03 23:51:11)


…. texted postive

Offline

#28 2011-01-04 00:03:43

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,136
Website Mastodon

Re: edit template files in an external text editor?

johnstephens wrote:

I recommend creating your template directory first, and the enclosed css, forms, and pages directories, and making sure that the permissions on those directories are correct.

I am trying it out. But where do change the CNK to point to the various directories in _Templates/Pages, _Templates/Forms ??

@ global $CNK_VER_OUTPUT_PATH, $CNK_VER_EXT, $CNK_VER_EXT_CSS;

$CNK_VER_OUTPUT_PATH = ‘’; //e.g. ‘textpattern/_templates/versioning/’
$CNK_VER_EXT = ‘txp’;
$CNK_VER_EXT_CSS = ‘css’;

/* DO NOT EDIT BELOW THIS LINE! */

@


…. texted postive

Offline

#29 2011-01-04 01:12:39

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: edit template files in an external text editor?

bici wrote:

I am trying it out. But where do change the CNK to point to the various directories in _Templates/Pages, _Templates/Forms ??

Edit this line — just add your path between the single quotes after the equal sign:

$CNK_VER_OUTPUT_PATH = ''; //e.g. 'textpattern/_templates/versioning/'

Offline

#30 2011-01-04 20:26:53

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,136
Website Mastodon

Re: edit template files in an external text editor?

johnstephens wrote:

bici wrote:

I am trying it out. But where do change the CNK to point to the various directories in _Templates/Pages, _Templates/Forms ??

Edit this line — just add your path between the single quotes after the equal sign:

$CNK_VER_OUTPUT_PATH = ''; //e.g. 'textpattern/_templates/versioning/'

yes. that i was able to figure out. But i was wondering how to make the directories as you suggested :

“ and the enclosed css, forms, and pages directories “ and have it work by PAGE/FORMS??


…. texted postive

Offline

#31 2011-01-04 20:33:41

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: edit template files in an external text editor?

bici wrote:

yes. that i was able to figure out. But i was wondering how to make the directories as you suggested :

“ and the enclosed css, forms, and pages directories “ and have it work by PAGE/FORMS??

You have to create the directories on your server, which usually requires shell or FTP access. Here’s what I do in the shell:

$ cd my/document/root
$ mkdir my-template-directory
$ mkdir my-template-directory/css my-template-directory/forms my-template-directory/pages
$ chmod 777 my-template-directory/*

Offline

#32 2011-01-04 20:36:27

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: edit template files in an external text editor?

Change “my-template-directory” to whatever you want to name your template directory. It must be the same path you use for $CNK_VER_OUTPUT_PATH. If you set $CNK_VER_OUTPUT_PATH to 'templates/', “my-template-directory” should be called “templates” and located in your document root.

Last edited by johnstephens (2011-01-04 20:36:43)

Offline

Board footer

Powered by FluxBB