Thanks all, I found a plugin that let me do what I wanted to do once I had 
tweaked it a little, following your advice. The 'staticfront' plugin adds 
rewrite rules to put a static page at the base url instead of home.php; I 
just added an option to output a new template to the base url. Something 
new I've learned: this kind of stuff can be implemented much more neatly 
with plugins!

 

Thanks again for the help!

Nathan

On Sunday, April 28, 2013 1:21:38 PM UTC+1, Nathan Thomas wrote:
>
> Hi all,
>
> I've really enjoyed using Habari over the past couple of years, and the 
> transparency of the code has encouraged me to try to get to grips with it a 
> little more.
>
> At the moment I'm trying to figure out how to display a custom template 
> when I click on a link. I managed to create the new template using 
> add_template, and it shows up when I call $theme->display('<new 
> template>'). However, when I tried to create a rewrite rule to display the 
> template whenever a specific URL is requested, I couldn't get it to work.
>
> Here's the code:
>
> <code>
> public function action_init() {
>  $this->add_template('blog', dirname(__FILE__).'/blog.php',false);
>         $this->add_rule('"blog"','display_blog');
>     }
>
>     public function action_handler_display_blog( $handler )
>     {
>         $handler->$theme->display('blog');
>     }
> </code>
>
> From what I understand, this should add a new rule that uses the 
> display_blog handler to display the blog.php template for the URL 
> '<siteurl>/blog', but I just get a 404.
>
> Where am I going wrong?
>
> Thanks,
> Nathan
>
> P.S. The new Habari site design looks great BTW!
>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"habari-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to