Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-18 02:23:38

gravyface
Member
Registered: 2006-01-17
Posts: 12

Move presentation layer to file system

I’m not sure if this is the right forum for text pattern design/architecture discussions, but here goes:

I’m wondering why it was decided to move the css and page templates to a database. Not only is it more difficult to build a new template from scratch, it also makes it (arguably) more difficult to install a template. You can’t argue that a good IDE or text editor is light years ahead of a textarea field: undo, syntax highlighting, and version control are just a few reasons why.
Secondly, I’d argue that file system performance would be better, because relational databases are generally optimized for many random/complex queries against large, structured data sets, while file systems are more apt to handle fewer, simpler queries of smaller, unstructured data sets.

I realise that not every user has access to the file system and I can see why channeling end-user/author access through a well-defined, form-based interface is a good idea. However, using other Web CMSs, forums, and blogs as an example, you rarely find that the initial design phases of a site need to be confined to a form-based approach for developing the presentation layer — designers are used to working with text files and images on disk.
The best approach is to use a development environment (usually on the desktop or a dev server in a corporate environment) first, to get the “learning curve” out of the way, and to mitigate the risks associated with working “live”.

I do have several options:

- Create a static “site” first and copy/paste it into Text Pattern, but this leaves opportunities for errors (links, image paths) and redundancy.

- Refactor Text Pattern to read the presentational data from disk.

For now, I’m leaning towards just creating a static copy of the site first but I’m considering the second option longer term.

I’d like to hear what other developers/designers have to say on this before I do anything.

Thoughts?

On another note, Text Pattern is great — the txp “dialect” is one of the best markup mini-languages I’ve used (the defacto “standard” that has grown popularity in the wiki crowd pales in comparison, imho) and the simpicity of the user interface and workflow is one of the reasons why I’m choosing this for an online magazine over some of the more “powerful” Web CMS/portals out there.

Offline

#2 2006-01-18 02:47:40

KurtRaschke
Plugin Author
Registered: 2004-05-16
Posts: 275

Re: Move presentation layer to file system

Well, one advantage I see offhand to storing everything in the DB is that it makes backup, restore, and moving between servers a cinch—just dump/restore the DB. Also, storing pages/forms in the filesystem means that users have to deal with FS permissions. Users seem to have enough trouble with permissions in getting TXP image and file uploads to work—questions like “What’s chmod?”, “How do I chmod 777 in Windows?”, etc.

Personally, I don’t use an IDE for HTML, but I can see how they could have their advantages.

However, rather than moving the presentation layer to the FS, which would require a lot of overhauling, what I might recommend would be to add a WebDAV server to TXP. The WebDAV server component would export TXP pages and forms as files in a WebDAV share, such that they could be opened and edited with a desktop editor.

There is a beta WebDAV server class for PHP, so it’s certainly possible to write a WebDAV server in PHP. Integrating it with Textpattern, though, would be another thing entirely.

It’s something to explore.

-Kurt

Last edited by KurtRaschke (2006-01-18 02:49:05)


kurt@kurtraschke.com

Offline

#3 2006-01-18 03:11:43

misterk
Member
From: Morris, MN
Registered: 2004-02-24
Posts: 77
Website

Re: Move presentation layer to file system

I used MT for a bit before finding textpattern, and the one thing I miss is how it straddled templates both in the database (editable from within the MT admin section) and in the filesystem. I’d love if textpattern could figure this out, I’d be in love.

Offline

#4 2006-01-18 03:12:31

gravyface
Member
Registered: 2006-01-17
Posts: 12

Re: Move presentation layer to file system

Well, one advantage I see offhand to storing everything in the DB is that it makes backup, restore, and moving between servers a cinch—just dump/restore the DB.

I agree with you in principle but the images are still on the file system so while you’re accounting for those files in your backup routine, how much harder is it to add a handful of text files?

Also, storing pages/forms in the filesystem means that users have to deal with FS permissions. Users seem to have enough trouble with permissions in getting TXP image and file uploads to work—questions like “What’s chmod?”, “How do I chmod 777 in Windows?”, etc.

Again, in principle yes, but you have to chmod the permissions on the Text Pattern config file, and/or the images directory, so why would a few template files be any different? And in Windows, you wouldn’t even have to change the file permissions on 99% of Windows desktops out there.
The bottom line is Web Designers are used to working with files on a file system which is why I think this is a good idea for usability and getting “buy-in” from them.

However, rather than moving the presentation layer to the FS, which would require a lot of overhauling, what I might recommend would be to add a WebDAV server to TXP. The WebDAV server component would export TXP pages and forms as files in a WebDAV share, such that they could be opened and edited with a desktop editor.

That might be a better option but I wonder how difficult that would be to integrate compared with reading a file from disk vs. db. I’ll have to investigate further.

Thanks for the feedback.

Offline

#5 2006-01-18 04:27:41

takshaka
Archived Plugin Author
From: Below the Manson-Nixon line
Registered: 2004-06-02
Posts: 97
Website

Re: Move presentation layer to file system

There is a beta WebDAV server class for PHP, so it’s certainly possible to write a WebDAV server in PHP. Integrating it with Textpattern, though, would be another thing entirely.

That would be nice. It’s also as likely to happen as Txp dropping PHP and moving to Rails.

Offline

#6 2006-01-18 05:25:10

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Move presentation layer to file system

I’d like to hear what other developers/designers have to say on this before I do anything.

Premature optimization is the root of all evil.

This is open source, you don’t need anyone’s permission to change something.


Alex

Offline

#7 2006-01-18 09:02:05

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: Move presentation layer to file system

I don’t see why TXP couldn’t doo (by itself or with a plugin) an XML import/export of templates (sections, pages, forms, css, etc.), and import from plain text for example. Writing such a plugin shouldn’t be that hard, no ?

Offline

#8 2006-01-18 13:23:05

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: Move presentation layer to file system

swf had a script that would do it. Last report was that it had problems with 4.0.3 but it used to work. Could be a starting point for a plugin. The thing that makes the MT feature so nice is that it’s automatic.

Last edited by hakjoon (2006-01-18 13:24:38)


Shoving is the answer – pusher robot

Offline

#9 2006-01-18 22:09:06

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Move presentation layer to file system

I like it the way it is thankyou. Very easy to move a site. I have to do a lot of that with my other interest and I can assure you that compared to TXP, moving a WP site is a PITA.

As for development I do that using a Xampp install. No problem there and I have no fear of copy/pasting templates across. Syntax highlighting? What’s that then? Do you really need pretty coloured text to see your errors? I think not.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#10 2006-01-18 22:09:29

swf
Plugin Author
From: Saskatoon, Saskatchewan Canada
Registered: 2004-06-21
Posts: 109
Website

Re: Move presentation layer to file system

Someone please take what I’ve made and improve it and make it into a plugin.

I would love to but I’ve been so busy (teacher) that I have forgotten so much of the little bit of php i knew (does that make sense? ‘so much of the little i knew’).

Offline

#11 2006-01-18 23:48:51

gravyface
Member
Registered: 2006-01-17
Posts: 12

Re: Move presentation layer to file system

thebombsite wrote:
> I like it the way it is thankyou. Very easy to move a site. I have to do a lot of that with my other interest and I can assure you that compared to TXP, moving a WP site is a PITA.
As for development I do that using a Xampp install. No problem there and I have no fear of copy/pasting templates across. Syntax highlighting? What’s that then? Do you really need pretty coloured text to see your errors? I think not.

How exactly is Xampp (a MySQL, Apache, PHP installer) going to address the issue?

Not everyone is a seasoned veteran who “doesn’t need no stinkin’ editor!” and uses vi on the command line. Some beginners may want to use Dreamweaver or TopStyle Pro for their editing. Adding additional steps — building a static mockup first and then dissecting/pasting it in the right textarea field — can be daunting for a new user.

Personally, I use Ultraedit, but I find the biggest slow down with the current interface is having to scroll down and hit ‘save’ after making my changes. It doesn’t seem like a big deal for one-off changes, but when you’re used to keyboard shortcuts (CTRL-S, ALT-TAB, etc.) and you’re designing iteratively, it is a bottleneck. And what about search/replace? Undo? Even TAB doesn’t work (I like my code readable) — the list goes on and on — so I don’t think you can argue that an editor is better than a textarea field.

Seeing as there is some interest here, I think I’m going to look into putting together a plugin that will allow templates to be stored on the file system.

Offline

#12 2006-01-18 23:50:57

gravyface
Member
Registered: 2006-01-17
Posts: 12

Re: Move presentation layer to file system

> hakjoon wrote:

> swf had a script that would do it. Last report was that it had problems with 4.0.3 but it used to work. Could be a starting point for a plugin. The thing that makes the MT feature so nice is that it’s automatic.

Just saw this now. I’d definitely be interested in expanding/improving on this. Thanks :)

Offline

Board footer

Powered by FluxBB