Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#97 2018-03-17 20:27:55

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

Re: Feedback to: Textpattern CMS 4.7.0 beta released

CodeWalker wrote #310088:

I think it should be possible to choose either way without being forced in either direction

Just create and enable a public side plugin like

register_callback('etc_flat', 'page.fetch');
register_callback('etc_flat', 'form.fetch');

function etc_flat($event, $step, $rs) {
    global $pretext;
    extract($rs);
    $page = false;

    if ($event == 'page.fetch') {
        $page = @file_get_contents($pretext['path_to_site'].DS.'themes'.DS.$theme.DS.'pages'.DS.$name.'.txp');
    } else {
        foreach (glob($pretext['path_to_site'].DS.'themes'.DS.$skin.DS.'forms'.DS.'*') as $dir) {
            if ($page = @file_get_contents($dir.DS.$name.'.txp')) break;
        }
    }

    return $page;
}

and your pages and forms will (should) be fetched from flat files, without any db sync. It can be easily amended to run only for logged users, only in debug mode etc.

Offline

#98 2018-03-17 22:17:30

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

Re: Feedback to: Textpattern CMS 4.7.0 beta released

This whole discussion is taking me back to 2003 because Movable Type (which some of us who have been around a very long time used before Dean released Textpattern to the public) has this very feature:

Optionally link this template to a file on your filesystem. This enables you to edit the templates in a text editor or other tool of your choice instead of through the Movable Type template editing screen. If you select this option and link the template to a file, Movable Type will keep its internal copy synchronized with the external file. – Managing your Blog’s Templates

Offline

#99 2018-03-18 05:51:27

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,091
Website Mastodon

Re: Feedback to: Textpattern CMS 4.7.0 beta released

colak wrote #310087:

Please don’t:). Some of us love to work in computers without an ftp client. I actually prefer to work on the browser. What I believe we are in need for, is for the functionalities of rvm_css and spf_js to become part of the core. That is, working on the browser and on save, the files are also stored as files.

No FTP required:
I use Mountee to mount my ExperssionEngine Templates on my desktop and edit them as files in my favourite editing app. no FTP required. And better than working in the Browser. Multiple undos as an added bonus. And easy duplicate them in case you wish to roll back to zero.


…. texted postive

Offline

#100 2018-03-18 10:46:37

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

Re: Feedback to: Textpattern CMS 4.7.0 beta released

bici wrote #310099:

Multiple undos as an added bonus. And easy duplicate them in case you wish to roll back to zero.

Not wishing to dismiss your arguments for using an external editor – they’re all valid, plus you get versioning for free. Just to mention that in 4.7.0 we have the CTRL-S shortcut across the board. Saving templates and stylesheets also performs an AJAX save (permitting undo as long as you haven’t closed the tab) and the same intelligent template duplication feature from 4.6.x that allows you to rename/change a template and then click Duplicate to have it copied and saved in one move.


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

#101 2018-03-18 10:47:00

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

Re: Feedback to: Textpattern CMS 4.7.0 beta released

bici wrote #310099:

Multiple undos as an added bonus. And easy duplicate them in case you wish to roll back to zero.

Not wishing to dismiss your arguments for using an external editor – they’re all valid, plus you get versioning for free. Just to mention that in 4.7.0 we have the CTRL-S shortcut across the board. Saving templates and stylesheets also performs an AJAX save (permitting undo as long as you haven’t closed the tab) and the same intelligent template duplication feature from 4.6.x that allows you to rename/change a template and then click Duplicate to have it copied and saved in one move.


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

#102 2018-03-18 11:20:34

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

Re: Feedback to: Textpattern CMS 4.7.0 beta released

bici wrote #310099:

No FTP required:
I use Mountee to mount my ExperssionEngine Templates on my desktop and edit them as files in my favourite editing app. no FTP required. And better than working in the Browser. Multiple undos as an added bonus. And easy duplicate them in case you wish to roll back to zero.

Yeah, thats a neat way to do it. You can get the same deal if you have Transmit FTP client on a mac, because it allows you to mount a remote location as if it was a drive on your computer. You can also do it via dropbox if you install it on your sever, which means you can sync a local folder up to your web root.

Personally I don’t like to do it this way. I use a framework I wrote called Slate that contains a bash script that deploys/pulls via rSync triggered via NPM scripts. This is awesome because it only transfers the files that have changed. It’s also superfast because the files get compressed on the way up and unpacked at the other end.

Nobody should be using FTP anyway these days, its incredibly insecure (your connection details are sent in plain text. bring on the hacking.). Use SFTP if you must.

Last edited by CodeWalker (2018-03-18 11:35:07)

Offline

#103 2018-03-18 19:15:00

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,091
Website Mastodon

Re: Feedback to: Textpattern CMS 4.7.0 beta released

Transmit allows you to mount the file space of the server. But “Mountee communicates directly with your MySQL database, so you don’t have to worry about keeping files in sync”.

There is a settings in EE to save your templates as files:
Save Templates as Files
When set to yes, ExpressionEngine will store your templates as files on your server.

But i don’t, and simply use Mountee to access my templates on my desktop.

Once I have edited and saved changes, by unmounting Mountee, the DB is repopulated with the changed templates .


…. texted postive

Offline

#104 2018-03-18 19:57:46

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,091
Website Mastodon

Re: Feedback to: Textpattern CMS 4.7.0 beta released

using Transmit i am getting this error message in loading the Install folder to my server:

*Could not upload “textpattern.js” *
The symlink “textpattern.js” could not be transferred because following symlinks is not supported.

but the file “textpattern.js” does get uploaded


…. texted postive

Offline

#105 2018-03-18 22:18:15

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,091
Website Mastodon

Re: Feedback to: Textpattern CMS 4.7.0 beta released

Bloke wrote #310102:

Not wishing to dismiss your arguments for using an external editor – they’re all valid, plus you get versioning for free. Just to mention that in 4.7.0 we have the CTRL-S shortcut across the board. Saving templates and stylesheets also performs an AJAX save (permitting undo as long as you haven’t closed the tab) and the same intelligent template duplication feature from 4.6.x that allows you to rename/change a template and then click Duplicate to have it copied and saved in one move.

thanks – i was not aware of the CTRL-S shortcut. will certainly explore the options.

I highlighted the Mountee app as i think it is simply brilliant. and i am hoping it could be extended to TxP.


…. texted postive

Offline

#106 2018-03-18 22:55:33

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

Re: Feedback to: Textpattern CMS 4.7.0 beta released

CodeWalker wrote #310104:

Yeah, thats a neat way to do it. You can get the same deal if you have Transmit FTP client on a mac, because it allows you to mount a remote location as if it was a drive on your computer.

There’s also Expandrive (Mac + PC), Mountain Duck and I think Forklift that will do that too (on the Mac). rah_flat used to import files on every page load when in debug mode, so you had a similar effect to Mountee (I imagine).

Personally I don’t like to do it this way. I use a framework I wrote called Slate that contains a bash script that deploys/pulls via rSync triggered via NPM scripts. This is awesome because it only transfers the files that have changed. It’s also superfast because the files get compressed on the way up and unpacked at the other end.

Cool. You have it really worked out there. Do you have an overall overview of the sass framework somewhere in your extensive docs? I couldn’t see it in my first cursory glance.

I’ve been using beam which is similar in principle (rsync, simulated run, live/staging etc.). It can also trigger a post-update webhook, for example to pull files into the database (which rah_flat did). The main difference is that it works in conjuction with a git repository.

bici wrote #310113:

using Transmit i am getting this error message in loading the Install folder to my server:

*Could not upload “textpattern.js” *
The symlink “textpattern.js” could not be transferred because following symlinks is not supported.

but the file “textpattern.js” does get uploaded

That will be because the FTP protocol doesn’t support transferring symlinks. You need SSH for that. Probably it simply resolved the symlink as the target file (textpattern.js) and then uploaded that.

I guess you’re working with a multi-site setup, then, as symlinks aren’t needed otherwise? If not, you can remove the /sites folder and those errors won’t occur.


TXP Builders – finely-crafted code, design and txp

Offline

#107 2018-03-18 23:13:36

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,091
Website Mastodon

Re: Feedback to: Textpattern CMS 4.7.0 beta released

jakob wrote #310119:

I guess you’re working with a multi-site setup, then, as symlinks aren’t needed otherwise? If not, you can remove the /sites folder and those errors won’t occur.

nope. so in future I will indeed remove the /sites folder!


…. texted postive

Offline

#108 2018-03-18 23:32:17

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

Re: Feedback to: Textpattern CMS 4.7.0 beta released

jakob wrote #310119:

Cool. You have it really worked out there. Do you have an overall overview of the sass framework somewhere in your extensive docs? I couldn’t see it in my first cursory glance.

I’ve been using beam which is similar in principle (rsync, simulated run, live/staging etc.).

Thanks. It took me 10 years to build and the best part of a year to document. Im quite proud of it. I’ve used on around 300 sites, and, if I say so myself, it’s pretty sweet. :)

I’m not sure I get what you mean. If you go digging /node_modules/slatecore/sassdoc and run the html file thats in there you’ll get a complete, searchable, documented list of all mixins, variables and functions. I haven’t quite finished double checking it for accuracy yet, but I will fairly soon be putting that page on a subdomain and linking to it from the documentation site.

Thanks for the tip on Beam, it looks useful.

Last edited by CodeWalker (2018-03-18 23:36:11)

Offline

Board footer

Powered by FluxBB