Skip to:
Content

BuddyPress.org

Opened 23 months ago

Last modified 16 months ago

#7672 reopened enhancement

Moved shared template pack assets into new folder

Reported by: DJPaul Owned by: djpaul
Milestone: Awaiting Contributions Priority: normal
Severity: normal Version:
Component: Templates Keywords: has-patch
Cc:

Description (last modified by DJPaul)

In Nouveau and Legacy, there exist subfolders [pack]/buddypress/assets/, containing templates for emails, "attachments" (avatar upload templates/cover images), and oEmbeds. I need to triple check, but I believe these template are identical between Nouveau and Legacy, and duplicating them doesn't seem to have any benefit.

I propose these are moved into a new bp-templates/shared/ folder. We can register the new location in the register_theme_packages() method with bp_register_template_stack() in such a way that this change is transparent and 100% compatible with all existing themes and any custom template packs.

Attachments (1)

7672.1.patch (25.5 KB) - added by DJPaul 23 months ago.

Download all attachments as: .zip

Change History (16)

#1 @DJPaul
23 months ago

  • Description modified (diff)

@DJPaul
23 months ago

#2 @DJPaul
23 months ago

  • Keywords has-patch added

I've attached a patch demonstrating this. The patch itself isn't clear to read as it has a lot of folder renaming included in it, but just look at the green bits, not the red bits.

#3 @hnla
23 months ago

@DJPaul This is similar iirc to the proposal @r-a-y raised a while back that I supported in principle ( I'll try and find that ticket).

If we do this & I think we should we do need to be sure ( as you said )

  • That the files are identical, true shared assets and not ones that can be justifiably edited per TP
  • That if they could be edited/customized we are able to overload them to a theme loaction.

#4 @hnla
23 months ago

Yep this is the proposal suggested by r-a-y:
https://buddypress.trac.wordpress.org/ticket/7116

I'm in favour & also maybe of moving the scss partials to that same level so that they are more generic for TP use moving forward.

#5 @DJPaul
23 months ago

  • Milestone changed from Under Consideration to 3.0

Ah, great find! It's definitely an idea who's time has come, then. :)

I'll compare the templates when I look at this next, and put in the change.

#6 @DJPaul
23 months ago

_attachments/avatars/* and _attachments/cover-images/* have diverged. The differences are HTML5 (or not), so I'll use the Nouveau version as the "base", and the version of the file in Legacy will override it, so no impact there.

#7 @djpaul
23 months ago

  • Owner set to djpaul
  • Resolution set to fixed
  • Status changed from new to closed

In 11835:

Templates: move common assets from bp-legacy and bp-nouveau into a shared folder.

In the Nouveau and Legacy packs, these templates were identical. As they used for very specific parts of a BuddyPress theme,
and all to support features that were added since bp-legacy was created, we can utilise this new shared folder to avoid duplication.

The shared folder is added to the template hierarchy, with a lower priority than the WordPress theme, any WordPress parent theme,
and the active template pack. Any site that has customised any of the moved templates will continue to load those version.

Fixes #7672

Props r-a-y for the initial patch, and hnla.

This ticket was mentioned in Slack in #buddypress by r-a-y. View the logs.


23 months ago

#9 @hnla
23 months ago

_attachments/avatars/* and _attachments/cover-images/* have diverged. The differences are HTML5 (or not), so I'll use the Nouveau version as the "base", and the version of the file in Legacy will override it, so no impact there.

Makes sense.

#10 @DJPaul
23 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#11 @DJPaul
23 months ago

A handful of contributors had an impromptu discussion on Slack last Friday, primarily about the shared templates folder. The results of that discussion means we are revisiting the work done so far:

  • Instead of creating a new shared folder, we will use bp-legacy as the template fallback folder.
    • This means we need to have bp-legacy in the template stack, even if Nouveau is selected by the user.

Part of the plan with this ticket, though not communicated well by me (sorry, was that we would then look at introducing new template partials for xprofile field types -- see #5799. This remains the case.

Something we also discussed, that I think is likely for a future release, is to enable per-component template packs. That proposal needs to be written up and discussed in the normal channels.

This ticket was mentioned in Slack in #buddypress by djpaul. View the logs.


23 months ago

#13 @DJPaul
22 months ago

  • Milestone changed from 3.0 to Up Next

I won't have time for this for 3.0 now. Doing this later won't have any compatibility impact.

#14 @DJPaul
16 months ago

  • Milestone changed from Up Next to Under Consideration

#15 @DJPaul
16 months ago

  • Milestone changed from Under Consideration to Awaiting Contributions
Note: See TracTickets for help on using tickets.