Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#136 2018-09-09 06:38:47

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

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

I put all the 4.7.1 files on the server: same problem.

This makes me think that we should trim the final page output before serving it. I don’t see why anyone would need to start his pages with a space or a linebreak. Edit: done.

But I uploaded the latest version 4.7.2 with the latest Oleg commits: same problem
I also changed the theme, returning to Hive: always the same thing.
Every time I emptied the cache of FFox and reloaded the pages.

Offline

#137 2018-09-09 06:46:01

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,637
Website

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

jpdupont wrote #313937:

I put all the 4.7.1 files on the server: same problem.

But I uploaded the latest version 4.7.2 with the latest Oleg commits: same problem
I also changed the theme, returning to Hive: always the same thing.
Every time I emptied the cache of FFox and reloaded the pages.

Weird. On my various installs, locally or live servers, there is no white-space character before the <!doctype…> on the admin side (or the front-end). Have you tried disabling plugins to see if that changes anything? (and you did check ‘view source’, right?)


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

Offline

#138 2018-09-09 06:54:45

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

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

Yes, I check view source.

I just put the site in work mode and i try now to disable the plugins.

Offline

#139 2018-09-09 07:22:17

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

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

That’s it, I found the culprit!

It’s the mck_snippet plugin that I liked to use to store texts that should not be mixed with articles.

Something that is missing in Textpattern, and that could find its place next to other “media”: files, images, links …
I’m going to do without it, and he goes to the trash …

Offline

#140 2018-09-09 07:26:22

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,637
Website

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

jpdupont wrote #313940:

That’s it, I found the culprit!

Great! One step closer to nirvana.


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

Offline

#141 2018-09-09 09:35:15

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

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

etc wrote #313933:

Hi Patrick, no offense intended, that just was the only plugin in Yiannis list that alters the page output, hence an easy suspect, sorry. Also, from what I’ve understood, you need to put it at the very beginning, so an eventual linebreak after it invalidates XML.

This makes me think that we should trim the final page output before serving it. I don’t see why anyone would need to start his pages with a space or a linebreak. Edit: done.

Sure ;)

Thanks lot for the commit: as always you make great things for TXP!


Patrick.

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

Offline

#142 2018-10-08 15:45:39

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

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

Custom (flat) assets management is slowly taking shape in 4.7.2. One can edit and use site components (js, css etc) as forms, defining their mimetype via a pref (currently in Advanced options section). This custom_form_types pref (in ini format) allows also for custom form types definition. Example:

[js]
mimetype="application/javascript"
[shortcode]
*="Short code"
es="Etiqueta corta"

will add js and shortcode to available form types.

As a consequence, easter eggs plugin is not needed anymore for these tasks.

Offline

#143 2018-10-08 17:56:53

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

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

etc wrote #314476:

… As a consequence, easter eggs plugin is not needed anymore for these tasks.

? Wonderful news!!! ?


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

Offline

#144 2018-10-09 15:14:42

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,440
Website GitHub

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

etc wrote #314476:
[shortcode]
*="Short code"
es="Etiqueta corta"

I know the syntax has changed today but just on an i18n note, are we forcing people to specify language translations in this pref or can they be picked up via `gTxt()` somehow, perhaps via a well-known prefix? Just thinking it’d be easier for plugins/themes to add lang strings than cleanly merge their custom type definitions into the pref (unless there’s a companion API call to do it for them without duplicating existing mime types that may have been defined by hand?)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Online

#145 2018-10-09 22:06:39

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

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

Bloke wrote #314499:

Just thinking it’d be easier for plugins/themes to add lang strings than cleanly merge their custom type definitions into the pref

I totally agree there should be a better way to manage strings, ideas welcome. But why a plugin/theme would add a custom type, which are intended only for easier classification? And custom mimetypes normally do not require translation…

Offline

#146 2018-10-19 20:45:48

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,192
Website GitHub

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

etc wrote #314476:

Custom (flat) assets management is slowly taking shape in 4.7.2. One can edit and use site components (js, css etc) as forms, defining their mimetype via a pref (currently in Advanced options section). This custom_form_types pref (in ini format) allows also for custom form types definition. … As a consequence, easter eggs plugin is not needed anymore for these tasks.

Just trying out 4.7.2 and I like what I see :-)

I’d just like to verify, we (currently) only see these new custom form types if we:

  • First, add the [formtype] to the list of allowed ‘custom_form_types’ pref in Admin › Preferences › Advanced Options (where necessary with mimetype details), AND
  • Create a forms/formtype folder in our theme saved on the server and put our form in it, AND
  • Avoid name clashes with other forms (regardless of form type) AND
  • Import the theme to the database

But we can choose any name we like (except for already reserved names).

Also, I already see the form types Category and Section. Are they new, or have I just never seen them in the past?


TXP Builders – finely-crafted code, design and txp

Offline

#147 2018-10-19 23:09:14

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

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

jakob wrote #314657:

we (currently) only see these new custom form types if we:

  • First, add the [formtype] to the list of allowed ‘custom_form_types’ pref in Admin › Preferences › Advanced Options (where necessary with mimetype details), AND
  • Create a forms/formtype folder in our theme saved on the server and put our form in it, AND
  • Avoid name clashes with other forms (regardless of form type) AND
  • Import the theme to the database

But we can choose any name we like (except for already reserved names).

Yes, though the last point is only needed when you develop “flat” forms (on the disk). The second and the third points work as before.

There are some subtleties when you export a MIME-typed form to the disk. Say, you have added js form type with application/javascript MIME type. Then you create two js-type forms: test.js and test_js and export them.

  • test.js will be saved as is, so you can access it as flat file.
  • test_js will be saved with .txp extension (test_js.txp) and forbidden for direct access via .htaccess.

Hence, you should save and serve static forms as flat files with extension, and those that contain txp tags without extension, to avoid exposing them to the world. <txp:output_form form="test.js" format="flat.url" /> and <txp:output_form form="test_js" format="url" /> provide their URLs.

Also, I already see the form types Category and Section. Are they new, or have I just never seen them in the past?

I don’t know when they have been introduced, must be 4.6.

Offline

#148 2018-10-20 06:37:56

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 327
Website GitHub GitLab Mastodon Twitter

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

forbidden for direct access via .htaccess

Modern HTTP servers, such as NginX, Hiawatha do not need .htaccess — is there some more generic, standards-compliant method?

Offline

#149 2018-10-20 09:37:05

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

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

Vienuolis wrote #314659:

Modern HTTP servers, such as NginX, Hiawatha do not need .htaccess — is there some more generic, standards-compliant method?

Servers configuration is not my cup of tea, NginX even less. I guess you’d need to forbid the direct access to .txp files, and Pete @gaekwad should know how :-)

Offline

#150 2018-10-20 09:47:22

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 327
Website GitHub GitLab Mastodon Twitter

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

.htaccess rule conversion is not a big problem for me personally. I mean we should avoid dependence from Apache and other non-standard rules, at least in documentation.

Offline

Board footer

Powered by FluxBB