You are not logged in.
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
@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
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
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:
If you go with option A:
If you go with option B:
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):
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).
Offline
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
markus_falk, it seems the plugin’s installation process was already run before, could that be?
Offline
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
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
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
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