+ $template = 'list';
+ $template_variables['page_number'] = $page_number;
+ } else {
+ if (count($path_components) >= 1) {
+ $slug = $path_components[0];
+ $page_id = cx_posts_find_page_id($slug);
+ if ($page_id) {
+ $template = 'post';
+ $template_variables['post_id'] = cx_posts_find_page_id($slug);
+ }
+ }
+
+ if ($template == null && count($path_components) >= 3) { // FIXME sometime, needs more flexibility...
+ $year = $path_components[0];
+ $month = $path_components[1];
+ $slug = $path_components[2];
+ $post_id = cx_posts_find_article_id($slug);
+ if ($post_id) {
+ $template = 'post';
+ $template_variables['post_id'] = cx_posts_find_article_id($slug);
+ }
+ }