Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-12-31 02:47:48

kiplet
Member
Registered: 2006-01-28
Posts: 33

Parsing text in custom fields in 4.0.7

I use a custom field to allow for fancy typographic treatments in my article titles—I use a dumbed-down version in title, and use a custom field to display the pretty version on the website.

In 4.0.5, the custom field handled tags just fine, and displayed the following:

When all the elements of need are satisfied in the situation of want

when I entered this:

When <em>all</em> the elements of need are satisfied in the situation of <em>want</em>

Now, in 4.0.7, the text in my custom title field gets turned to this in the HTML:

When &lt;em&gt;all&lt;/em&gt; the elements of need are satisfied in the situation of &lt;em&gt;want&lt;/em&gt;

Which, of course, rips out all my tags. (I also use spans and carriage returns in the pretty, custom titles.)

How do I tell Textpattern to stop trying to finess my text in a custom field?

Offline

#2 2008-12-31 03:14:06

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

Re: Parsing text in custom fields in 4.0.7

kiplet wrote:

How do I tell Textpattern to stop trying to finess my text in a custom field?

Try adding escape="" to your custom_field tag. The default behaviour changed in 4.0.7.


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

#3 2008-12-31 05:32:11

kiplet
Member
Registered: 2006-01-28
Posts: 33

Re: Parsing text in custom fields in 4.0.7

It would, of course, be something simple. Thanks.

Offline

#4 2009-01-15 22:32:21

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: Parsing text in custom fields in 4.0.7

i’m trying to embed a paypal dropdown form into a custom field. if i don’t use escape=”“, then it obviously can’t read the code. if i do use escape=”“ it starts to do weird things, one of them being it snips off the majority of the embed code. the other is it begins to mess with the overall page. any ideas?

Offline

#5 2009-01-15 23:04:48

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Parsing text in custom fields in 4.0.7

custom fields are limited to 255 chars… and it should be escape="0"

Offline

#6 2009-01-15 23:06:19

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: Parsing text in custom fields in 4.0.7

ruud wrote:

custom fields are limited to 255 chars… and it should be escape="0"

tried escape="0" too. do i have to modify the txp_article.php to pull this off? i can’t think of any other way to embed paypal code on the fly short of using custom fields.

Offline

#7 2009-01-15 23:15:59

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Parsing text in custom fields in 4.0.7

Could you just put a flag or some of the parameters needed for the button in the custom field that your page or form would check and conditionally add the paypal button?

Something like…

<txp:if_custom_field name="paypalitem">
<Code_for_button item='<txp:custom_field name="paypalitem"/>' />
</txp:if_custom_field>

Last edited by MattD (2009-01-15 23:16:18)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#8 2009-01-15 23:52:34

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: Parsing text in custom fields in 4.0.7

MattD wrote:

Could you just put a flag or some of the parameters needed for the button in the custom field that your page or form would check and conditionally add the paypal button?
Something like…
bc..
<txp:if_custom_field name=“paypalitem”>
<Code_for_button item=’<txp:custom_field name=“paypalitem”/>’ />
</txp:if_custom_field>

well that could get really confusing cause some of them are basic buttons, and others are dropdown options (size S,M,L)

Offline

#9 2009-01-15 23:54:34

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Parsing text in custom fields in 4.0.7

I’ve never used it but have you looked at yab_shop


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#10 2009-01-16 00:07:18

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: Parsing text in custom fields in 4.0.7

MattD wrote:

I’ve never used it but have you looked at yab_shop

ha yeah i was just looking at that earlier. looks nice, but it’d be a bit of a stretch considering my only problem right now is a 255 character limit

i’d be opening a whole can of worms with a full out shopping cart :)

Offline

#11 2009-01-16 01:52:06

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Parsing text in custom fields in 4.0.7

I think it’s possible now to change the character limit of the field (in phpMyAdmin). I’m just not sure which mySQL version you need to be able to do that, you’d have to check.

Offline

#12 2009-01-20 04:27:44

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: Parsing text in custom fields in 4.0.7

what i’m settling on is no custom fields. i think hak-tinymce was throwing me off. it’s a nice plugin, but it gets in the way of embedding anything. so now we’re going to just embed the paypal code write into the article, with a div around it.

Offline

Board footer

Powered by FluxBB