Textpattern CMS support forum

You are not logged in. Register | Login | Help

#131 2015-10-30 01:20:45

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,399

Re: smd_wrap: conditionally wrap stuff with tags and labels

In a experiment on one of my real site that worked with your examples:

<txp:smd_wrap transform='replace|regex|/&quot;/|", textile, replace|regex|"<\/?p>"|'><txp:custom_field name="lien" /></txp:smd_wrap>

Last edited by GugUser (2015-10-30 01:21:11)

Offline

#132 2015-10-30 07:29:44

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

Re: smd_wrap: conditionally wrap stuff with tags and labels

CeBe wrote #296315:

I have the same problem with a simple custom field named lien which contains "$":link.php:

<txp:smd_wrap transform="textile"><txp:custom_field name="lien" /></txp:smd_wrap>...

outputs

&quot;$&quot;:link.php...

Have you tried not to escape the value?

<txp:smd_wrap transform="textile"><txp:custom_field name="lien" escape="0" /></txp:smd_wrap>

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

Offline

#133 2015-10-30 07:58:16

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,566
Website

Re: smd_wrap: conditionally wrap stuff with tags and labels

CeBe wrote #296315:

a simple custom field named lien which contains "$":link.php:

Untested, but have you tried using <txp:custom_field escape="" />?

Edit; didn’t spot etc’s reply, sorry.


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

#134 2015-10-30 09:07:33

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 344
Website

Re: smd_wrap: conditionally wrap stuff with tags and labels

etc wrote #296326:

Have you tried not to escape the value?

Bloke wrote #296327:

Untested, but have you tried using <txp:custom_field escape="" />?

Ahem…
It’s Ok with escape="" or escape="0".
Thanks to both of you.

Offline

#135 2016-07-30 03:42:20

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,399

Re: smd_wrap: conditionally wrap stuff with tags and labels

When the plugin processes Textile in a custom field, it doesn’t recognize (or Textile doesn’t recognize in this context) doctype html5 and parse acronym instead of abbr.

Textpattern 4.6 beta 2.

Offline

#136 2016-12-05 08:50:42

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

Re: smd_wrap: conditionally wrap stuff with tags and labels

With TXP 4.6.2 and TXP 4.7dev when I try the following, where the image caption contains a link, the link is not linkified (parsed by textile). Other inline markup seems to work fine.

<txp:smd_wrap transform="textile,replace|regex|'<\/?p>'|" wraptag=""><txp:image_info type="caption" /></txp:smd_wrap>

caption text: foo, bar, "link":http://example.com/ - *bold*

PS – register tag warning in debug mode…

Last edited by phiw13 (2016-12-05 08:51:20)

Offline

#137 2018-04-24 04:29:58

Summer
Member
Registered: 2018-01-29
Posts: 48

Re: smd_wrap: conditionally wrap stuff with tags and labels

<txp:smd_wrap_all transform="strip_tags, cut|19|+++">
<txp:title />
</txp:smd_wrap_all>
When the content is displayed in Chinese, the last word cannot be identified.
example:
text测试测试测+++is normal.
测试测试测试+++does not recognize the last word.

emm….Unrecognized words are not shown here.

Last edited by Summer (2018-04-24 04:45:44)

Offline

#138 2018-04-24 09:08:20

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,566
Website

Re: smd_wrap: conditionally wrap stuff with tags and labels

Summer wrote #311349:

When the content is displayed in Chinese, the last word cannot be identified.

Hmmm, that’s probably because the transform isn’t multibyte safe. It’s very primitive. I’ll see if anything can be done about it.


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

#139 2018-04-27 02:39:40

Summer
Member
Registered: 2018-01-29
Posts: 48

Re: smd_wrap: conditionally wrap stuff with tags and labels

Bloke wrote #311356:

Hmmm, that’s probably because the transform isn’t multibyte safe. It’s very primitive. I’ll see if anything can be done about it.

Change substr () to mb_substr (), the string can be displayed normally… At least for now…

Offline

Board footer

Powered by FluxBB