{"action":"created","issue":{"url":"https://api.github.com/repos/rsanchez/resource_router/issues/18","labels_url":"https://api.github.com/repos/rsanchez/resource_router/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/rsanchez/resource_router/issues/18/comments","events_url":"https://api.github.com/repos/rsanchez/resource_router/issues/18/events","html_url":"https://github.com/rsanchez/resource_router/issues/18","id":53131742,"number":18,"title":"Using Resource Router with Publisher","user":{"login":"siebird","id":10938,"avatar_url":"https://avatars.githubusercontent.com/u/10938?v=3","gravatar_id":"","url":"https://api.github.com/users/siebird","html_url":"https://github.com/siebird","followers_url":"https://api.github.com/users/siebird/followers","following_url":"https://api.github.com/users/siebird/following{/other_user}","gists_url":"https://api.github.com/users/siebird/gists{/gist_id}","starred_url":"https://api.github.com/users/siebird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siebird/subscriptions","organizations_url":"https://api.github.com/users/siebird/orgs","repos_url":"https://api.github.com/users/siebird/repos","events_url":"https://api.github.com/users/siebird/events{/privacy}","received_events_url":"https://api.github.com/users/siebird/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2014-12-30T17:30:25Z","updated_at":"2015-01-02T15:58:13Z","closed_at":null,"body":"Rob, I just ran into an issue with RR & Publisher on routes for secondary languages. I think this might be due to Publisher saving all data in `exp_publisher_*` tables instead of the native tables. Is it possible to that RR works with Publisher? \r\n\r\n```\r\n':any|es/:any' => function($router, $wildcard) {\r\n\t\t$landing = array('status' => 'Open', 'channel_id' => 14);\r\n\t\t$confirm = array('status' => 'Open', 'channel_id' => 16);\r\n\r\n\t\t// is the current page a landing page?\r\n\t\tif ($wildcard->isValidUrlTitle($landing)) {\r\n\t\t\t$router->setTemplate('site/landing_page');\r\n\t\t// is the current page a confirmation page\r\n\t\t} else if ($wildcard->isValidUrlTitle($confirm)) {\r\n\t\t\t$router->setTemplate('site/confirm_page');\r\n\t\t}\r\n\t}\r\n```"},"comment":{"url":"https://api.github.com/repos/rsanchez/resource_router/issues/comments/68536870","html_url":"https://github.com/rsanchez/resource_router/issues/18#issuecomment-68536870","issue_url":"https://api.github.com/repos/rsanchez/resource_router/issues/18","id":68536870,"user":{"login":"siebird","id":10938,"avatar_url":"https://avatars.githubusercontent.com/u/10938?v=3","gravatar_id":"","url":"https://api.github.com/users/siebird","html_url":"https://github.com/siebird","followers_url":"https://api.github.com/users/siebird/followers","following_url":"https://api.github.com/users/siebird/following{/other_user}","gists_url":"https://api.github.com/users/siebird/gists{/gist_id}","starred_url":"https://api.github.com/users/siebird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siebird/subscriptions","organizations_url":"https://api.github.com/users/siebird/orgs","repos_url":"https://api.github.com/users/siebird/repos","events_url":"https://api.github.com/users/siebird/events{/privacy}","received_events_url":"https://api.github.com/users/siebird/received_events","type":"User","site_admin":false},"created_at":"2015-01-02T15:58:13Z","updated_at":"2015-01-02T15:58:13Z","body":"I found the issue–with Publisher you have the option to add a URL prefix to the current language which adds an additional segment, but is not included in EE's `{segment}` variables. So it seems with this set RR ignores that \"first\" segment as it is now working with this:\r\n```\r\n':any' => function($router, $wildcard) {\r\n\t$query = ee()->db->select('channel_id')\r\n\t\t->where('site_id', 1)\r\n\t\t->where('url_title', $wildcard->value)\r\n\t\t->where('publisher_status', 'open')\r\n\t\t->get('publisher_titles');\r\n\r\n\t$result = $query->row('channel_id');\r\n\r\n\t$router->setGlobal('test_results', $result);\r\n\r\n\t// is the current page a landing page?\r\n\tif ($result == 14) {\r\n\t\t$router->setTemplate('site/landing_page');\r\n\t// is the current page a confirmation page\r\n\t} else if ($result == 16) {\r\n\t\t$router->setTemplate('site/confirm_page');\r\n\t}\r\n}```\r\n\r\n\r\n"}}