Well, this is how BP does it for activity streams:<br><br><font face="arial, helvetica, sans-serif"><span style="font-family:'Lucida Grande',Verdana,'Bitstream Vera Sans',Arial,sans-serif;font-size:12px;line-height:22px"><pre style="font-variant:normal ! important;text-align:left ! important;margin:0px 0px 22px;padding:11px;font-family:Consolas,Monaco,'Courier New',Courier,monospace;background-color:rgb(240, 240, 240);border-width:1px;border-style:solid;border-color:rgb(218, 218, 218);font-size:12px;line-height:1.3em;overflow:auto;color:rgb(0, 0, 0);font-weight:inherit;white-space:pre-wrap;word-wrap:break-word">
<?php
add_filter('wp_dropdown_pages', 'custom_wp_pages_filter'); //adds to the drop-down<br> add_filter('page_template', 'custom_page_template');// executes when the page template is being loaded<br>
        add_action('pre_get_posts', 'bpp_fix_get_posts_on_activity_front');<br>        add_filter('the_posts', 'bpp_fix_the_posts_on_activity_front');<br>
        function custom_wp_pages_filter($page_html) {<br>                if ('page_on_front' != substr($page_html, 14, 13))<br>                        return $page_html;<br><br>                $selected = false;<br>                $page_html = str_replace('</select>', '', $page_html);<br>
<br>                if ($this->bpp_page_on_front() == 'activity')<br>                        $selected = ' selected="selected"';<br><br>                $page_html .= '<option class="level-0" value="activity"'.$selected.'>'.__('Activity Stream', 'buddypress').'</option></select>';<br>
                return $page_html;<br>        }<br><br> function custom_page_template($template) {<br> global $wp_query;<br><br> if (empty($wp_query->post->ID))<br> return locate_template(array('activity/index.php'), false);<br>
else<br>
return $template;<br> }<br>        function bpp_fix_get_posts_on_activity_front() {<br>                global $wp_query;<br><br>                if (!empty($wp_query->query_vars['page_id']) && 'activity' == $wp_query->query_vars['page_id'])<br>
                        $wp_query->query_vars['page_id'] = '"activity"';<br>        }<br><br>        function bpp_fix_the_posts_on_activity_front($posts) {<br>                global $wp_query;<br>                if (empty($posts) && !empty($wp_query->query_vars['page_id']) && '"activity"' == $wp_query->query_vars['page_id'])<br>
                        $posts = array((object) array('ID' => 'activity'));<br>                return $posts;<br>        }<br>?></pre></span></font><font face="arial, helvetica, sans-serif"><span style="font-family:'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif;font-size:12px;line-height:22px"></span></font><font face="arial, helvetica, sans-serif"><span style="font-family: 'Lucida Grande',Verdana,'Bitstream Vera Sans',Arial,sans-serif; font-size: 12px; line-height: 22px;">This is an adaptation of the BP default theme. It does quite a few things:<br>
</span></font><ol><li><font face="arial, helvetica, sans-serif"><span style="font-family: 'Lucida Grande',Verdana,'Bitstream Vera Sans',Arial,sans-serif; font-size: 12px; line-height: 22px;">Adds the new page template to the "Page Templates" drop-down</span></font></li>
<li><font face="arial, helvetica, sans-serif"><span style="font-family: 'Lucida Grande',Verdana,'Bitstream Vera Sans',Arial,sans-serif; font-size: 12px; line-height: 22px;">Makes sure that the loop doesn't act up</span></font></li>
<li><font face="arial, helvetica, sans-serif"><span style="font-family: 'Lucida Grande',Verdana,'Bitstream Vera Sans',Arial,sans-serif; font-size: 12px; line-height: 22px;">Loads the file activity/index.php when something is using the "activity" template.<br>
</span></font></li></ol><font face="arial, helvetica, sans-serif"><span style="font-family:'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif;font-size:12px;line-height:22px">I was curious if there is an easier way to avoid clutter in the root folder. Other uses, including locate_template() or get_template_part() in isolation will not do the job - I believe all the hooks have to be applied.<br>
</span></font><br><br><div class="gmail_quote">On Wed, Jul 27, 2011 at 3:59 PM, Emil Uzelac <span dir="ltr"><<a href="mailto:emil@themeid.com" target="_blank">emil@themeid.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<font color="#333333"><font size="2"><font face="arial,helvetica,sans-serif">The only option I could think of from top of my head is:<br clear="all"></font></font></font><div><div><font face="arial, helvetica, sans-serif"><br>
</font></div><div><font face="arial, helvetica, sans-serif"><span style="font-family:'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif;font-size:12px;line-height:22px"><pre style="font-variant:normal !important;text-align:left !important;margin-top:0px;margin-right:0px;margin-bottom:22px;margin-left:0px;padding-top:11px;padding-right:11px;padding-bottom:11px;padding-left:11px;font-family:Consolas, Monaco, 'Courier New', Courier, monospace;background-color:rgb(240, 240, 240);border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(218, 218, 218);border-right-color:rgb(218, 218, 218);border-bottom-color:rgb(218, 218, 218);border-left-color:rgb(218, 218, 218);font-size:12px;line-height:1.3em;overflow-x:auto;overflow-y:auto;color:rgb(0, 0, 0);font-weight:inherit;white-space:pre-wrap;word-wrap:break-word;background-repeat:initial initial">
<?php
/*
Template Name: Blog
*/
?></pre></span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-family:'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif;font-size:12px;line-height:22px"><pre style="font-variant:normal !important;text-align:left !important;margin-top:0px;margin-right:0px;margin-bottom:22px;margin-left:0px;padding-top:11px;padding-right:11px;padding-bottom:11px;padding-left:11px;font-family:Consolas, Monaco, 'Courier New', Courier, monospace;background-color:rgb(240, 240, 240);border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(218, 218, 218);border-right-color:rgb(218, 218, 218);border-bottom-color:rgb(218, 218, 218);border-left-color:rgb(218, 218, 218);font-size:12px;line-height:1.3em;overflow-x:auto;overflow-y:auto;color:rgb(0, 0, 0);font-weight:inherit;white-space:pre-wrap;word-wrap:break-word;background-repeat:initial initial">
<?php get_template_part( 'blog-template'); ?></pre></span></font></div><div><font face="arial, helvetica, sans-serif">But with this you're not gaining whole lot.</font></div><div><font face="arial, helvetica, sans-serif"><br>
</font></div><div><font face="arial, helvetica, sans-serif">Basically i.e. blog.php is a placeholder and blog-template.php is the actual template.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div>
<div><font face="arial, helvetica, sans-serif">Emil</font></div><div><font face="arial, helvetica, sans-serif">----</font></div><div><font face="arial, helvetica, sans-serif"><b>Emil Uzelac</b> | ThemeID | T: <a href="tel:224-444-0006" value="+12244440006" target="_blank">224-444-0006</a> | Twitter: @EmilUzelac | E: <a href="mailto:emil@themeid.com" target="_blank">emil@themeid.com</a> | <a href="http://themeid.com/" target="_blank">http://themeid.com</a></font></div>
<div><font color="#999999" face="arial, helvetica, sans-serif">Make everything as simple as possible, but not simpler. - Albert Einstein</font></div><br>
<br><br><div class="gmail_quote"><div><div></div><div>On Wed, Jul 27, 2011 at 5:26 PM, Sayontan Sinha <span dir="ltr"><<a href="mailto:sayontan@gmail.com" target="_blank">sayontan@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div>
Hi,<br>Is there a way to have page templates in a sub-folder of a theme or do they have to be in the root folder? I know that using filter hooks an a template from a sub-folder can be added to the drop-down list of templates in the "Edit Page" screen (the way BP does it). Is there an easier way to do this?<br>
<br>Regards,<br>Sayontan.<br clear="all"><br>-- <br>Sayontan Sinha<br><a href="http://mynethome.net" target="_blank">http://mynethome.net</a> | <a href="http://mynethome.net/blog" target="_blank">http://mynethome.net/blog</a><br>
<font color="#888888">
--<br>Beating Australia in Cricket is like killing a celebrity. The death gets more coverage than the crime.<br><br>
</font><br></div></div>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Sayontan Sinha<br><a href="http://mynethome.net" target="_blank">http://mynethome.net</a> | <a href="http://mynethome.net/blog" target="_blank">http://mynethome.net/blog</a><br>
--<br>Beating Australia in Cricket is like killing a celebrity. The death gets more coverage than the crime.<br><br>