rewrite rule with tag pages & entries

38 views
Skip to first unread message

MatthewM

unread,
May 3, 2013, 4:51:54 AM5/3/13
to habari...@googlegroups.com
Hopefully you can help, im working on a site atm and it is basically many sites brought into one with sub pages.

so for example


will all be brought into and redirect to


but i want pages to have the url

and
or preferably


now i ws thinking i could use tags so within the admin news entries for mysite1 are tagged 'mysite1' so i can pull them out on  the appropriate page


now how the hell do i make the rewrite rules work this way? or can you suggest somethign better than tags?

when i set up a page i give it an explicit slug which i then make a custom page for (pages arent using the content part of the cms im hardcoding the content for ease) but that does mean quite a few custom page files in the theme



cheers

MatthewM

unread,
May 3, 2013, 4:52:47 AM5/3/13
to habari...@googlegroups.com
oh, i tried using the rewriter plugin but maybe my habari is the wroing version as it broke the site

MatthewM

unread,
May 3, 2013, 5:38:38 AM5/3/13
to habari...@googlegroups.com
im guessing this is involved some how, but its beyond my tiny mind

array( 'name' => 'display_entry', 'parse_regex' => '#^(?P<slug>[^/]+)(?:/page/(?P<page>\d+))?/?$#i', 'build_str' => '{$slug}(/page/{$page})', 'handler' => 'UserThemeHandler', 'action' => 'display_post', 'priority' => 100, 'description' => 'Return entry matching specified slug', 'parameters' => serialize( array( 'require_match' => array('Posts', 'rewrite_match_type'), 'content_type'=>'entry', 'request_types' => array('display_post') ) ) ),
array( 'name' => 'display_page', 'parse_regex' => '#^(?P<slug>[^/]+)(?:/page/(?P<page>\d+))?/?$#i', 'build_str' => '{$slug}(/page/{$page})', 'handler' => 'UserThemeHandler', 'action' => 'display_post', 'priority' => 100, 'description' => 'Return page matching specified slug', 'parameters' => serialize( array( 'require_match' => array('Posts', 'rewrite_match_type'), 'content_type'=>'page', 'request_types' => array('display_post') ) ) ),

On Friday, May 3, 2013 9:51:54 AM UTC+1, MatthewM wrote:

MatthewM

unread,
May 3, 2013, 6:12:49 AM5/3/13
to habari...@googlegroups.com
so ive fudged it by adding

array( 'name' => 'display_entry_tag', 'parse_regex' => '%^(?P<tag>[^/]+)/(?P<slug>[^/]+)(?:/page/(?P<page>\d+))?/?$%i', 'build_str' => '{$tag}/{$slug}(/page/{$page})', 'handler' => 'UserThemeHandler', 'action' => 'display_post', 'priority' => 100, 'description' => 'Return entry matching specified slug and', 'parameters' => serialize( array( 'require_match' => array('Posts', 'rewrite_match_type'), 'content_type'=>'entry', 'request_types' => array('display_post') ) ) ),


into rewriterules in the system, so how do i put this in theme?

On Friday, May 3, 2013 9:51:54 AM UTC+1, MatthewM wrote:
Reply all
Reply to author
Forward
0 new messages