hi all. quick question for yah. If you could help me out that would be friggin sweet.
So URL segments (i.e. {segment_2} ) work fine in templates not related to Tome. but when I try to use them inside of a tome template the values “static” and “index” are the only items returned. Static is the title of the template group I have tome pointing at, but none of the other URL segments will return, even though I request them. any ideas? sorry for the noob question.
thanks!
The workaround for this is on the Tome wiki page.
You have to create some global variables in your path.php file.
Replace (or update) your $global_vars = array(); with the following:
$segs = explode("/", $_SERVER['PATH_INFO']);
$global_vars = array(
"seg_1" => $segs[1],
"seg_2" => $segs[2],
"seg_3" => $segs[3],
"seg_4" => $segs[4],
"seg_5" => $segs[5],
"seg_6" => $segs[6],
"seg_7" => $segs[7],
"seg_8" => $segs[8],
"seg_9" => $segs[9]
); // Last entry must not include the comma at the end
Now you can use {seg_1} etc. in Tome templates wherever you want the {segment_1} etc. value.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.