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: 2,947
Website

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.2 
# 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
MTA6ImF1dGhvcl91cmkiO3M6MDoiIjtzOjc6InZlcnNpb24iO3M6NToiMC4xLjIiO3M6MTE6
ImRlc2NyaXB0aW9uIjtzOjA6IiI7czo0OiJjb2RlIjtzOjEyOTg6Imdsb2JhbCAkZXZlbnQs
ICRwcm9kdWN0aW9uX3N0YXR1czsNCg0KaWYgKCRwcm9kdWN0aW9uX3N0YXR1cyA9PT0gJ2Rl
YnVnJyB8fCAkcHJvZHVjdGlvbl9zdGF0dXMgIT09ICdsaXZlJyAmJiBpc19sb2dnZWRfaW4o
KSkgew0KICAgIHJlZ2lzdGVyX2NhbGxiYWNrKCdldGNfZmxhdCcsICdwYWdlLmZldGNoJyk7
DQogICAgcmVnaXN0ZXJfY2FsbGJhY2soJ2V0Y19mbGF0JywgJ2Zvcm0uZmV0Y2gnKTsNCg0K
ICAgIGlmIC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T0Jf
T05MWURJUikgYXMgJGRpcikgew0KICAgICAgICAgICAgaWYgKCRwYWdlID0gQGZpbGVfZ2V0
X2NvbnRlbnRzKCRkaXIuRFMuJG5hbWUuJy50eHAnKSkgYnJlYWs7DQogICAgICAgIH0NCg0K
ICAgICAgICAkcGFnZSBvciAkcGFnZSA9IHNhZmVfZmllbGQoJ0Zvcm0nLCAndHhwX2Zvcm0n
LCAibmFtZSA9ICciLmRvU2xhc2goJG5hbWUpLiInIEFORCBza2luID0gJyIuZG9TbGFzaCgk
c2tpbikuIiciKTsNCiAgICB9DQoNCiAgICByZXR1cm4gJHBhZ2U7DQp9IjtzOjQ6InR5cGUi
O3M6MToiNSI7czo1OiJvcmRlciI7czoxOiI1IjtzOjU6ImZsYWdzIjtzOjE6IjAiO3M6NDoi
aGVscCI7czowOiIiO3M6MzoibWQ1IjtzOjMyOiJkOTNhMmI1NTNhODIxZGI3YmYyMzA5MGRj
MjVjMzBhMyI7fQ==

etc_[ query | search | pagination | date | tree | cache ]

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: 2,947
Website

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>

etc_[ query | search | pagination | date | tree | cache ]

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
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,156
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,117
Website

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: 2,947
Website

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.


etc_[ query | search | pagination | date | tree | cache ]

Offline

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

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,205
Website

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.
G+
Github | CodePen

Offline

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

etc
Developer
Registered: 2010-11-11
Posts: 2,947
Website

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.


etc_[ query | search | pagination | date | tree | cache ]

Offline

Board footer

Powered by FluxBB