Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-04-06 15:51:51

mattmikulla
Member
From: Nashville Tennessee
Registered: 2004-08-25
Posts: 281
Website

What are the benefits of having templates in the database?

Just curious. What are the benefits of having the templating for TXP sites stored in a database vs editable in directories as wordpress does?


Art Rogue – Fine Art Photography

Offline

#2 2010-04-06 16:48:00

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

Re: What are the benefits of having templates in the database?

Pros:

  1. A single database backup contains most of your site info (bar images/files/custom scripts) so it’s fairly portable
  2. Linking pages to sections is easier in a DB than maintaining a directory tree or mixing DB calls with files which could go out of sync if permissions problems creep in

Cons:

  1. Database call is usually slower than reading a file directly
  2. No versioning out of the box

I’m sure other people can add other reasons to either camp.

Swings and roundabouts really. The DB approach does keep things simpler and in one place vs having to sync files via FTP when moving stuff from dev to live sites or making incremental changes, for example. But then you have to sync images/files anyway… *shrug*

For all other use cases there’s cnk_versioning of course :-)


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

#3 2010-04-06 18:29:00

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,258
Website GitHub Mastodon Twitter

Re: What are the benefits of having templates in the database?

can edit the layout any place anytime


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2010-04-06 18:42:21

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: What are the benefits of having templates in the database?

Offline

#5 2010-04-06 19:25:31

mattmikulla
Member
From: Nashville Tennessee
Registered: 2004-08-25
Posts: 281
Website

Re: What are the benefits of having templates in the database?

That firefox extension isn’t working for me. Hummm….

Last edited by mattmikulla (2010-04-06 19:34:39)


Art Rogue – Fine Art Photography

Offline

#6 2010-04-24 06:54:37

Niconemo
Member
From: Rhône-Alpes, France
Registered: 2005-04-18
Posts: 557

Re: What are the benefits of having templates in the database?

It’s working for me and it’s so cool for templates and style sheets !

Last edited by Niconemo (2010-04-24 06:54:59)


Nico

Offline

#7 2012-01-14 22:05:38

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

Re: What are the benefits of having templates in the database?

I think this is one of greatest misconceptions of txp … it annoys me to death working on those templates … I can’t agree on saying that this easier than deploying some template files via ftp to a server. Besides, my developement enviroment is local and there I would only have to edit template files.

I came across many systems like Contao, Typo3, Rails and all of them have files to edit. Maybe this is something TXP should adopt.

The proposed solution with the FF extensions sucks also because you have to open and close the same template file after every save. this is even more frustrating than copy and paste from editor to TXP.

Last edited by markus_falk (2012-01-14 22:05:49)

Offline

#8 2012-01-14 22:27:01

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: What are the benefits of having templates in the database?

hi markus_falk.

There is this plugin: cnk_versioning
It will export pages & forms to files, and from that point, you will be able to edit them in a file editor, and also version them with your favorite SCM. Then, a simple refresh on your website (while in “Testing” mode), will “suck” the changes files into the database. Try it, you will love it.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB