Textpattern Forum

You are not logged in. Register | Login | Help

#1 2012-08-20 07:34:29

vineonardo
Member
Registered: 2011-08-31
Posts: 128
Website

Use Textpattern with flat files

Hello,
I’ve always heard people complaining about Textpattern putting all the page codes & css in database. It didnt bother me much till the time when I had to create a huge site using Texpattern.
I know txp is best for micro blogging sites, but I’ve successfully pulled off pretty huge site with it. But for huge sites with good amount of traffic needs to have everything fine tuned for page serving speed.

I’m already using external CSS file for a while. Then I thought I can even use external php pages. So I did.

I put all the code from pages into respective .php files and saved all of them in a directory called “templates” in the root.

Then added a small php code in place of page code for every page.

So it all looks something like this. This is code for default page.

<txp:php>
 include('templates/default.php');
</txp:php>

This is working flawlessly and now I can edit all pages through ftp. But when I try to do similar thing with forms, the txp tags do not get processed. All other txp tags from pages work but not the one from external forms page.

So the questions are,

  1. Is this a right method to get it work? Is it safe?
  2. Why forms are working but txp tags are not being processed?

Thanks for your time.

p.s. I had tried to look for solution to Textpattern with flat files, found a very old link for this, but it was dead, so I tried it myself.
Posting this so it might help someone in future!

Offline

#2 2012-08-20 08:33:37

wet
Developer
From: Lenzing, Austria
Registered: 2005-06-06
Posts: 3,116
Website

Offline

#3 2012-08-28 16:26:01

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 249
Website

Re: Use Textpattern with flat files

vineonardo wrote:

p.s. I had tried to look for solution to Textpattern with flat files, found a very old link for this, but it was dead, so I tried it myself.
Posting this so it might help someone in future!

I also tried to find a more efficient solution, flat files little increase productivity, came to what is necessary to separate mathematics (logic) and static. That is, necessary to separate http frontend and http backend. Small comment about this

You can not just cache the css, js and full pages for a short time (5 -15 minutes will be enough to reduce the load many times.) You can also reset the cache to force the individual pages.


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_meta | aks_header : Compress your pages on the fly

Offline

#4 2012-08-28 16:39:39

vineonardo
Member
Registered: 2011-08-31
Posts: 128
Website

Re: Use Textpattern with flat files

@Makss
Thank you for the reply and links.

I generally build sites which are not really heavy trafficked but caching CSS seems useful for the sites with heavy traffic.

Offline

Board footer

Powered by FluxBB