Skip to:
Content

Opened 13 months ago

Last modified 3 months ago

#7116 new enhancement

Move asset template parts away from bp-legacy

Reported by: r-a-y Owned by:
Milestone: Under Consideration Priority: normal
Severity: normal Version:
Component: Templates Keywords: has-patch 2nd-opinion close
Cc:

Description

As evidenced in #7115, I think we shouldn't introduce new template functionality directly into a template pack, but rather we should have default template parts and allow template packs to override these template parts if necessary.

Attached patch is an example that moves activity embed template parts from /bp-templates/bp-legacy/buddypress/assets/embeds/ to /bp-templates/assets/embeds/.

If we like this approach, we can do the same for emails and attachments.

Attachments (1)

7116.embeds.patch (21.9 KB) - added by r-a-y 13 months ago.
Refreshed against trunk.

Download all attachments as: .zip

Change History (15)

#1 @imath
13 months ago

I think it's a bit late to introduce such a change. I suggest to think about it for 2.7.

My point on #7115 was more to create a post on bpdevel to warn theme designers/end users that there might be a problem with the feature if the Standalone theme is using some funky stuff with the Theme compat API for the activity embed feature.

And also to try to make them update their templates if needed.

#2 @r-a-y
13 months ago

I think it's a bit late to introduce such a change. I suggest to think about it for 2.7.

For sure! I wanted to post this ticket before I forgot about it.

And also to try to make them update their templates if needed.

I think bp-nouveau shows the inelegance of our theme compatibility API especially when we introduce new core functionality such as emails and embeds. We should at least have some defaults enabled in core instead of forcing things through whatever the default template pack is at the moment.

Also, currently, bp-nouveau would need to add a dedicated template part for emails as well.

#3 @r-a-y
13 months ago

  • Milestone changed from Awaiting Review to 2.7

#4 @DJPaul
13 months ago

  • Milestone changed from 2.7 to Under Consideration

@r-a-y
13 months ago

Refreshed against trunk.

#5 @DJPaul
13 months ago

  • Milestone changed from Under Consideration to Awaiting Review

#6 @DJPaul
13 months ago

Unconvinced. This is to support people overriding the entire template pack who are missing new templates we introduce? I think we should expect that level of customisation to be done by people who are keeping an eye on development of new BuddyPress release, or at least, for them to catch that when they're testing it on a dev/test environment.

#7 @DJPaul
12 months ago

  • Keywords 2nd-opinion close added

Proposing to close this, based on my views above and lack of comment from anyone else.

#8 @r-a-y
11 months ago

This is to support people overriding the entire template pack who are missing new templates we introduce?

Yes, but only for core features like email, attachments and embeds.

BuddyPress is lucky to currently only have one template pack (and soon, two!), but imagine a scenario where there are multiple template packs in the wild and we introduce some new features and the template pack authors are no longer supporting it or are late in adding support. This wouldn't be great.

Imagine if WordPress didn't add template compatibility for embeds and left embed implementation to the theme author or only added support for their default twenty* themes. This is our current mindset.

#9 @DJPaul
9 months ago

That argument could apply to any front-end feature we add, including (for example) an entire new Component. We'd then end up with Components templates in some other folder. I'm not sure the comparison with WordPress is perfect (different scale; different intended target audience), but I understand what you're saying.

I imagine we will have some variable in the future that says what the "default" template pack is (for new installs). For these "features" that we add that have template parts, could we make it so that if the file wasn't found in the template stack, to fall-back to the "default" template pack directory?

#10 @DJPaul
9 months ago

  • Milestone changed from Awaiting Review to Under Consideration

#11 @hnla
9 months ago

@DJPaul @r-a-y Paul I have to agree with r-a-y's opening remarks as this is how I instinctively set about building or re-building the styles as partials for Nuoveau, initially as I wasn't sure how we would approach things in the final notion of the project. Adding a folder with the partialls and configuring my template pack to build my scss primary file looking for those as includes from the /bp-template/ folder seemed to make sense in any template pack having access to those default styles to call in - naturally this was also easily changeable later and not a final or decisive approach hence sticking with it while initially building.

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


6 months ago

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


3 months ago

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


3 months ago

Note: See TracTickets for help on using tickets.