2009/5/8 Owen Winkler <[email protected]>:
>
> Michael Harris wrote:
>> I'm hoping for advice as to the best way to achieve sub-page rewrites.
>> I have little clue about rewrite rules.
>
> In rewriterules.php:
>
> array( 'name' => 'display_page', 'parse_regex' =>
> '%^(?P<parentage>.*/)(?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' ) ) ),
>
>
> Note the addition of the <parentage> capture.
>
> You'd need to change the require_match parameter to point to a function
> that would validate that the post with the requested slug is the type
> (page) required, and also that the value of parentage matches any needed
> parent slug values.
>
> It might be more efficient to alter the Posts table slug field (and the
> code that supports it) to include the full URL, including the slashes.

That almost makes sense to me. I'll give it a go and see what I come
up with. Thank you.



-- 
Michael C. Harris, School of CS&IT, RMIT University
http://twofishcreative.com/michael/blog
IRC: michaeltwofish #habari

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/habari-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to