Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-03-18 15:03:17

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

Testers needed: flat development (4.7+ only)

As requested here, we consider the possibility of using flat pages/forms during development. If interested, please help us to test the code and share your feedback.

Currently, it works like this:

  • switch to some theme editing by choosing it on Pages or Forms tab
  • export (if not done yet) this theme to the disk
  • install and enable the plugin below
  • put your site in testing or debug mode
  • modify and save some pages or forms (not styles atm) of this theme directly on the disk with a text editor

While logged in, you will immediately see the changes on the public side. Unlogged visitors will still see the old db version. Once you are happy with the result, rebuild (override) the db theme (Themes tab). Unlogged visitors see now the new version, and you can safely continue the “flat” development as long as the site is not “live”.

Much work yet needs to be done on UX, all ideas are welcome.

# Name: etc_flat v0.1.3 
# Type: Admin/Public/AJAX plugin
# 
# Author: 
# URL: 
# Recommended load order: 5

# .....................................................................
# This is a plugin for Textpattern CMS - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# .....................................................................

YToxMTp7czo0OiJuYW1lIjtzOjg6ImV0Y19mbGF0IjtzOjY6ImF1dGhvciI7czowOiIiO3M6
MTA6ImF1dGhvcl91cmkiO3M6MDoiIjtzOjc6InZlcnNpb24iO3M6NToiMC4xLjMiO3M6MTE6
ImRlc2NyaXB0aW9uIjtzOjA6IiI7czo0OiJjb2RlIjtzOjE0OTY6Imdsb2JhbCAkZXZlbnQs
ICRwcm9kdWN0aW9uX3N0YXR1czsNCg0KaWYgKCRwcm9kdWN0aW9uX3N0YXR1cyA9PT0gJ2Rl
YnVnJyB8fCAkcHJvZHVjdGlvbl9zdGF0dXMgIT09ICdsaXZlJyAmJiBpc19sb2dnZWRfaW4o
KSkgew0KICAgIHJlZ2lzdGVyX2NhbGxiYWNrKCdldGNfZmxhdCcsICdwYWdlLmZldGNoJyk7
DQogICAgcmVnaXN0ZXJfY2FsbGJhY2soJ2V0Y19mbGF0JywgJ2Zvcm0uZmV0Y2gnKTsNCg0K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kQgc2tpbiA9
ICciLmRvU2xhc2goJHRoZW1lKS4iJyIpOw0KICAgIH0gZWxzZSB7DQogICAgICAgIGVtcHR5
KCR0aGVtZSkgb3IgJHNraW4gPSAkdGhlbWU7DQoNCiAgICAgICAgZm9yZWFjaCAoZ2xvYigk
c2tpbl9kaXIuRFMuJHNraW4uRFMuJ2Zvcm1zJy5EUy4nKicsIEdMT0JfT05MWURJUikgYXMg
JGRpcikgew0KICAgICAgICAgICAgaWYgKGlzX3JlYWRhYmxlKCRkaXIuRFMuJG5hbWUuJy50
eHAnKSBhbmQgJHBhZ2UgPSBmaWxlX2dldF9jb250ZW50cygkZGlyLkRTLiRuYW1lLicudHhw
JykpIGJyZWFrOw0KICAgICAgICB9DQoNCiAgICAgICAgJHBhZ2Ugb3IgISRzeW5jIGFuZCAk
cGFnZSA9IHNhZmVfZmllbGQoJ0Zvcm0nLCAndHhwX2Zvcm0nLCAibmFtZSA9ICciLmRvU2xh
c2goJG5hbWUpLiInIEFORCBza2luID0gJyIuZG9TbGFzaCgkc2tpbikuIiciKTsNCiAgICB9
DQoNCiAgICByZXR1cm4gJHBhZ2U7DQp9IjtzOjQ6InR5cGUiO3M6MToiNSI7czo1OiJvcmRl
ciI7czoxOiI1IjtzOjU6ImZsYWdzIjtzOjE6IjAiO3M6NDoiaGVscCI7czowOiIiO3M6Mzoi
bWQ1IjtzOjMyOiJkNmMyY2FlZTZmYmY2NDRjNmM2YWYzMmE5Njk0OTc4ZCI7fQ==

Offline

#2 2018-03-18 15:22:32

CodeWalker
Member
From: Hampshire, UK
Registered: 2010-01-08
Posts: 110
Website

Re: Testers needed: flat development (4.7+ only)

Awesome stuff :) I’ll test it out shortly. Thank you very much.

Offline

#3 2018-03-18 16:05:52

CodeWalker
Member
From: Hampshire, UK
Registered: 2010-01-08
Posts: 110
Website

Re: Testers needed: flat development (4.7+ only)

Ok, Some preliminary notes:

  • Works great if you are logged in and viewing the local domain directly and you manually refresh the browser
  • Does not work with Browserync via proxy, because it does not trigger a full page refresh when the theme files are changed. Reading the browsersync docs, it suggests it should do a full refresh if the file change is not a CSS or Javascript file.
  • Reloading the the proxied browsersynced site only picks up content changed, NOT theme changes (which is bizarre).

I’ll keep testing to see if i can get browsersync to do a full reload. I think some of these issues are down the way i usually use browsersync. Maybe TXP cant tell im logged in because viewing via browsersyncs built in proxy.

Last edited by CodeWalker (2018-03-18 16:07:33)

Offline

#4 2018-03-18 17:12:28

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

Re: Testers needed: flat development (4.7+ only)

CodeWalker wrote #310110:

Maybe TXP cant tell im logged in because viewing via browsersyncs built in proxy.

Thanks for testing. Yes, it could be the proxy eating cookies. To check, try to include this in some article and see the result:

<txp:if_logged_in>Yep, I'm in<txp:else />Nope, I'm out</txp:if_logged_in>

Offline

#5 2018-03-18 20:33:02

CodeWalker
Member
From: Hampshire, UK
Registered: 2010-01-08
Posts: 110
Website

Re: Testers needed: flat development (4.7+ only)

etc wrote #310111:

Thanks for testing. Yes, it could be the proxy eating cookies. To check, try to include this in some article and see the result:

<txp:if_logged_in>Yep, I'm in<txp:else />Nope, I'm out</txp:if_logged_in>...

Yes i think your right. If view the backend through localhost:3000 and login through localhost, it works fine. Before logging in through localhost, but logging in through the test domain directly, that tag gave me a nope.

So using the proxy is fine, as long as you also login via the proxy adddress (localhost:3000/textpattern/) rather then local domain that the proxy is proxying (mydomain.dev/textpattern/)

Last edited by CodeWalker (2018-03-18 20:37:38)

Offline

#6 2018-03-18 22:56:01

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

Re: Testers needed: flat development (4.7+ only)

That’s great Oleg! I’ll definitely be testing that soon!


TXP Builders – finely-crafted code, design and txp

Offline

#7 2018-03-19 02:38:10

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: Testers needed: flat development (4.7+ only)

I just tried and it worked.

I added “Rocks!” to the title tag and it showed up where I was logged in (Chrome) but not where I wasn’t (Firefox) until after the override.

I also tried making a change to the .css file (turning the nav bar a different color) and it had no effect until after the override.

Offline

#8 2018-03-19 08:42:33

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

Re: Testers needed: flat development (4.7+ only)

jakob wrote #310120:

That’s great Oleg! I’ll definitely be testing that soon!

Thanks Julian, it would be great to test it on a multi-site install, I’ve got none at hand.

michaelkpate wrote #310123:

I also tried making a change to the .css file (turning the nav bar a different color) and it had no effect until after the override.

Thanks Michael, CSS forms are processed and output differently, they are not concerned by this test atm. But rvm_css plugin could be configured to work with 4.7 themes, I guess.

Offline

#9 2018-03-19 10:26:20

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,595
GitHub Twitter

Re: Testers needed: flat development (4.7+ only)

etc wrote #310127:

[…] But rvm_css plugin could be configured to work with 4.7 themes, I guess.

Unfortunately, not. rvm_css only works on file creation, never on files updates. It seems that behavior is due to changes on TXP javascript, I guess.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#10 2018-03-19 11:06:20

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

Re: Testers needed: flat development (4.7+ only)

Pat64 wrote #310129:

Unfortunately, not. rvm_css only works on file creation, never on files updates.

I think the CSS file is updated, but browsers continue to serve the cached one, until you hard reload the page. But then caching is the whole point of serving CSS as flat file.

Offline

#11 2018-03-19 12:59:02

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,595
GitHub Twitter

Re: Testers needed: flat development (4.7+ only)

Ok. Thank you Oleg.

So, I can use rvm_css within 4.7.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#12 2018-03-19 19:45:42

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

Re: Testers needed: flat development (4.7+ only)

Pat64 wrote #310136:

Ok. Thank you Oleg.

So, I can use rvm_css within 4.7.

Indeed you can. i’m using it on the beta site without any problems. Re the cache issue, this is what I have in the htaccess on dev sites I’m testing:

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css "access plus 5 seconds"
</IfModule>

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

Offline

Board footer

Powered by FluxBB