[buddypress-trac] [BuddyPress Trac] #6844: Extract & relocate core markup functions: Theme compat include functionality & search forms file
buddypress-trac
noreply at wordpress.org
Wed Jan 27 16:54:40 UTC 2016
#6844: Extract & relocate core markup functions: Theme compat include
functionality & search forms file
-----------------------------------------+------------------------------
Reporter: hnla | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Appearance - Template Parts | Version:
Severity: normal | Resolution:
Keywords: has-patch dev-feedback |
-----------------------------------------+------------------------------
Comment (by boonebgorges):
I think you're suggesting a couple different things, some of which I
totally agree with. [attachment:6844.diff] is an attempt to reconcile them
with what I have in mind.
1. First, I agree that the different components should share search-form
code. This requires just a small amount of abstraction, which
[attachment:6844.diff] implements in the form of new template tags
(`bp_get_search_placeholder()`, etc). We could probably use more of these
template tags - eg, I don't know that we should be using the same one for
'id' and 'name' attributes, and it really stinks to concatenate
'members_search_submit' - but this gives you an idea of what I have in
mind.
2. Second, I agree that it's important for theme authors to be able to
override this markup. That's the whole goal of the ticket, as I understand
it.
3. However, my point is that theme authors already have a system for
overriding markup: the template stack.
4. You're correct that we need some sort of new directory for shared
template parts. On a lark, I'm suggesting 'common', but other suggestions
are welcome. (`incl` or something like it seems wrong if the contents are
template parts.)
5. I put the `has_filter()` check into the `index.php` template. It's not
beautiful, but who cares? This will go away when we have a new template
pack.
6. IMO, if we make this change, we no longer have to maintain the existing
`bp_directory_*_search_form()` functions. We can list in the documentation
that they are no longer used by default, and that they should not be used.
Possibly we can move them to the deprecated folder, but this might mean
crashing sites in some edge cases.
The approach I'm suggesting seems like much less of a departure from the
existing paradigm of template overriding. What do you think?
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6844#comment:3>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list