Skip to:
Content

Opened 4 years ago

Closed 2 years ago

#2649 closed defect (bug) (duplicate)

Add template hierarchy support into BuddyPress

Reported by: DJPaul Owned by: DJPaul
Milestone: 1.6 Priority: normal
Severity: normal Version:
Component: Core Keywords: needs-patch
Cc: sorich87@…

Description

WordPress' template hierarchy allows it to use specific template files for specific pages, or fall back to a default.

The attached patch is a first-pass of introducing the same to BuddyPress, built against the trunk. It has been taken out of a custom plugin and it has a designed limitation that it won't affect the main page templates which are always included by bp_core_load_template().

Most of the BP-Default theme uses bp_core_load_template() to load a "main" template file which then includes an appropriate secondary template to build the page; the latter is where I decided to patch.

Attachments (1)

patch-2649.patch (3.4 KB) - added by DJPaul 4 years ago.
v1

Download all attachments as: .zip

Change History (10)

comment:1 DJPaul4 years ago

  • Keywords has-patch added
  • Owner set to DJPaul
  • Status changed from new to assigned

DJPaul4 years ago

v1

comment:2 paulhastings04 years ago

  • Summary changed from Add template hierarchy support into BuddyPress to [patch] Add template hierarchy support into BuddyPress

comment:3 DJPaul3 years ago

May I have some feedback on this please? I'd like to put it in trunk. Specifically whether to fetch item IDs for BP Core components; at the moment it uses part of the URL to keep things compatible with all plugins.

comment:4 DJPaul3 years ago

  • Keywords needs-patch added; has-patch removed

After some discussion with John on IRC, I'm going to look to see if I can make a forwards-compatible patch to enable this to work with WP 3.1. The plan is to retain existing behaviour if not on WP 3.1.

comment:5 DJPaul3 years ago

  • Milestone changed from 1.3 to 1.4
  • Summary changed from [patch] Add template hierarchy support into BuddyPress to Add template hierarchy support into BuddyPress

Bumping this to 1.4 as we'll need to ask for a filter to be added in WP Core to locate_template().

comment:6 DJPaul3 years ago

#WP13239 looks relevant

Last edited 3 years ago by DJPaul (previous) (diff)

comment:7 sorich873 years ago

  • Cc sorich87@… added

comment:8 DJPaul3 years ago

  • Milestone changed from 1.6 to Future Release
  • Severity set to normal

comment:9 DJPaul2 years ago

  • Milestone changed from Future Release to 1.6
  • Resolution set to duplicate
  • Status changed from assigned to closed

Closing in favour of #3741, which has the up-to-date approach for this sort of thing.

Note: See TracTickets for help on using tickets.