localgov icon indicating copy to clipboard operation
localgov copied to clipboard

Limit the type of page component types available from a service page, with documentation for those that remain

Open finnlewis opened this issue 3 years ago • 26 comments

When creating a service page, there is a "page components" field at the bottom.

This currently allows a huge numebr of paragraphs.

I think this was originally intended for a couple of reusable paragraph components.

@Adnan-cds @cjstevens78 @willguv do you know what the intended paragraph components are?

image

finnlewis avatar Sep 10 '21 10:09 finnlewis

do you know what the intended paragraph components are?

Sorry Finn, I don't know really. There is no restriction on this field in the Croydon site at the moment. I am copying Tom in case he has any thoughts. @tom-steel

Perhaps we can consult editors. Copying @benhillsjones. Ben, any opinion about what Page component types you would ever want to use in Service pages?

Adnan-cds avatar Sep 10 '21 10:09 Adnan-cds

Thanks @Adnan-cds ! I assume that "Fact box" and "Contact" are of potential use, being things that you might want to change in one place and update in multiple. The others I am less sure of.

finnlewis avatar Sep 10 '21 10:09 finnlewis

Just discussing this with @Adnan-cds

Just confirming that we've seen the following paragraph components in use on Croydon:

  • Documents
  • Link
  • Link and summary
  • Contact

So perhaps we limit the component field on the entity browser to the above for a default install.

finnlewis avatar Sep 13 '21 13:09 finnlewis

Yes definitely in favour of this, thanks for pursuing @finnlewis

I’ll send @benhillsjones a link to this chat as he may not have seen it

willguv avatar Sep 13 '21 13:09 willguv

Hi, yes agree those 4 make sense, main two I use are links and contacts

benhillsjones avatar Sep 13 '21 14:09 benhillsjones

Plus documents when at Croydon

benhillsjones avatar Sep 13 '21 14:09 benhillsjones

This is still a live issue on fresh install.

andybroomfield avatar Apr 06 '22 10:04 andybroomfield

@andybroomfield I've added this to the kanban the content group has started using to discuss these kind of issues. Thanks for flagging

willguv avatar Apr 06 '22 10:04 willguv

It's a bug in paragraphs, which ignore the add to library setting. See https://www.drupal.org/project/paragraphs/issues/3090101 (Patch applied to BHCC site).

andybroomfield avatar Jan 21 '23 20:01 andybroomfield

@finnlewis this feels like an important issue that could be fixed quickly so am prioritising

Closed a duplicate issue and gave this a better title

willguv avatar Mar 30 '23 10:03 willguv

@stephen-cox the consensus seems to be what @finnlewis outlined above

Just confirming that we've seen the following paragraph components in use on Croydon:

Documents Link Link and summary Contact

Do you agree? Can you estimate this please? Many thanks

willguv avatar Apr 04 '23 10:04 willguv

@willguv As this just refers the types of page components that can be created, the list seems sensible to me.

Unfortunately this is not as simple as it should be. It would be nice if this was just a matter of configuring the available types, but this is not possible with the Paragraphs Library. There's an issues for it which doesn't offer much in the way of a solution: https://www.drupal.org/project/paragraphs/issues/2975831

This means we'll need to change the list of paragraph types in a hook, to change either the form or the widget. Rather than hard coding the list of available types I would also suggest creating an admin page where this can be set on a site by site basis, so a form and settings for this will be needed as well.

It's not a large job, but certainly not quick.

stephen-cox avatar Apr 06 '23 13:04 stephen-cox

Do you have a page at /admin/config/content/paragraphs_library_item There is a patch I listed above that enables settings here for what paragraphs can appear here.

Screenshot 2023-04-06 at 3 14 55 pm

andybroomfield avatar Apr 06 '23 14:04 andybroomfield

There is a patch I listed above that enables settings here for what paragraphs can appear here.

I missed that. A patch adding this functionality make this a much quicker job :smile:

stephen-cox avatar Apr 06 '23 15:04 stephen-cox

@stephen-cox can this patch be safely enabled for everyone? Thanks

willguv avatar Apr 12 '23 14:04 willguv

The patch would apply to all installs, but we only have to apply the config for new installs. As it does create new config there's a slight risk that the schema will change and we'll have to write update hooks to fix it.

stephen-cox avatar Apr 19 '23 14:04 stephen-cox

@stephen-cox to discuss at the Tech Group or can we talk about it here?

willguv avatar Apr 19 '23 15:04 willguv

@finnlewis @ekes There's a patch on this issue (https://www.drupal.org/project/paragraphs/issues/3090101) that allows us to limit the paragraph types available to page components.

My concern is that this adds new config that we'll end up having to support if Paragraphs decides to do things differently.

Any thoughts on this?

stephen-cox avatar May 03 '23 13:05 stephen-cox

Note to self: paragraphs library does not support restricting paragraph types. The patch addresses this.

finnlewis avatar Jun 21 '23 13:06 finnlewis

Plus one from me to test and review closer.

finnlewis avatar Jun 21 '23 13:06 finnlewis

Hi @finnlewis the long list of paragraph types (and lack of docs) came up at LGD Camp

Were you able to review the patch? Cheers

willguv avatar May 08 '24 11:05 willguv

@ekes want to write up your latest research or link to it?

finnlewis avatar Aug 29 '24 11:08 finnlewis

Also see https://github.com/localgovdrupal/localgov/issues/746

finnlewis avatar Aug 29 '24 11:08 finnlewis

You should have the option to limit it on this page /admin/config/content/paragraphs_library_item Configuration -> Content authoring -> Paragraphs library item settings

andybroomfield avatar Aug 29 '24 13:08 andybroomfield

You should have the option to limit it on this page /admin/config/content/paragraphs_library_item

Works if all the fields are going to be restricted to the same library items. Maybe good enough? Are there reusable items that you would want in one place on a site, but not in another?

ekes avatar Aug 29 '24 13:08 ekes

I'll write all this up more systematically, but also for the field in question on the service page. This in not a paragraphs (Entity Revisions Reference field) it is an Entity Reference field restricted to pointing to Paragraphs Library Items. So this field will only have reusable items in it, no single-use paragraphs, and will hence only have the paragraph types listed on /admin/config/content/paragraphs_library_item

ekes avatar Aug 29 '24 13:08 ekes