Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#191 2020-10-22 17:38:24

etc
Developer
Registered: 2010-11-11
Posts: 3,989
Website

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

mrdale wrote #326470:

IIRC. Kirby and grav basically throw that kind of information Into specially formatted lines of raw text with prefixes. I’ll update with examples.

Thanks, but if you just need to import a Kirby article into txp, that looks like an import module/plugin for me. Working with text files when, say, filtering by cf, could be expensive.

Offline

#192 2020-10-22 18:38:11

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

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

etc wrote #326508:

Thanks, but if you just need to import a Kirby article into txp, that looks like an import module/plugin for me. Working with text files when, say, filtering by cf, could be expensive.

I’m actually kicking around the idea of a flat file content workflow in txp, not a specific import need. I’m suggesting that such a workflow would speed content creation dramatically at the time of initial site build.

Imagine just throwing a bunch of images, text and other files into directories and having them automatically imported into the database. I’ve built this way with kirby and was blown away by the efficiencies gained. Not wild about some of kirby’s other limitations though.

Offline

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

etc
Developer
Registered: 2010-11-11
Posts: 3,989
Website

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: 9,832
Website

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,212
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: 9,832
Website

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

Board footer

Powered by FluxBB