Repository navigation
Description
We're currently claiming the following at /wp-admin/admin.php?page=jetpack#/traffic:
(per
| 'The following settings will impact all related posts on your site, except for those you created via the block editor:' |
However, disabling that setting causes Related Posts blocks to disappear from the frontend as well.
Steps to reproduce the issue
- Write a post, insert a Related Posts block, publish, view
- Verify that it contains the related posts block on the fronted
- Go to
/wp-admin/admin.php?page=jetpack#/traffic - Disable the
Show related content after poststoggle seen in the screenshot (this will disable the Related Posts module) - Reload the post
What I expected
The Related Posts block is gone
What happened instead
The Related Posts block to remain
Context
The reason is this line
| if ( ! $options['enabled'] || 0 == (int)$post_id || empty( $options['size'] ) || get_post_status( $post_id) !== 'publish' ) { |
which checks for $options['enabled']. While we do set it to true by default, i.e. if $options['enabled'] isn't set, see
jetpack/modules/related-posts/jetpack-related-posts.php
Lines 403 to 404 in 9ba897d
| if ( ! isset( $this->_options['enabled'] ) ) | |
| $this->_options['enabled'] = true; |
false value to be overridden.
I found this on WP.com while testing D22588-code on a site that had the Related Posts setting switched off (from an earlier round of testing).
Possible solution
The simplest possible solution is to change the wording of
| 'The following settings will impact all related posts on your site, except for those you created via the block editor:' |
The following setting will impact all related posts on your site part above the first toggle, and add a line The following settings will not impact Related Posts block, whose layout you can control manually in the block editor or so below that first toggle.
We might want to add something similar to the corresponding Calypso setting.
These might be some good first steps.
Further considerations
In general, our strategy has been to disable blocks if their corresponding modules are disabled, so it seems to make sense that this toggle will also disable Related Posts blocks.
To the user, that toggle has mostly visual implications -- it hides legacy Related Posts from the bottom of all pages.
This introduces the following problem: If a user only wants to display Related Posts by explciitly inserting them into posts (but not at the bottom of all posts, as the legacy functionality would), they will probably disable the toggle. That, however, will also cause the blocks to disappear. In other words, AFAICS we currently don't provide any way to achieve that kind of behavior.
/cc @tyxla

Activity
jeherve commentedon Dec 20, 2018
That seems like the easiest solution; we're basically moving the warning one line down, and it makes sense then.
danjjohnson commentedon Jan 10, 2019
This seems related, but let me know if it requires a new issue...
The settings says "Show related content after posts" but with the block editor you can insert them anywhere within a post.
Should we change the main toggle to something like "Enable related posts", and change the text to explain that if related posts are not added via the block editor then they will display after the post?
Also the settings page in Calypso does not have the line:
simison commentedon Feb 11, 2019
@danjjohnson thanks, I opened an issue about that: Automattic/wp-calypso#30711
jeherve commentedon Feb 15, 2019
Noting that #11342 was just merged and addresses some of those issues.
simison commentedon Feb 18, 2019
Also Calypso side merged Automattic/wp-calypso#30713
aldavigdis commentedon Feb 28, 2019
I suggest we involve the A8C editorial team here? It does look like #11342 covered this pretty well. Should we close this issue?
6 remaining items
jeherve commentedon Apr 4, 2019
More discussion about this in #11859
MichaelArestad commentedon Jun 28, 2019
I think we should decouple the block from the module. The block should be always on regardless of whether the module is. This should be the same for other blocks in the same circumstance.
#11861 (comment)
jeherve commentedon Aug 11, 2021
Related: #20628
Typically the Related Posts feature is enabled via the Jetpack settings, and results in the feature being automatically appended to the end of posts.
This concept doesn't make sense for an FSE site, since the user should be able to fully control the site's appearance through templates. In an FSE site the user "manually" adds the feature by adding the Related Posts block into their preferred template. As such, toggling the setting doesn't actually do anything (this is also true for wpcom simple sites).
This can obviously be confusing, since a user might see the setting and turn it on, expecting Related Posts to automatically be appended (or likewise shut it off and expect them to stop appearing). Moreover, it can create confusion when a user switches from a classic theme with the feature enabled to a blocks theme. Unless they go add the block to one of their templates, they will silently lose the feature.
Describe the solution you'd like
At minimum I suggest removing the setting from the Jetpack Settings as well as the wpcom
Settings -> Readingpage when a blocks theme is enabled.To address the latter issue with switching themes, maybe we could do something with Jetpack's JITM. When Related Posts are enabled and the user switches from a classic to a blocks theme, we could serve a JITM suggesting the user add the block to their Single Post template.
cc @stacimc
jeherve commentedon Aug 11, 2021
It does hook a few things in though: the customizer panel and the settings in Settings > Reading for example will only happen once you activate the module.
I don't know that I would remove the setting entirely, since some may want to disable it for performance reasons.
That would be nice indeed! I think communication around this is a good way to clarify things a bit.
Maybe, as suggested above in this issue, we could also adjust the wording in Jetpack > Settings to clarify how things work. We could even adjust that wording based on the active theme.
See #24072 for an attempt at that.