Opened 9 years ago
Closed 9 years ago
#6572 closed enhancement (fixed)
Conversation replies don't immediately inherit the HTML of custom templates.
Reported by: | CharlesMabe | Owned by: | r-a-y |
---|---|---|---|
Milestone: | 2.4 | Priority: | normal |
Severity: | normal | Version: | 1.7 |
Component: | Messages | Keywords: | has-patch dev-feedback |
Cc: |
Description
There seems to be a problem with the way new replies in member conversations output their HTML. I'm not very experienced with programming or design-- I'm just doing what I can to get my site up and running. But this is most likely a bug, not just my problem.
I created an extra div wrapper around the message content in my custom, overriding template file-- my-theme/buddypress/members/single/messages/single.php-- in order to put it in a box alongside the avatar, as shown in the attached image. This custom div wrapper starts just before <div class="message-metadata">
and ends just after </div><!-- .message-content -->
. I also enlarged the avatar thumbnail width and height. The styling looks fine.
However, when I send a new reply and the Ajax loads it (from the reply box below the messages list), its immediate styling is the same as how it was in the legacy template, as seen in the attached image. Only if I refresh the page does the reply display properly using the HTML in my custom template and corresponding CSS rules.
I only have the BuddyPress and bbPress plugins installed and activated. I have Advanced Ajax Page Loader and BuddyPress Default Data installed but not activated. WordPress and all plugins are up-to-date.
If you manage to find a solution soon, I would appreciate it if you would tell me so I can continue working on this custom theme instead of waiting for a proper BuddyPress update. My site depends on it. Thanks.
Attachments (2)
Change History (12)
#1
@
9 years ago
- Keywords has-patch added; needs-patch removed
- Milestone changed from Awaiting Review to 2.4
- Priority changed from high to normal
- Type changed from defect (bug) to enhancement
- Version changed from 2.3.2 to 1.7
#2
@
9 years ago
- Keywords dev-feedback added
@hnla @mercime your opinions on this would be appreciated, specifically on name of template part. Want some pattern that makes sense for other bits in the future. Thanks
#3
@
9 years ago
Revised my comments after actually reading r-a-y's comments and patch.
Think the proposed change makes sense, as always this will affect anyone that has overloaded templates so we'll need to be clear in announcing those template changes.
Would like to test patch and see things in action.
Naming wise maybe 'single-message' - is not 'content-single' a little non descriptive'? or is that what we would prefer for partials going forward?
#4
@
9 years ago
this will affect anyone that has overloaded templates so we'll need to be clear in announcing those template changes.
I do not think this will affect anyone too much. A savvy developer would have had to unhook how BP adds the single message via AJAX and run their own routine, so this wouldn't affect their changes.
Naming wise maybe 'single-message' - is not 'content-single' a little non descriptive'?
Yeah, I was having a hard time naming the new template part. Core WP themes use this convention for template parts - content-POSTTYPE.php
. Maybe content-single-message.php
or content-message-single.php
? Or to be more in line with what we already have, maybe messages-single.php
since we have a template called messages-loop.php
?
For comparison, bbPress uses this convention - loop-single-TYPE.php
- for items in the loop. They use content-single-TYPE.php
as a wrapper template:
https://bbpress.trac.wordpress.org/browser/tags/2.5.8/templates/default/bbpress/content-single-reply.php
#5
@
9 years ago
I do not think this will affect anyone too much. A savvy developer would have had to unhook how BP adds the single message via AJAX and run their own routine, so this wouldn't affect their changes.
That's fair enough then.
Think I would be inclined towards messages-single
as being clear and succinct, to the point; but feel perhaps the content-
prefix a little too WP post typish?
But if we feel it's better to fit with bbP/WP conventions then we better just make it content-single-message
Ultimately with the number of partials we have not too fussed as long as we're happy that it's suitable as an adopted convention.
#6
@
9 years ago
Think I would be inclined towards
messages-single
as being clear and succinct, to the point; but feel perhaps thecontent-
prefix a little too WP post typish?
Yeah, I tend to agree. I think we can roll with messages-single.php
for bp-legacy and when we do roll out a new template pack, we can have a larger discussion about template part naming.
#7
@
9 years ago
@r-a-y setup a quick test as I wanted to see issue in action and resolution, resolution is perfect in being straightforward, sorts out the Ajax issue but also gains in breaking up a template a little so easier to read and deal with (hopefully we'll be able to do this a little more in other templates) and removing the Ajax hardcoded call back it's a bit of a happy win win ticket really.
Seems we just need others opinion on naming and perhaps location - less an issue probably pointless sub foldering along the lines of /_incl/.
Does make me wonder what other Ajax reload issues if any could be resolved in a similar manner. The solution in having
This ticket was mentioned in Slack in #buddypress by r-a-y. View the logs.
9 years ago
#9
@
9 years ago
Consensus for naming is:
message.php
https://wordpress.slack.com/archives/buddypress/p1439411186001432
The problem is due to us hardcoding the markup for the AJAX message:
https://buddypress.trac.wordpress.org/browser/tags/2.3.2/src/bp-templates/bp-legacy/buddypress-functions.php#L1509
Which can be different from the
/members/single/messages/single.php
template.I think we should introduce a new template called
/members/single/messages/content-single.php
or something like that so we can share the markup in both instances.Please test the attached patch and you should be able to just alter
/members/single/messages/content-single.php
and that should apply for both AJAX and regular PMs.Note: We might rename the new template to something else like
'single-content.php'
later on.