davidyeiser wrote:
> 
> I waded through url.php in the /system/classes/ directory but couldn't
> find anything obvious to change to make this happen. Is there a way to
> change Habari to add the trailing slash at the end of URLs?

url.php is close but no cigar for you.

What you want is rewriterules.php, which contains at the top multiple 
lines like this:

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' ) ) ),

In the array element of 'build_str', add the slash at the end of the value.

Of course, you can do this without modifying core code, too.  Create a 
simple plugin that implements:

function filter_default_rewrite_rules($rules) {
   foreach($rules as $key => $rule) {
     switch($rule['name']) {
       case 'display_post':  // Add a case for every needed rule change
         $rules[$key]['build_str'] .= '\';
         break;
     }
   }
   return $rules;
}

Or something like that there.

Note that using a plugin like this you can complete re-path any of the 
built-in Habari URLs, and even create new ones.  Not only will they 
output to the right place, but by carefully adjusting the 'parse_regex' 
element, Habari will also dispatch the page properly.

Owen

--~--~---------~--~----~------------~-------~--~----~
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-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to