-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve support for distributed guest authors #2215
Conversation
Handle guest authors distributed via Newspack Network and Distributor plugins
Can't this be a filter inside the Newspack Network plugin so it's contained in the same codebase? Distributor has a similar strategy to filter the author to make it appear as the site name. |
Most of the things work from a filter. The only reason we need some customization here is to remove the As for the avatar, we won't need anything here if we are able to add a filter to the But anyway. all this approach is still under discussion |
Thank you for explaining! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so cool, @leogermani! 🙌
I tested posts with single guest authors, multiple guest authors, mix of guest and regular, and a guest mapped to a regular author. The only issue I've run into is that the distributed guest author avatars don't seem to be syncing, but only for the byline at the top -- they appear as expected in the author bio at the bottom of the post. The regular author avatars work 100% as expected.
Job titles, bios, and email addresses were brought over as expected!
Styles
There was some discussion about whether these should be styled to match the linked authors. Personally, I'm leaning towards leaving them as the default grey -- I think that could give some visual feedback that they're not the same as the other names and (hopefully!) help set expectations that they're not going to be links. I'm open to discussing that further, though! I feel like either way we land with this, there will be publishers who want it to work "the other way" (either match the regular links, or look less like the links).
Custom CSS
I think there's a small risk existing custom CSS won't be applied as expected to these new unlinked bylines because an HTML element has been removed. I think it's super-minor though -- and it won't affect existing posts since it's a new feature, just posts going forward. I think we can tackle this as it comes up (it will likely also happen if we opt to style these to match the links).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @leogermani! 8367482 fixed the issue for me:
I have one more change that I missed in my initial review: Newspack Sacha also has its own /author-bio.php file that would need the same changes as the main theme's file, just to make sure it's picking up the same updated author info. The separate file was to help make its centred layout easier to accomplish, but more than once I wish I'd just reworked the original file earlier on to avoid adding it!
Thanks for the review @laurelfulford I've updated the checks with some recent changes on the PR in the Newspack Network plugin, but it should work just the same. And I applied the changes to the Sacha theme. All those I also tested with co-authors-plus disabled in both themes just to make sure :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @leogermani!
All those ifs are not pretty, but I think it's good enough for now.
I thought you meant the ones that were already there 😆 These files are already full of so many if
s and else
s, adding more at this point can't hurt!
I retested this with Newspack and Newspack Sasha, with and without Co-Author Plus, and the single posts work as expected! 🎉
I found one more spot that may need changes, but it's not something that's actually being addressed in this PR yet, so I'm marking this as approved in case it's just easier to do it as a separate fix: clicking around, I noticed that the 'real' authors that are brought over via the Network still have the site's name as their name on the author archives. For example, this author has the display name 'laurel' but it's still showing 'Newspack Dev' (my spoke site) on the Hub archive:
Just let me know if you have any questions about that, or can't reproduce! I don't remember spotting that when I last tested, but I don't think I actually clicked over to the transferred author archive pages. (Also just let me know if I should spin up an Asana task for that with better steps to replicate!).
@laurelfulford Can you check if you unmarked the "Override Author Byline" option in Distributor > Settings? |
@leogermani I had it checked when this happened, but I also unchecked it both on the Hub and Spoke and could see the same issue 😕 I'll take some time this AM trying to recreate in a different set up, and can follow up with a separate task if I'm still seeing it with a link! |
@leogermani Just wanted to follow up and confirm I CAN'T recreate the above on two JN sites set up with Hub & Spoke plus this PR, so that issue was totally user error 🙂 |
🎉 This PR is included in version 1.84.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.84.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Handle guest authors distributed via Newspack Network and Distributor plugins
All Submissions:
Changes proposed in this Pull Request:
Improves the support for the distributed post authors by Newspack Network.
Basically - remove the
a
tag for authors without a URL.Also sends an extra information in the
newspack_author_bio_name
filter.How to test the changes in this Pull Request:
See Automattic/newspack-network#25
Other information: