Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

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

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: 345
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,473

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: 3,058
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)


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

Offline

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

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

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: 11,250
Website GitHub

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: 60

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

#140 2020-01-22 23:05:15

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

Re: smd_wrap: conditionally wrap stuff with tags and labels

v0.3.0 is officially released (finally). Changes:

  • Register tags.
  • Add multi-byte support (Thanks, summer).
  • Use more intelligent title case transform (Thanks, Kroc Camen).
  • Silence has_data warning.

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

#141 2020-01-23 07:37:12

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: smd_wrap: conditionally wrap stuff with tags and labels

Excellent! Even though some of its functionality is now available through the escape attribute, it is still a supremely useful plugin.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB