Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2019-02-03 05:41:04

craigbass76
Member
Registered: 2009-12-23
Posts: 36

Quicker Refresh Method

Rather than have to “Update from disk” and then click OK again, is there a query I can run or something in a command like that will re-import a theme file (css, txp, etc) in one go? I’m making lots of little changes to a theme and have to keep clicking — I’d rather just alt tab to a terminal and do something quicker.

Offline

#2 2019-02-03 09:25:10

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

Re: Quicker Refresh Method

Does the etc_flat plugin fit your needs for the time being until we can figure out some webhooks in core?


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 2019-02-03 22:22:31

craigbass76
Member
Registered: 2009-12-23
Posts: 36

Re: Quicker Refresh Method

I don’t even need a webhook, really. If it’s a PHP or a MySQL command I can run, all I’d need to do to run it again is hit the up arrow in my terminal, and Enter.

Offline

#4 2019-02-04 08:16:54

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: Quicker Refresh Method

Did you try etc_flat? It makes development a lot easier. When activated, as long as you’re in testing or debug mode it will retrieve your page templates, forms and styles from the files rather than the database making development only a matter of saving your changes and refreshing the browser. Then, when you’re ready to switch to live, just sync the files to the database once manually.


TXP Builders – finely-crafted code, design and txp

Offline

#5 2019-02-05 03:50:48

craigbass76
Member
Registered: 2009-12-23
Posts: 36

Re: Quicker Refresh Method

Does this use more or less resources than the regular way? Wondering if I should just leave it once the site is live.

Offline

#6 2019-02-05 09:26:45

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: Quicker Refresh Method

craigbass76 wrote #316469:

Does this use more or less resources than the regular way? Wondering if I should just leave it once the site is live.

That’s a good question, but the difference (if any) is marginal. Flat files are served only to logged-in users (mainly site developers) and only in non-live mode. Regular visitors are served from db as usual and thus do not see your changes until you deploy them. You can delete or disable the plugin when the work is done.

Offline

#7 2021-05-03 18:03:29

cheesington
New Member
Registered: 2021-05-03
Posts: 1

Re: Quicker Refresh Method

Thank you, gentlemen. I came here wondering if there was a way to enable a one-button update-template-from-disk, but etc_flat (called rah_flat now?) is even better. I’m delighted.

Offline

#8 2021-05-03 22:01:04

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: Quicker Refresh Method

cheesington wrote #330025:

Thank you, gentlemen. I came here wondering if there was a way to enable a one-button update-template-from-disk, but etc_flat (called rah_flat now?) is even better. I’m delighted.

etc_flat is the way to go now.

rah_flat (and oui_flat which is based on it) was from Textpattern’s pre-theme era and completely replaces the templates in the database with those from disk on each page load. If one wasn’t careful, one could inadvertently zap one’s templates.

As I wrote above etc_flat only works when you’re logged in and in testing or debug mode. It then by-passes the database and uses the templates you have on disk. That’s perfectly fine when developing. Before going live, you need to actually update the theme from disk to bring in your changes to Textpattern’s database version.

You also need to do that if you create new forms or page templates on disk. Textpattern won’t know about them until there’s a corresponding entry in the database.


TXP Builders – finely-crafted code, design and txp

Offline

#9 2021-05-04 19:14:05

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: Quicker Refresh Method

jakob wrote #330026:

You also need to do that if you create new forms or page templates on disk. Textpattern won’t know about them until there’s a corresponding entry in the database.

I keep in mind this request, but currently there is no callback for altering the forms list, and replacing the whole forms tab would be too txp version-dependent.

Offline

Board footer

Powered by FluxBB