Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-03-05 11:37:46

geoff777
Plugin Author
From: Benarrabá Andalucía Spain
Registered: 2008-02-19
Posts: 282
Website

Concatenating with <txp:variable />

Can I concatenate two <txp:variable />‘s

<txp:variable name=“a” value=“concat” />
<txp:variable name=“b” value=“enate” />

then

<txp:variable name=“c” value=”<txp:variable name=“a” /><txp:variable name=“b” />” />

I’ve tried a few combinations but I’ve had no luck.

Is it possible?

Thanks
Geoff


There are 10 types of people in the world: those who understand binary, and those who don’t.

Offline

#2 2009-03-05 12:08:53

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: Concatenating with <txp:variable />

<txp:variable name="a" value="concat" />
<txp:variable name="b" value="enate" />
<txp:variable name="c" value="<txp:variable name='a' /><txp:variable name='b' />" />

Echo c: <txp:variable name="c" />

It’s an issue on apostrophes!


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#3 2009-03-05 14:09:42

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

Re: Concatenating with <txp:variable />

Yes, except to do tags within tags you need single quotes around the enclosed tag, as in:

<txp:variable name="c" value='<txp:variable name="a" /><txp:variable name="b" />' />


Code is topiary

Offline

#4 2009-03-05 18:33:41

geoff777
Plugin Author
From: Benarrabá Andalucía Spain
Registered: 2008-02-19
Posts: 282
Website

Re: Concatenating with <txp:variable />

Thanks for your help.

The single tags work.

Hacking adi_calc and adding a few string operations made it easier too. (Prefix & Suffix)

Cheers
Geoff


There are 10 types of people in the world: those who understand binary, and those who don’t.

Offline

#5 2009-03-06 20:07:46

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,634
GitHub Twitter

Re: Concatenating with <txp:variable />

Hi folks.

It seems <txp:variable> can manipulate only string values.
Do you think we can change the values to manipulate integers?

Best regards,


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#6 2009-03-07 16:40:34

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

Re: Concatenating with <txp:variable />

Pat64 wrote:

It seems <txp:variable> can manipulate only string values.

See adi_calc for arithmetic with txp:variable.

Last edited by Bloke (2009-03-07 16:41:20)


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

Online

#7 2009-03-07 18:28:07

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,634
GitHub Twitter

Re: Concatenating with <txp:variable />

As always, a good advice Stef :))

Tks.

Another question :

What is the impact of plugins into a front-end TXP website performances?
I know TXP 4.0.7 includes a new loading feature for plugins. Combinate with your/Yura/Steve ied_plugin_composer we can manage ressources.

Some infos will be appreciate.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#8 2009-03-07 19:17:43

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

Re: Concatenating with <txp:variable />

Pat64 wrote:

What is the impact of plugins into a front-end TXP website performances?

OT: how long is a piece of string :-P

It depends on:

  1. the plugin code — if it does a lot with callbacks or does little in addition to when it is used in your templates
  2. the plugin type — only Client+Admin type is loaded now, with Library plugins loaded only if required. The database index helps
  3. the plugin size — bigger plugins probably take longer to read, though not by much (but use the large smd_ plugins as a last resort!)
  4. if the plugin begins with rvm_ or wet_ — they nearly always use a tonne of core features that us lesser mortals have to find first, and those plugins tend to be very small, very fast and totally focused on the job

Last edited by Bloke (2009-03-11 12:55:57)


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

Online

#9 2009-03-09 09:10:25

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,634
GitHub Twitter

Re: Concatenating with <txp:variable />

Ok. Tks Stef.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#10 2009-03-11 12:51:13

Timid&friendly
Member
From: The Netherlands
Registered: 2006-05-28
Posts: 252
Website

Re: Concatenating with <txp:variable />

lol


I think, therefore I AM, … … er … I think :-?

Offline

Board footer

Powered by FluxBB