Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

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

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).

Offline

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

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

Re: Feedback to: Textpattern CMS 4.7.2 Released

Okay!

What a good course ;)

I well understood. Thank you lot, Oleg.


Patrick.

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

Offline

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

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

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 | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

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

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

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.

Offline

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

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

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 | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#21 2018-12-23 09:41:07

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

Re: Feedback to: Textpattern CMS 4.7.2 Released

colak wrote #315692:

These are huge improvements!!!

Agreed! ?

but what formats does the tag support?

The code showing the options and sub-options is here.


TXP Builders – finely-crafted code, design and txp

Offline

#22 2018-12-23 19:21:17

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

Re: Feedback to: Textpattern CMS 4.7.2 Released

I added the attributes and I will add some examples tomorrow. What confuses me now is the options for context. I know id is one of them but I’m at loss about what else it could be except maybe what is listed here?


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

Offline

#23 2018-12-24 00:34:26

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

Re: Feedback to: Textpattern CMS 4.7.2 Released

colak wrote #315703:

I added the attributes and I will add some examples tomorrow. What confuses me now is the options for context. I know id is one of them but I’m at loss about what else it could be except maybe what is listed here?

Many thanks, Yiannis. The purpose of context attribute is to preserve txp and other context (article id, section, category, etc) in “external” resources. It is only relevant for db (not flat) served forms. The standard values are id, s, c, context, q, m, pg, p, month, author, but one can add other URL parameters if needed. For example,

<txp:output_form form="test" format="url" context="s, c" />

will generate (in messy mode) index.php?c=cat&f=test when called from index.php?c=cat&pg=2 URL, those populating <txp:category /> tag inside test form.

Offline

#24 2018-12-24 14:01:12

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

Re: Feedback to: Textpattern CMS 4.7.2 Released

…And can be useful to serve some front end AJAX process. Am I wrong, Oleg?


Patrick.

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

Offline

#25 2018-12-24 17:52:46

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

Re: Feedback to: Textpattern CMS 4.7.2 Released

Just to confirm. :) With this release we no longer need:

  • rvm_css
  • spf_js
  • rah_external_output
  • smd_if

Any other plugin to delete? I’m just looking forward to be just using a vanilla install!


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

Offline

#26 2018-12-24 21:43:22

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

Re: Feedback to: Textpattern CMS 4.7.2 Released

I cleaned the chimney, hung up the mistletoe, warmed up the mulled wine, and last but not least updated to 4.7.2.

Merry Christmas and happy holidays everyone


…. texted postive

Offline

#27 2018-12-24 22:04:29

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

Re: Feedback to: Textpattern CMS 4.7.2 Released

Wonder if i had too much mulled spirits:

URL: https://somesiteorother.com/textpattern/index.php?logout=1
“I’m sorry. I’m afraid I can’t do that; logout is an unsafe operation.”

4.7.2. doesn’t want to let me logout.

At least TxP didn’t say “i’m sorry Dave, I’m afraid I can’t do that”

Last edited by bici (2018-12-24 22:07:16)


…. texted postive

Offline

#28 2018-12-25 11:14:23

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

Re: Feedback to: Textpattern CMS 4.7.2 Released

Hi Bici and seasons greetings

Temporarily you can of course logout by opening a private window on another browser and login from there. On quitting the other browser you should be logged out from both. Having said that, I hope that the login will not have the same issues…. Dave.

ps. Do panic if your computer starts singing Daisy.

Last edited by colak (2018-12-25 11:20:02)


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

Offline

#29 2018-12-25 11:18:55

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

Re: Feedback to: Textpattern CMS 4.7.2 Released

Logging out this way was kind of security violation. But why would you log out from outside txp?

Offline

#30 2018-12-25 11:21:35

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

Re: Feedback to: Textpattern CMS 4.7.2 Released

etc wrote #315721:

Logging out this way was kind of security violation. But why would you log out from outside txp?

Hi Oleg, and seasons greetings for you too:)

I would not but Bici might need to.


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

Offline

Board footer

Powered by FluxBB