Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-08-19 17:33:41

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

[textile] Style using custom field

I’m trying to do the following in an article.

%{background-color:<txp:custom_field name='custom1' escape=''/>}different color%

but I get

<span style="background-color:#adf349;"&gt;different color</span>

Is it possible to use a custom field within textile in this way?


My Plugins

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

Offline

#2 2009-08-19 18:56:13

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,303

Re: [textile] Style using custom field

MattD wrote:

Is it possible to use a custom field within textile in this way?

I don’t think so: When you look at the mySQL-table “textpattern” with its two versions of the body contents, there’s textile already transformed to HTML in the “Body_html” field, though txp tags remain unchanged in any of the body fields.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2009-08-19 19:43:43

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

Re: [textile] Style using custom field

Matt, just out of curiosity: what would be the advantage of typing <txp:custom_field name='custom1' escape='' /> in an article, compared to typing #adf349 (even if you have to type it twice if you need it in the custom field as well)?

Offline

#4 2009-08-19 20:48:30

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

Re: [textile] Style using custom field

I was looking into a solution to a question from candyman who wanted to use my colorpicker plugin to highlight text.
I ended up suggesting a different solution which only requires a span with a class.


My Plugins

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

Offline

#5 2009-08-19 21:58:34

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

Re: [textile] Style using custom field

Ah I see. Thanks, I just couldn’t think of a reason why someone would want to do this, but you’ve found one :)

Offline

#6 2009-08-19 22:07:57

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

Re: [textile] Style using custom field

Els wrote:

Ah I see. Thanks, I just couldn’t think of a reason why someone would want to do this, but you’ve found one :)

I think he wanted it to be automated but I haven’t gotten that far. It would be easier to update the custom field in an automated fashion than it would the small portion of text in the body or excerpt. If there was a way to get textile to understand the above I might persue a automated way of doing it such as rah_textile_bar or some other plugin.


My Plugins

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

Offline

Board footer

Powered by FluxBB