Closed (fixed)
Project:
Token
Version:
6.x-1.12
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
30 Jun 2008 at 20:15 UTC
Updated:
7 Mar 2010 at 03:34 UTC
Hello, I want to use some of the terms from termpath. As you know it outputs it as a "/" seperated string. I had hoped it would be as easy it using the PHP explode command to cherry pick the terms I want. However I can't get it to work.
this doesn't work
<?php
$name=explode("/",[termpath]);
print $name[2];
?>
and nor does this
<?php
$name=explode("/",$node->[termpath]);
print $name[2];
?>
Both give the error
Parse error: parse error, unexpected '/', expecting T_STRING or T_VARIABLE or '{' or '$' in /home/content/c/a/r/carabusonline/html/sites/all/modules/auto_nodetitle/auto_nodetitle.module(177) : eval()'d code on line 2
I know I'm being daft, I just can't figure out how else to do this.
Many thanks for the patience of anyone who answers me :D
Comments
Comment #1
gregglesI believe the problem is that your second argument to it is not the actual token. You have to get tokens before you can use them.
You'll need something like
This is something that the tokenize module can do on cck fields. So, perhaps you'll want to look at that module.
Comment #2
matthew_ellis24 commentedthanks, I thought it might be something like that, but I wasn't sure how to get the actual token variables. Unfortunately I've broken hierarchical select so I can't sort this out till I get that working (as that's where the terms will be coming from).
But thanks for your help, I'll be sure to give tokenize a bash
Thanks
Matt
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
rus032 commenteddon't work on Token for Drupal 6.
please help.
thx.
Comment #5
rus032 commenteddon't work on Token for Drupal 6.
please help.
thx.
Comment #6
dave reidDon't re-open closed issues.