Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-12-22 22:05:16

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

Hello Themes!

After much work, primarily by our very own NicolasGraph who has done so much to push forward the concept of flat-file editing in his plugin oui_flat, we are proud to announce that the ability to apply Themes in Textpattern is a reality.

We’re still going to be tinkering a little under the hood over the coming weeks to optimise it, finalise the callbacks and get the language strings in place, but from a workflow perspective this is our first stake-in-the-ground towards a brighter future for the platform. We’ll expand on this groundwork in future releases.

If anyone fancies taking it for a test drive, feel free to grab the repo or try the development demo when it’s synced in a few hours.

I’ll write some in-depth blog posts about it very soon to introduce the concepts of what it is and, more importantly, what it isn’t (yet). Full documentation will follow closer to release.

We hope you like this Christmas present. Sorry it’s taken 12 years to add the feature :-)


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

#2 2017-12-23 07:56:00

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

Re: Hello Themes!

Bloke wrote #308405:

After much work, primarily by our very own NicolasGraph who has done so much to push forward the concept of flat-file editing in his plugin oui_flat, we are proud to announce that the ability to apply Themes in Textpattern is a reality.

We hope you like this Christmas present. Sorry it’s taken 12 years to add the feature :-)

The 12 years of Textpattern Christmas


…. texted postive

Offline

#3 2017-12-23 08:34:34

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: Hello Themes!

Nicolas and devs, thank you for all this great work!
Very good Christmas to all and a great new year!

I try the export function on my default theme, and I get this warning or error message.
Indeed, in themes \ default, there are a lot missing pages, forms, styles …

Why name unsafe while most of my names are built on the same structure: 2007_v3 _….

skin_exported: default
page_name_unsafe: (default) 2017_v3_main, loadimagesFROALA
form_name_unsafe: (default) 2017_v3_tags_list, 2017_v3_article_image_galerie, 2017_v3_table_sort_liste_album, 2017_v3_piwik, 2017_v3_image_random, 2017_v3_modal_script, 2017_v3_recherche_form, 2017_v3_search_results, 2017_v3_google_analytics, 2017_v3_video, 2017_v3_body_class, 2017_v3_contenu_agenda, 2017_v3_menu_accordeon, 2017_v3_album_flickr, 2017_v3_contenu_error404, 2017_v3_agenda, 2017_v3_contenu_accueil, 2017_v3_js_script, 2017_v3_article_image_hero, 2017_v3_header_ban_menu, 2017_v3_head, 2017_v3_footer, 2017_v3_menu_secondaire_agenda, 2017_v3_contenu_article_seul, 2017_v3_contenu, 2017_v3_VIDE, 2017_v3_contenu_recherche, 2017_v3_menu_secondaire_copy, 2017_v3_sections, 2017_v3_menu_secondaire, 2017_v3_contenu_liste_par_tag, 2017_v3_contenu_newsletter_2, 2017_v3_contenu_newsletter_3, 2017_v3_contenu_newsletter
css_name_unsafe: (default) 2017_v3_default

Offline

#4 2017-12-23 09:04:24

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,058
Website

Re: Hello Themes!

1. Congrats to Nicolas for bringing this about!

2. Are there any reason why one can’t export pages and forms that contain capitalised letters (same warning as jpdupont above)
Examples: a camelCase name page: downloadSection or a form: image_SVG.

Similar named pages/forms did import correctly a few days ago. I don’t remember running into this while exporting while testing the branch (but I maybe the test I ran had all lowercase names, not sure).

Last edited by phiw13 (2017-12-23 09:06:31)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#5 2017-12-23 10:35:08

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

Re: Hello Themes!

Sorry for my French:
“Bravo Nicolas ! Trop bien.” ?

Just an advice:
Be careful with the default checked “Remove extra templates” box. With a previous version (unstable, not this one), I lost all my work (forms) within my theme development when I tried to export it…


Patrick.

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

Offline

#6 2017-12-23 16:43:00

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

Re: Hello Themes!

Bloke wrote #308405:

After much work, primarily by our very own NicolasGraph who has done so much to push forward the concept of flat-file editing in his plugin oui_flat, we are proud to announce that the ability to apply Themes in Textpattern is a reality.

A wonderful xmas announcement. Way to go!!!


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

Offline

#7 2017-12-23 17:59:24

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

Re: Hello Themes!

For anyone experiencing the ‘unable to export’ thing with unsafe names, we might have to relax the regex or use sanitizeForFile(). We’re currently restricting it to lower case names only with underscores, hyphens and dots, with numbers permitted anywhere except the first character (which is why jpdupont’s 2017_* names are rejected).

We had a discussion about it a while ago, but at the moment the regex appears to be lopsided: it’ll allow import of mixed case assets but not export. That should probably be tweaked so it’s symmetrical.

In retrospect, I can’t see any reason to forbid upper case characters, given that we permit them when saving in the UI. If we were making Txp class or function names out of the names, then we would have to forbid numbers in the first character, but I don’t think any file system has this restriction, so we should be okay to lift this.

Ideally we should permit camelCase and snake_case and numbers in any position, and any combinations thereof. But anything with any other characters that might potentially break a file system should be outlawed at export/import.

Maybe Nicolas found some corner cases that meant there was a very good reason to restrict this to the current filter. If not, I suggest we widen the pattern a little and also add the warning on save of any asset if the name doesn’t conform, so that people know it’s okay to use internally but if you try to export it, it’ll fail.

At the moment, when saving an asset in the UI, we only forbid < > & " ' characters. I think we should continue this (for backwards compatibility) but also perform a secondary check to see if it’s likely to fail an export too. And in that case, issue a warning on save.


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

#8 2017-12-23 18:08:19

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

Re: Hello Themes!

As a stop-gap, I’ve just widened the permitted regex to this:

[a-zA-Z0-9_\-\.]{0,63}

so all the above assets should now be imported/exported correctly.

We’ll look into warning when saving Pages/Forms/Styles in case you use something outside the permitted range at some point soon.

Last edited by Bloke (2017-12-23 18:09:38)


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

#9 2017-12-23 19:04:48

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

Re: Hello Themes!


…. texted postive

Offline

#10 2017-12-23 19:17:58

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

Re: Hello Themes!

Bloke wrote #308405:

Sorry it’s taken 12 years to add the feature :-)

Technically, it is 13. But who’s counting?

One thing I was hoping to get in for this release, but it’s not quite there yet, is a themes engine I’ve been working on: this allows simultaneous installation of pages, stylesheets and forms through a simple installer much like the one used for plugins. Look for it in an RC or two. – 1.0rc1 Released

Thanks to you and everyone who contributed.

It’ll be ready when someone writes it. Simple as that. – Template Manager

I, for one, am super-excited.

Offline

#11 2017-12-24 00:30:19

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,058
Website

Re: Hello Themes!

Bloke wrote #308417:

In retrospect, I can’t see any reason to forbid upper case characters, given that we permit them when saving in the UI. If we were making Txp class or function names out of the names, then we would have to forbid numbers in the first character, but I don’t think any file system has this restriction, so we should be okay to lift this.

I’m not aware of any file system that has issues with valid UTF8 characters. The only character that macOS disallows in a filename is the column : (it is treated as path separator internally). I think some UNIX variants had the same restriction. Not sure about Windows OS.

At the moment, when saving an asset in the UI, we only forbid < > & " ' characters. I think we should continue this (for backwards compatibility) but also perform a secondary check to see if it’s likely to fail an export too. And in that case, issue a warning on save.

Yes, warning people about the issue when saving an asset will probably be a good thing – form names written with CJK characters or emoji?

Your new regex works fine for me now. Assets with an uppercase character or starting with a digit export correctly.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#12 2017-12-24 03:52:29

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,058
Website

Re: Hello Themes!

A minor issue I encountered, after messing a little with form names (CJK characters, :,…), and then deleting those forms.

From the Themes panel, select the theme and using the multi-edit widget, chose “duplicate”.

Warning "Invalid argument supplied for foreach()"
in /Users/username/Sites/_txp472/textpattern/vendors/Textpattern/Skin/AssetBase.php at line 347.

The theme duplicated correctly (green message box) and nothing was missing. and yeah, it is a warning.

Note also, duplicating that copy worked perfectly.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

Board footer

Powered by FluxBB