Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2018-12-21 07:48:19

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,653
Website

Re: Feedback to: Textpattern CMS 4.7.2 Released

colak wrote #315662:

I see. The advanced preferences are only visible if etc_easter_eggs is installed.

No. First disable etc_easter_eggs, then go to Preferences > Admin. At the bottom, enable the Advanced Options pref. After that you have a pref panel for all those.

Also, that , (comma) you mentioned, that is a marker to comment out the line (.csv or .ini)

Offline

#12 2018-12-21 09:46:33

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

Re: Feedback to: Textpattern CMS 4.7.2 Released

colak wrote #315659:

Tell me more!!! :)

You can set the maximum recursive calls depth of Forms and probably the number of parsing passes, but I have not yet found a use for this.

Should that first semicolon be there?

It’s a comment, you can remove this line if you wish, as well as other unused form types. But this preference is not used anyway, uninstalling etc_easter_eggs should delete it.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#13 2018-12-21 10:09:40

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,246
Website

Re: Feedback to: Textpattern CMS 4.7.2 Released

Hmmm, so this is what I get

;[js]
;mediatype="application/javascript"
;title="JavaScript"
[js]
mediatype="application/javascript"
[json]
mediatype="application/json"
[svg]
mediatype="image/svg+xml"
[xml]
mediatype="application/xml"
[txt]
mediatype="text/plain"
[csv]
mediatype="text/csv"
[htm]
mediatype="text/html"
[html]
mediatype="text/html"

there seems to be a minor issue on FF as the text box does not auto-expand nor does it have any scroll bars. It corrected itself after I pressed the return button in the box.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

#14 2018-12-21 10:21:59

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

Re: Feedback to: Textpattern CMS 4.7.2 Released

colak wrote #315667:

Hmmm, so this is what I get

That’s fine, the old preference has been converted to the new format. The first three lines are included as example. You can safely remove them and comment out the types you don’t use. You can also add new Form types as e.g.


[shortcode]
title="Short code"
;mediatype="Hardly needed but you can set it here"

there seems to be a minor issue on FF as the text box does not auto-expand nor does it have any scroll bars. It corrected itself after I pressed the return button in the box.

That’s a third-party script used for textarea auto-resizing, not our fault :-)


etc_[ query | search | pagination | date | tree | cache ]

Offline

#15 2018-12-21 12:30:30

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,256
Website

Re: Feedback to: Textpattern CMS 4.7.2 Released

Thank you Devs for this great version!

I’m sorry Oleg to be so stupid but I can’t figure out how to use this new (and very exciting) new feature…
How to use it, how to access to our ressources (set into this custom field)?

Offline

#16 2018-12-21 13:18:35

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

Re: Feedback to: Textpattern CMS 4.7.2 Released

Pat64 wrote #315670:

how to access to our ressources (set into this custom field)?

No worries, there is much to say about it, the pophelp is probably not detailed enough.

So, suppose you have added js form type with application/javascript mediatype, intended to serve Javascript resources. Now go to Forms tab, create hello.js form of js type and save it, checking Export to disk box:

alert("Hello, world!");

This script will be accessible via two URLs:

  • path/to/site/index.php?f=hello.js will serve the parsed db version
  • path/to/theme/forms/js/hello.js will serve the unparsed flat file version

These URLs are produced by <txp:output_form form="hello.js" format="url" /> and <txp:output_form form="hello.js" format="flat.url" /> respectively.

You also have two ways of including hello.js via <script /> tag in your pages/forms/whatever:

  • <txp:output_form form="hello.js" format="script" /> (db version)
  • <txp:output_form form="hello.js" format="flat.script" /> (flat version)

The example above does not contain txp tags, so serving the flat version is preferable (faster), though not mandatory. But suppose that you need to personalize the script:

<txp:if_individual_article>
    alert("Hello, <txp:title escape />");
<txp:else />
    alert("Hello, <txp:site_name escape />!");
</txp:if_individual_article>

Then you must serve the db version, otherwise txp tags will not be parsed. In this case, you’d better call the form hello (without .js extension) to forbid the direct file access:

<txp:output_form form="hello" format="script" context="id" />

Notice context="id" attribute: it will generate an id-aware URL like ?id=123&f=hello, otherwise <txp:title /> will be undefined. You can use just context without any value to take care of all txp parameters (section, category etc).


etc_[ query | search | pagination | date | tree | cache ]

Offline

#17 2018-12-21 17:35:53

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,256
Website

Re: Feedback to: Textpattern CMS 4.7.2 Released

Okay!

What a good course ;)

I well understood. Thank you lot, Oleg.

Offline

#18 2018-12-22 21:07:56

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,246
Website

Re: Feedback to: Textpattern CMS 4.7.2 Released

I’m testing the latest release and I’m loving it!!! How can we deal with the svg files in forms so as to get valid html?

At the moment <txp:output_form form="image.svg" format="flat.image" /> does not parse an alt tag. I have tried <txp:output_form form="image.svg" format="flat.image" alt="my image" />. The parsing only shows <img src="/themes/mytheme/forms/svg/image.svg" />.

Using html directly is not an issue but it may become one when changing themes. Especially if the svg is in an article.

… Also:) does this update help us to do away with the rah_external plugin?

Last edited by colak (2018-12-22 21:26:23)


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

#19 2018-12-22 21:32:15

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

Re: Feedback to: Textpattern CMS 4.7.2 Released

colak wrote #315689:

I’m testing the latest release and I’m loving it!!! How can we deal with the svg files in forms so as to get valid html?

Like this

<img src="<txp:output_form form="image.svg" format="flat.url" />" alt="alt text" />

or format="url" if the image source contains txp tags.

… Also:) does this update help us to do away with the rah_external plugin?

Yes, jointly with <txp:header /> tag.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#20 2018-12-23 08:11:11

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,246
Website

Re: Feedback to: Textpattern CMS 4.7.2 Released

These are huge improvements!!! I am checking the output_form documentation and it seems that it needs a major update which I am willing to do but what formats does the tag support?


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

Board footer

Powered by FluxBB