Textpattern Forum

You are not logged in. Register | Login | Help

#161 2011-12-13 13:19:13

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 1,898
Website

Re: [plugin] [ORPHAN] cnk_versioning

You’re right, you don’t need rah_external_output for normal txp-internal use. You would use it if you want to provide another site with a txp-generated content snippet. I did once have a hybrid case where a flash-based map widget needed you to specify a an xml-url/file to load. rah_external_output can be used for that too.

The problem is you cnk_versioning doesn’t save the rah_external_output templates as files so you can’t edit them in your normal text editor. johnstephen’s trick of just placing <txp:output_form name="my-rah-external-template" /> in the rah_external_output templates gets around that limitation.


TXP Builders – finely-crafted code, design and txp

Offline

#162 2011-12-13 16:46:07

johnstephens
Plugin Author
From: Harrisonburg, VA
Registered: 2008-06-01
Posts: 821
Website

Re: [plugin] [ORPHAN] cnk_versioning

@Algaris: Jakob’s explanation pretty much covers it, but here’s an example from the wild. I built the site for an academic journal, and one thing they did routinely was publish the article info for each article in text files for scraping by a custom aggregator. I was able to automate this by using rah_external_output to generate the text “file” dynamically using the article information Textpattern already has in its database.

Here’s an article page.

Here’s the article metadata feed.

Using rah_external_output allows me to pull this information out in a format I define without littering my site architecture with unnecessary sections and mucking around with serving certain sections with a different MIME-type.

I hope this makes sense!

Offline

#163 2012-01-04 23:01:55

sidekarsten
Member
From: Netherlands
Registered: 2011-08-11
Posts: 34
Website

Re: [plugin] [ORPHAN] cnk_versioning

Dear maniqui, will have a good look at this versioning plugin, looked at it before but found it very difficult to understand how it works exactly. My sites will be on the same server, even on a subdomain of the main site mainsite.com / relatedsite.mainsite.com

However, at the moment each is running on its own TXP install and Dbase but as I understand it, this should not really matter for the versioning plugin. Thanks for the advice however, I will try to get that working… In anycase, rah_external_output is a very handy plugin, as I was also looking for a way to include content from the related sites in the main sites (as a sort of overview site to show what is going on in the related sites) and this seems perfectly suited for that!

Cheers

Offline

#164 2012-01-05 00:01:37

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 2,976
Website

Re: [plugin] [ORPHAN] cnk_versioning

sidekarsten wrote:

Dear maniqui, will have a good look at this versioning plugin, looked at it before but found it very difficult to understand how it works exactly. My sites will be on the same server, even on a subdomain of the main site mainsite.com / relatedsite.mainsite.com

This is exactly the same scenario where I implemented the suggested solution.

After installing (and visiting the corresponding tab & running the process), the cnk_versioning plugin will create one file for each page & form (& css, although I don’t use the feature of serving CSS from TXP database) you have on your database. This process is usually run just once, you don’t need to do it again.
After that, each time you edit any of this files (i.e. you edit a form or a page), cnk_versioning will “suck it” from the filesystem and “dump” it back to the database. One-way only (and, btw, will do it only when the website’s production status is set to “testing” or “debut”, not “live”).

So, some extra notes for you:

  • first, you will have to decide:
    • A) if all websites will share the same set of forms & pages (probably, the ones created in the main website)
    • B) or if you will prefer to have each related website with its own set of pages & forms, and also, have some extra pages & forms symlinked from a common “pool” of files (this “pool” of files could be the files corresponding to the main website).

If you go with option A:

  • you will have to install & configure cnk_versioning on each website ***but***
  • only run the “create files” process once, in one of them (probably the main site), and then do all the symlink setup

If you go with option B:

  • you will have to install & configure cnk_versioning on each website ***then***
  • run the “create files” process once, in each website.
  • and then “add” the extra pages & forms on each related website by symlinking the corresponding files from the main website’s folder.

There are a few different ways to setup both options A & B, and in fact, I can think of few more options than just A & B. For example, option C (a mix of A & B):

  • the main website has its own set of files (pages & forms).
  • then all related websites also have a common set of files (pages & forms). This set of files could, of course, include symlinks to files on main website.

This reduces the need of setting up a folder for pages&forms on each related website.

However, at the moment each is running on its own TXP install and Dbase but as I understand it, this should not really matter for the versioning plugin.

It wouldn’t matter in the sense that all files (pages & forms) will be “sucked back” to each database (i.e. for each website).

In any case, rah_external_output is a very handy plugin, as I was also looking for a way to include content from the related sites in the main sites (as a sort of overview site to show what is going on in the related sites) and this seems perfectly suited for that!

So, I think you will find this trick very useful. It takes advantage of using rah_external_output in tandem with cnk_versioning.

Bottom line: if you setup all this properly (and, really, it isn’t that hard as it may sound), you will totally forget about editing files in a browser’s textarea, and you will greatly reduce the need of doing duplicated edits/tasks across different websites. And you will get some extra gains if you work with VCS (like Git/Mercurial/SVN/etc).


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#165 2012-01-29 17:19:46

markus_falk
Member
Registered: 2012-01-14
Posts: 11

Re: [plugin] [ORPHAN] cnk_versioning

too good to be true :)

Warning: Duplicate column name ‘file_mod_time’ ALTER TABLE projectm_txp_form ADD `file_mod_time` DATETIME NULL textpattern/lib/txplib_misc.php(653) : eval()’d code:528 cnk_ver_batch_query() in /Applications/XAMPP/xamppfiles/htdocs/project-m/textpattern/lib/txplib_db.php on line 89

Installation aborted

Last edited by markus_falk (2012-01-29 17:23:06)

Offline

#166 2012-01-29 20:00:51

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 2,976
Website

Re: [plugin] [ORPHAN] cnk_versioning

markus_falk, it seems the plugin’s installation process was already run before, could that be?


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#167 2012-01-29 20:36:54

markus_falk
Member
Registered: 2012-01-14
Posts: 11

Re: [plugin] [ORPHAN] cnk_versioning

that’s correct. I got a different error that I can’t reproduce right now so that I wanted to reinstall it.

I deleted the plugin from the admin tab. But I also removed all the database fields with that name. still the error occurs.

btw: thanks for your fast reply :)

Offline

#168 2012-01-31 18:59:27

markus_falk
Member
Registered: 2012-01-14
Posts: 11

Re: [plugin] [ORPHAN] cnk_versioning

Sorry but I just can’t get it to work … I successfully de- and reinstalled the plugin.

Problem is that it just can’t get it to “write pages and forms to files”. It returns:

Folder “/forms/” is not writable.
Folder “/pages/” is not writable.
Folder “/css/” is not writable.

but I put all 3 folders to drwxrwxrwx. It also tells me that there are files in those folders. These could only be the OSX storage files. but overwriting doesn’t work.

any idea? I just don’t want to give up on this plugin cuz I luv the idea of it :)

Offline

#169 2012-01-31 21:13:54

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 1,898
Website

Re: [plugin] [ORPHAN] cnk_versioning

Markus, check in the plugin code (admin > plugins > edit) to see the specified path for those folders ($CNK_VER_OUTPUT_PATH = ...). That may be pointing to a path that’s different to where you have your folders. The plugin does work and I have used it with local mamp installations on os-x too, albeit in virtualhost containers.


TXP Builders – finely-crafted code, design and txp

Offline

#170 2012-02-01 15:33:38

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

Re: [plugin] [ORPHAN] cnk_versioning

EDIT [2012-02-17] begin
In the original listing the author says:

Please use this with care! Your pages/forms/css will be deleted from the database, when you delete the corresponding files.

The warning says it all—use with the care, for example perhaps get this working on a non-live system first, have a backup of both files and database, etc.
EDIT [2012-02-17] end

I also have CNK working on OS X (Lion & MAMP PRO).

But I also had some problems installing and so when I last installed, I took some notes for myself, here are the notes, I hope it helps:

1. create the folders

/my-nice-folder/cnk_templates/css
/my-nice-folder/cnk_templates/forms
/my-nice-folder/cnk_templates/pages

2. install the plugin but do not activate, the plugin code I use is cnk_versioning for txp 4.41
3. edit the plugin code, essentially delete it all and past in cnk_versioning for txp 4.41 – modified code once plugin is installed
4. check you are happy with the locations and file extensions

$CNK_VER_OUTPUT_PATH = 'my-nice-folder/cnk_templates/'; //e.g. 'textpattern/_templates/versioning/'
$CNK_VER_EXT = 'php';
$CNK_VER_EXT_CSS = 'css';

5. activate the plugin
6. click ‘Presentation’ and then go to ‘Versioning’
7. do NOT click ‘Install’ but do click ‘Write pages & forms to files‘—you see errors, no matter
8. now click ‘Install’
9. your folders should now hold files to reflect the Forms, Pages, CSS.

This is likely a cringe-making way to install this plugin, but I value its functionality SO much that when I found these steps worked I wrote them up so I could repeat them like a monkey each time I needed the plugin installed.

Good luck and I hope this helps.

Cheers, -Alan

Last edited by alanfluff (2012-02-17 15:30:21)


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