Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#193 2020-10-22 19:28:47

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

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

mrdale wrote #326510:

Imagine just throwing a bunch of images, text and other files into directories and having them automatically imported into the database.

Sure, there is matter to think about. We already have (?) functions to import content from the fs, but the file format (XML?) roughly mimics the db structure, which may not suit every user. It shouldn’t be very difficult to add images/files to the article package and import the whole lot. I’m not very hot about automation, but some ‘import from disk’ functionality looks feasible. Conventions needed.

Offline

#194 2020-10-22 20:39:29

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

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

mrdale wrote #326510:

Imagine just throwing a bunch of images, text and other files into directories and having them automatically imported into the database.

That’s still the plan, albeit ‘throwing’ is slightly more structured :) When building Txp from scratch/automation, you can already do this for pretty much everything except images and files. Look in your /textpattern/setup/data and /textpattern/vendors/DB/data directories for examples of how to structure the XML files.

Once we figure out how to handle IDs/duplicates, it ought to be possible to bring images and files along for the ride by sticking them in directories and supplying the file/image metadata and article_image mappings. Bonus points for reading metadata from the content itself.

Between the XML files and the /themes directory, you can pretty much bootstrap an entire Txp from the command line. That’s what the demo server does, pretty much (with a little jiggery pokery magic added for images/files).

Last edited by Bloke (2020-10-22 20:40:48)


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

#195 2020-10-22 23:21:37

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

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

Bloke wrote #326513:

That’s still the plan, albeit ‘throwing’ is slightly more structured :)

Gotta say TXP is light years cooler than it was just a few years back. kudos dev team.

So if I understand correctly, the setup script goes and grabs these flat file items and throws them in the db, but is only invoked when you first install TXP.

At some point a plugin could basically trigger an import constantly as things change in the file system and pages are accessed on the site. And when items are added via the Admin layer files could write to these directories.

How is my thinking here?

Offline

#196 2020-10-22 23:41:40

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

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

mrdale wrote #326515:

the setup script goes and grabs these flat file items and throws them in the db, but is only invoked when you first install TXP.

Correct.

At some point a plugin could basically trigger an import constantly as things change in the file system and pages are accessed on the site.

Yes. As long as the content is in XML format and the plugin handled update vs insert (upsert) correctly, it’s game on.

And when items are added via the Admin layer files could write to these directories.

Nothing to stop it doing that too. The XML format is pretty standard. It’s just an XML-equivalent structure of the database tables. Link tables might be fun. But we don’t have (m)any of those… yet.

The trick – and the reason we stopped short of doing it in core for themes at least – is how to reliably determine what is “newer”.


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

#197 2022-12-15 07:46:04

Pemischl
Member
From: Vienna, Austria
Registered: 2012-01-14
Posts: 22
Website

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

I am using etc_flat to develop a theme on a live server (easier for customer feedback, editing with vscode via ssh, using git for version controll -> very nice and usefull combination).

It worked flawless, but suddenly etc_flat started throwing error messages. The page itself renders correctly. Since then I have tried updating db from disk, exporting db to disk, but I still have no idea to get rid of the error messages.

Here is a link to a screenshot of my page

I think etc_flat look for form in each category (article/comments/links/files etc.) and logs the error message, if it is not there.

Is this a bug or am I doing something wrong?

Offline

#198 2022-12-15 08:10:38

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

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

I guess you (or your host) have upgraded php version, so previously silenced missing forms warnings are not any more.

I have updated the plugin code, please test.

Offline

#199 2022-12-15 10:03:44

Pemischl
Member
From: Vienna, Austria
Registered: 2012-01-14
Posts: 22
Website

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

Wow, thank you for this quick response.
I have installed the updated version: it works and the error message have disappeared. 🙌
Thank you!

Offline

Board footer

Powered by FluxBB