Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Why are templates still in the database?
I’m in the process of improving a very, very large Textpattern site (~60,000 uniques/month), and trying to rework my development scenario.
And it sucks.
This site has tons of content – more than 10,000 articles and thousands of photos uploaded through Textpattern. I’d like to change the presentation of the site & some of the plugin code.
Unfortunately, the content and the presentation/logic for that content are coupled, in the database. So, in order to develop the site ‘the right way’ – that is, not-live, I’ll need to replicate a massive database, and then copy back the presentation & logic changes while not ruining its constantly (multiple times daily) updated content.
So, what’s the best scenario for this? Honestly, I’m quite peeved, since Textpattern is the only system I’ve used so far that puts so much stuff in the database. It runs entirely against the workflow of everything else out there – it would be insane for me to put the entire database under revision control, while in other cases, I could easily put the template files and logic in SVN or whatnot.
Perhaps putting templates in the database was a good idea early on – the most obvious advantage would be the integrity of the Textpattern code (and thus update path / backup / moving the site should be simpler.) But we’ve seen that moving sites isn’t always simple, and it’s dead-simple to exclude the templates directory when updating.
All in all, I can’t see the reasoning, and it’s a huge problem for development. And, yes, if I don’t like it, I’m not paying for it, so I might as well say sayonara, but with a large trained staff and massive archives, jumping ship to another system (if only Django ran on our servers) is essentially asking for a massive amount of work. I will gladly make the changes to the Textpattern core to make storing templates in files an option, if I have some idea that they will be supported or adopted.
Offline
#2 2008-04-16 03:49:51
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Why are templates still in the database?
Are your txp_form, txp_page and txp_css tables that large? even when gzipped?
Offline
Re: Why are templates still in the database?
I guess I could make a dump of the live database, excluding the `textpattern` table, and then make dummy content for the 17 sections that I have? I just don’t see how anyone enjoys the current setup: Often my workflow for editing templates is
- Open up Textpattern and the live site in tabs
- Copy template code from TXP to local editor
- Edit code
- Copy template code back to TXP
- Save
- Reload page
Editing templates in Textpattern is torture: there are absolutely no refinements to the editing area, so I doubt the developers expect people to use it to edit code. For one thing – just like other HTML forms, you can’t use tabs in the editing areas. That plus the word wrapping means that there’s no way to make attractive template code in any coding style. Plus there is no undo after saving, and no test cycle other than saving & checking it on the live site (hence, no ‘test’ cycle, just a haphazard try-and-pray cycle)
Offline
Re: Why are templates still in the database?
There are plugins like these for those that don’t like the standard editing features:
Offline
Re: Why are templates still in the database?
Maybe an approach: When I’ve rewrite my weblog and some minor sites I’ve done the following:
- duplicated the relevant sections, pages and forms or created new one if nedded
- rewrited and tested the code without affecting live sites
- taked down which pages, forms has changed
- then merged back the changed pages, forms (renamed, copied whatever) to the live sections, pages, forms
So I had about a three minutes maintenance. It was done only for a little weblog and minor sites, but maybe it’s a possible way to handle with greater sites.
Btw.: Hence tabs don’t work us double spaces! I use it in software editors too (tab key produces doubles spaces). So I don’t need a screen with an ultra wide resolution and the heavy readable line breaks are not often. :)
Digital nomad, sailing the world on a sailboat: 32fthome.com
Offline
#6 2008-04-16 08:44:58
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: Why are templates still in the database?
Have you tried it’s all text ? It’s a very useful extension for firefox that allows you to edit html forms directly in your favorite text editor
Offline
Re: Why are templates still in the database?
Also you can do edits directly to the database with your favorite editor or method. I love the fact that templates are in database, coz it opens the dimension of what SQL can do. Also, I don’t like to move 500 template files everytime I do big website, from server to server, when I can do that with single tiny SQL file. Also, queries are kinda fast way to search/replace/find things from the templates, than enourmous text template database. But this is only dev/designer-hybrid opinion.
Also, I’m big text database / template hater… MySQL is database heaven: secure, tiny and kinda like rat loves cheese.
Last edited by Gocom (2008-04-16 09:59:41)
Offline
Re: Why are templates still in the database?
i’m in a similar situation. we’re using a development server that is a mirror of the live site at a given time. we’re not updating any articles after the dump because there is enough content to work with. then, changes are made to pages and form, which are then copied back to the live site. it’s doable but far from perfect imo. often, you have code snippets in the devel pages and forms that don’t belong to the live site, so i’m ending up doing copy&paste between the two installations all the time. it’s quite annoying and also sort of dangerous when multiple people are involved in the process.
while i often find the way txp stores everything in the db quite handy, i’d love to be able to use versioning etc.. it’s an interesting topic and i’d love to see how one could improve the workflow for large sites that are under constant revision.
Offline
Re: Why are templates still in the database?
Hi.
What about Bert’s hcg_templages
From TXPQ
Hcg_templates makes the import and export of pages, forms and styles extremely easy and error-proof.
I’m also working in a re-design of a TxP site, so I have set a development version on a subdomain. Sometime soon, before doing the switch i would like to merge the content (as I’ve planned, just comments and Postmaster subscribers) from the live (current) site to the dev version.
Is it that hard? or is it a easy?
Offline
#10 2008-04-16 17:03:05
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Why are templates still in the database?
For one thing – just like other HTML forms, you can’t use tabs in the editing areas.
“here’s a plugin for that too, by the way. :)
Last edited by Mary (2013-01-24 17:29:06)
Offline