Textpattern Forum

You are not logged in. Register | Login | Help

#1 2012-06-29 04:00:50

piyashrija
Member
Registered: 2012-05-17
Posts: 24

custom field data manipulate

I am newbie to textpattern ..no sure whether this question is asked before

I am in individual article page that relates to particular event.
i am pulling out venue information from a custom field like

<txp:custom_field name=“venue”/>

information it contain is in pattern as below

1111111111,abd:222222222222,abd:3333333333(output from custom field venue)

now i need to get just 3333333333;

how to do it .

i did with use of txp:php tag but i am not able to manipulate the output value from text pattern tag

Thanks

Offline

#2 2012-06-29 06:02:39

mmelon
Member
Registered: 2006-03-02
Posts: 64

Re: custom field data manipulate

hmmn i think rah repeat will let you split custom field data on the comma.

then you could do a test for a : and remove the first 4 characters using stristr and substr.

Not sure how you would decide which of the abd:XXXXXX strings you are looking for?

also steph’s plugins do nearly everything.

smd_each will probably help you out.

Mike

Offline

#3 2012-06-29 10:54:31

etc
Plugin Author
Registered: 2010-11-11
Posts: 1,062
Website

Re: custom field data manipulate

piyashrija wrote:

i did with use of txp:php tag but i am not able to manipulate the output value from text pattern tag

just put it in <txp:variable /> inside your <txp:php> block, then use this <txp:variable /> in other tags:

...
global $variable;
$variable['my_string'] = 'your_string';
...

Offline

Board footer

Powered by FluxBB