Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-01-11 04:22:34

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

[textile] Textile and TXP variables

As Textile is currently being enhanced … how about the ability to drop in TXP variables without having to use the TXP variable tag?

I often use variables in articles. For example:

The rate is <txp:variable name="weekly_rate" /> per person per week.

So something like this would be great:

The rate is [[weekly_rate]] per person per week.

- where [[ ]] is some invented markup

Offline

#2 2011-01-11 11:13:56

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: [textile] Textile and TXP variables

That’s a Txp-specific request, so really doesn’t belong in Textile proper. You might consider making a Txp plugin for this, along the lines suggested by Steve in response to my not dissimilar request.


Code is topiary

Offline

#3 2011-01-11 11:47:08

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: [textile] Textile and TXP variables

Fair enough, thanks Jeff.

Offline

#4 2011-01-11 11:52:46

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: [textile] Textile and TXP variables

Ipse dixit!

Jeff

I agree, this is plugin territory. It does seem a little different to your request because these variables are (presumably) being inserted by txp’s tag parser as the page is rendered and can vary between page views whereas your request seemed to assume a set of fixed substitutions that could be applied a priori as articles are saved.

Adi

Not much textile can do as these substitutions are applied a posteriori by the tag parser, not by textile. If you really wanted to change the syntax for the substitutions applied by the tag parser then I think Jeff’s right — you’d need to write a plugin. Perhaps something like a wrap-tag that goes around all your article’s content and applies these substitutions on the fly.


Steve

Offline

#5 2011-01-11 12:16:59

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: [textile] Textile and TXP variables

net-carver wrote:

It does seem a little different to your request because these variables are (presumably) being inserted by txp’s tag parser as the page is rendered and can vary between page views

Right, it wouldn’t work if the expectation is to preserve the shorthand notation for later editing. That is, if the purpose is as much readability when in the Write panel as it is saving keystrokes. But if you can accept having raw variable tags in the text while editing, it would work.


Code is topiary

Offline

#6 2011-01-11 13:06:36

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,324
Website Mastodon

Re: [textile] Textile and TXP variables

net-carver wrote:

Perhaps something like a wrap-tag that goes around all your article’s content and applies these substitutions on the fly.

pax_grep would suffice, I assume.

Offline

Board footer

Powered by FluxBB