Opened 10 years ago
Closed 6 months ago
#6084 closed defect (bug) (worksforme)
Single page template routing is inelegant
Reported by: | r-a-y | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Core | Keywords: | needs-refresh |
Cc: |
Description
Split from #5552.
Summary - ticket:5552#comment:10:
All of this points to a deeper problem, which is that it's problematic for template routing - the selection of templates based on the current URL/component/action - to be happening inside of templates. Templates are loaded from the outside in (home.php contains settings.php contains plugins.php), and when the routing logic is inside of the templates, by the time you get to settings.php it's not possible to say "whoops, this actually isn't a settings page". Contrast this with what good WP themes do: get_template_part( 'content', get_post_format() ); is a single line that leaves the routing logic out of the template, where it can be filtered/modified independent of the template load order. Obviously, moving toward this kind of system is a ton of work, but I do think it's at the root of the trouble we're currently having.
Background: ticket:5552#comment:4, ticket:5552#comment:8.
But not as relevant since BuddyPress 12.0