We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Tome URL Segments

Development and Programming

Philip Zaengle's avatar
Philip Zaengle
293 posts
about 18 years ago
Philip Zaengle's avatar Philip Zaengle

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!

       
Thorvald's avatar
Thorvald
10 posts
about 18 years ago
Thorvald's avatar Thorvald

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.

       
Philip Zaengle's avatar
Philip Zaengle
293 posts
about 18 years ago
Philip Zaengle's avatar Philip Zaengle

right on. thanks for the help

       
Thorvald's avatar
Thorvald
10 posts
about 18 years ago
Thorvald's avatar Thorvald

Glad I could help.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.