Jetpack: Related Posts: Clarify relation of legacy option to block

Created on 20 Dec 2018  路  12Comments  路  Source: Automattic/jetpack

We're currently claiming the following at /wp-admin/admin.php?page=jetpack#/traffic:

image

(per https://github.com/Automattic/jetpack/blob/9ba897d6b3c91817111de6a750b2fdb852788bcc/_inc/client/traffic/related-posts.jsx#L71)

However, disabling that setting causes Related Posts _blocks_ to disappear from the frontend as well.

Steps to reproduce the issue

  1. Write a post, insert a Related Posts block, publish, view
  2. Verify that it contains the related posts block on the fronted
  3. Go to /wp-admin/admin.php?page=jetpack#/traffic
  4. Disable the Show related content after posts toggle seen in the screenshot (this will disable the Related Posts module)
  5. 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 https://github.com/Automattic/jetpack/blob/9ba897d6b3c91817111de6a750b2fdb852788bcc/modules/related-posts/jetpack-related-posts.php#L737

which checks for $options['enabled']. While we do set it to true by default, i.e. if $options['enabled'] isn't set, see https://github.com/Automattic/jetpack/blob/9ba897d6b3c91817111de6a750b2fdb852788bcc/modules/related-posts/jetpack-related-posts.php#L403-L404, this correctly doesn't change an explicit user-set 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 https://github.com/Automattic/jetpack/blob/9ba897d6b3c91817111de6a750b2fdb852788bcc/_inc/client/traffic/related-posts.jsx#L71 to make clear that the top toggle actually impacts Related Posts blocks, too (as opposed to the other, layout-modifying toggles). Better yet, we should probably keep the 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

Gutenberg Related Posts [Type] Bug

Most helpful comment

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.

That seems like the easiest solution; we're basically moving the warning one line down, and it makes sense then.

All 12 comments

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.

That seems like the easiest solution; we're basically moving the warning one line down, and it makes sense then.

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:

The following settings will impact all related posts on your site, except for those you created via the block editor:

@danjjohnson thanks, I opened an issue about that: https://github.com/Automattic/wp-calypso/issues/30711

Noting that #11342 was just merged and addresses some of those issues.

I suggest we involve the A8C editorial team here? It does look like https://github.com/Automattic/jetpack/pull/11342 covered this pretty well. Should we close this issue?

@aldavigdis I'll leave it to you but I think this might be now covered well enough by wording updates in both Jetpack and Calypso?

Any follow-ups feel like part of bigger refactoring where modules are disconnected from block availability?

this might be now covered well enough by wording updates in both Jetpack and Calypso?

Agreed

screen shot 2019-02-28 at 16 32 37

The thing is, you still need to enable the 'Show related content after posts' toggle to enable the Related Posts block -- so the text is still kinda misleading. (That's the actual issue here. Apparently the verbosity of my issue descriptions tends to cover up the actual core problem :sweat_smile: )

oh, good point

More discussion about this in #11859

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.

https://github.com/Automattic/jetpack/issues/11861#issuecomment-506856187

Was this page helpful?
0 / 5 - 0 ratings