localgovdrupal / localgov

Installation profile for the LocalGov Drupal distribution.
GNU General Public License v2.0
80 stars 18 forks source link

Previewing more than a single page at a time #600

Open willguv opened 1 year ago

willguv commented 1 year ago

Preview links only work for single pages. This means editors have to send multiple links to service colleagues for them to check guides, step by step, directories, whole content sections... it's not ideal

In Cumbria we got around this issue using separate environments, and Entity Share to push content between them https://cumbria.localgov.blog/2022/05/31/using-entity-share-with-localgov-drupal/

This may not be practical for many councils. It would be good to explore options

willguv commented 1 year ago

Big issue for Essex - also inconsistent about what's shown. A big issue for stakeholders who're being asked a lot of "an email with 20 links isn't helping"

Also more urgent than other issues as content reviewing is happening all the time

Haringey has a single read only log in to workaround this

Newcastle uses Entity Share

Content designers can share a variety of content types from single guides to whole sections, so solution needs to work for all scenarios

andybroomfield commented 1 year ago

Is also an issue at BHCC, we have used the login with limited role in the past. Does entity share require a seperate provisoned environment just for testing? That might be impractical. Would it be possible to extend preview link or create a new module that grants access to a limited set of pages? Maybe setting as a cookie instead of long links??

willguv commented 1 year ago

Hi Andy, yes Entity Share requires a separate environment - agree that this isn't practical for a lot of councils. It was very useful for us in Cumbria though

I'd like us to look at extending preview link functionality or creating something new

Can't do Product Group today sadly (you should have a cancellation) but am catching up with Stephen soon to talk about this and a few other issues. Can invite you?

willguv commented 1 year ago

Wondering if we could add another workflow state "Accuracy check" which can only be viewed by a user with limited permissions

Then create a single user account with this role, and details can be shared with services

Thinking aloud here...

willguv commented 11 months ago

Easiest - provide a "Service contact" read only login, as Haringey has done. Users would be able to view all unpublished content, but we don't think this is too big an issue. Users would have to find their content again

Also talk at Tech Group about options @finnlewis @andybroomfield @stephen-cox


Other options

Workflow access - a way of restricting view of unpublished content (eg by url or entry in services menu) . Provide documentation on config options

Workspace - could be created for staging etc or for a single guide which could be shared with a service contact

https://www.drupal.org/project/workspace

willguv commented 11 months ago

Andy:

Brighton takes read only login approach, and also sometimes publishes on staging environment. Looking at Entity Share

BHCC comms like the temporary link idea, but needs to work for multiple pages

Thoughts:

Need to make sure the public can't discover the log in screen as they'll try to log in with MyAccount

Adnan-cds commented 10 months ago

I'd like us to look at extending preview link functionality or creating something new

Yeah, that's what I was thinking. This is how it should work:

Example:

I must say I haven't tried anything like this. The whole thing may not work or prove too complex.

willguv commented 10 months ago

Thanks @Adnan-cds

Any thoughts @andybroomfield @stephen-cox @finnlewis? Worth chatting about it at the Tech Group too?

willguv commented 10 months ago

@stephen-cox separately, could we specify a new read only "Service contact" role to go along with the Service contact work you're doing elsewhere?

Is this a lot of effort?

andybroomfield commented 10 months ago

It might be a bit simpler than rewriting links, just using hook_node_access and then maybe using either condition field or entity references to determine whats allowed. Theres also the issue of nodes that are linked into landing pages but not yet published so they don't show on landing pages unless you have permission to view them.

Its something to think about and possibly worth those interested getting heads together post Drupal 10 to work out the best approach.

markconroy commented 8 months ago

Anyone tried the "Preview Site" module? Looks like it might do what we want here and is created by the same developers as the Preview Link module.

https://www.drupal.org/project/preview_site

However, it does add Tome and other modules to the site as well as preview_site itself, so might be a heavy duty piece of work.

stephen-cox commented 8 months ago

@stephen-cox separately, could we specify a new read only "Service contact" role to go along with the Service contact work you're doing elsewhere?

Is this a lot of effort?

@willguv This shouldn't be a lot of work, but as it's a self contained task I would suggest creating a separate issue for this. There's already too much stuff going on on the email notification issue and it's possible for someone else to pick up if they get to before I do.

stephen-cox commented 8 months ago

Anyone tried the "Preview Site" module? Looks like it might do what we want here and is created by the same developers as the Preview Link module.

This has an interesting approach to this issue:

Extends the paradigm of the Preview link module to the concept of previewing more than one item of content, by way of a static site.

It looks to create a static site for each preview. I doubt this is a simple drop-in solution though as there's going to be some hosting setup needed to allow multiple previews to be deployed. I would also imagine creating a static copy of a large site is going to be quite time consuming and resource hungry. Could be worth evaluating through.

finnlewis commented 8 months ago

What about recommending using workspaces for this sort of thing?

Workspaces is part of Drupal core experimental, but I've tested it with guides and step-by-step and it works.

https://www.drupal.org/docs/8/core/modules/workspace/overview

I did run into some problem with subsites, but I'm sure we could work through issues if we wanted to go this route.

I wonder if/how preview link would work with workspaces.... ?

markconroy commented 8 months ago

@finnlewis workspaces sounds like a very good idea and definitely worth some investigation.

andybroomfield commented 8 months ago

We'd also need to check how this works with caching, as if we used the same urls and a CDN or varnish cache is in use it might be that pages that anon users browse get saved to serve all anon traffic so there is potential for data leakage.

I like the approach of creating a static preview, but it should limit it to just the pages being previewed as otherwise there will be 1000s of pages generated, the use case is previewing a section as it would appear when published, so a way of bundling a set of pages or everything under this page, if the module linked above can do that.

andybroomfield commented 8 months ago

So reading it more closely

Content editors can create unlimited preview sites - each site consists of one or more pieces of draft content they wish to share with non-authenticated users to preview before publishing

andybroomfield commented 8 months ago

This is what the admin screen for preview site module looks like, would be nice if it could use wildcard urls.

screencapture-bhcclocalgov-test-admin-structure-preview-site-builds-1-edit-2023-12-08-13_48_58

It then builds a static site, but (at least in default config, havnt dived into settings yet) the links are all back to the main site.

Screenshot 2023-12-08 at 1 53 02 pm
markconroy commented 8 months ago

This looks very promising. Thanks @andybroomfield

willguv commented 7 months ago

Hi @andybroomfield @finnlewis @markconroy @stephen-cox it would be good to restart the conversation about this as it's still amongst the most wanted fixes for content editors - just discussed again in a content session

willguv commented 7 months ago

Preview Site looks like the best for non authenticated users - see Andy's demo above

x What infrastructure is required? x What technical support would councils need to install and use? x Have to specify every individual item to be included in the Preview Site

Adnan-cds commented 7 months ago

It might be a bit simpler than rewriting links, just using hook_node_access and then maybe using either condition field or entity references to determine whats allowed.

On a form dev site, I am using the newest preview_link which is version 2.1.0-alpha2 and this may have implemented something like the above. This is how it works:

Screenshot of the preview link form follows: screenshot-preview-link-edit-form

Not bad :)

willguv commented 7 months ago

@stephen-cox please install on Product site - thank you!

andybroomfield commented 6 months ago

Require a config option (can't find it in the UI) for preview_link.settings.yml set the key multiple_entities: true

stephen-cox commented 6 months ago

@willguv This is now on the product site. You can now add extra content when generating a preview link.

It looks like we'll need to make some changes to accommodate it though. This is an unpublished guide overview: https://product.localgovdrupal.org/preview-link/node/120/755882c3-d07f-4dca-8bbd-5d18f7348efb

The guide pages are not in the navigation even though they are accessible:

willguv commented 6 months ago

@stephen-cox this looks promising - thank you!

When clicking "Preview link" for a Guide overview, are all the linked guide pages automatically populated in the entities list?

I think we should remove the Drupal-isms. The content group can help with new wording

Is it possible to include a control to vary the expiry time (either per link or somewhere in config?)

What else would we need to do please?

stephen-cox commented 6 months ago

When clicking "Preview link" for a Guide overview, are all the linked guide pages automatically populated in the entities list?

It's a manual job to add all the links you want to preview. We could build a form to do this automatically for things like guides and step by steps, but it would a chunk of work.

Is it possible to include a control to vary the expiry time (either per link or somewhere in config?)

This can be configured at a global level; not on a given page. As discussed in Slack there's no UI for setting this, although patching the module to add a config form should be easy enough.

What else would we need to do please?

To release this as is, it's just a matter of turning it on for new sites and documenting how to do it for existing sites.

willguv commented 6 months ago

@stephen-cox patch the module to provide an UI for:

willguv commented 5 months ago

@stephen-cox could we talk at today's PG about the work involved to provide a form to add all guides/ step by step assets to a preview link automatically?

Would be good to get an estimate

We think around a day's work, followed by technical review

Let's check out why it's an Alpha

If urgent need, devs can turn on the Alpha version via the command line

stephen-cox commented 4 months ago

PR adding the admin UI which will allow sites to turn on previewing of multiple pages here: https://github.com/localgovdrupal/localgov/pull/691

willguv commented 4 months ago

Could you demo this at the next PG @stephen-cox please?

willguv commented 4 months ago

About 10 hours work

Ideally should include:

Consider size of each above, maybe needs guidance

stephen-cox commented 3 months ago

@willguv There are pull / merge requests for all this here:

willguv commented 1 month ago

See this in action at https://www.youtube.com/watch?v=rCREsyceNBw