8000 adds documents to linkit profile by markconroy · Pull Request #254 · localgovdrupal/localgov_core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

adds documents to linkit profile #254

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

Merged
merged 4 commits into from
May 8, 2025

Conversation

markconroy
Copy link
Member

Closes #253

What does this change?

  • Adds documents as an allowed type in the LinkIt matchers.
  • Sets the URL to be "canonical" (/media/123 - I think). Would we prefer this to be "Direct link to the media file"?

How to test

Try to link to a document in a wysiwyg, you should see "Document: [media - name]" for available documents in your linkit suggestions.

Have we considered potential risks?

I'm not fully sure what happens when a document is changed/gets a new file.


Thanks to Big Blue Door for sponsoring my time to work on this.

@finnlewis
Copy link
Member

Sounds like we need a bit of testing.
Hoping @ekes might be able to explain the complexity.

Also: some councils are using less ckeditor embedded buttons and are using paragraphs more.

@finnlewis
Copy link
Member

What is the expected behaviour of a LinkIt link to a document?

Is it:

a) to the canonical url of the media item (/media/123)
b) to the file that is the target of the media item? (/sites/default/files/my-file.pdf)
c) to a download link (/media/123/download)

@finnlewis
Copy link
Member

I think this is with @willguv to check with content people.

@stephen-cox
Copy link
Member

Discussing this again at Merge Tuesday - need to understand the tech complexities - will create a Slack chat on this.

@finnlewis
Copy link
Member

@willguv have you had a chance to chat about this one with content people yet? Thanks dude!

@willguv
Copy link
Member
willguv commented Nov 26, 2024

Hi @finnlewis not yet sorry - thanks for the nudge

Can we describe in content designer language what this PR describes? Or can we spend a bit of our session next Monday looking at it/ writing something?

@finnlewis finnlewis marked this pull request as draft December 3, 2024 12:23
@finnlewis
Copy link
Member

Discussing this with @willguv , this is part of a bigger review about how we want to guide people on best practice for displaying documents. Converting to draft for now.

@willguv willguv moved this from 2025 'Refresh' mission [REFINE AND PRIORITISE] to In Progress - Core team in 2025 Refresh/ Editor experience Apr 3, 2025
@willguv willguv moved this to Ready in 2025 Priorities Apr 3, 2025
@willguv
Copy link
Member
willguv commented Apr 10, 2025

@finnlewis @ekes I'd like to make some progress on this before the 24th April newsletter if possible

@benhillsjones asked for:

As a content designer
I need to insert a document at a specific point on a page and give it custom link text

I think @markconroy's PR does this, and there's three questions outstanding:

  1. whether to add file type/ size to links created in this way. I'm thinking not, we can add this later if requested

  2. what to link to

a) to the canonical url of the media item (/media/123)
b) to the file that is the target of the media item? (/sites/default/files/my-file.pdf)
c) to a download link (/media/123/download)

I haven't received specific feedback from content folks, but think b) is expected. A user will see the kind of file they're downloading

  1. What to do about upstream caching?

Would be great to get your thoughts on these Qs and anything else. Thanks

@ekes
Copy link
Member
ekes commented Apr 17, 2025

I haven't received specific feedback from content folks, but think b) is expected.

I assume this should work. But it means you need to make it so you replace that original file (that filename at that path) if there are any changes to it. This isn't default Drupal behaviour, but I'd guess it can be made to do so. I don't think I've looked into how yet, mind.

@willguv
Copy link
Member
willguv commented Apr 17, 2025

Or upload a new media item and re-do the link? @ekes

I think that's how Wordpress behaves

@ekes
Copy link
Member
ekes commented Apr 17, 2025

Or upload a new media item and re-do the link? @ekes

If you've remembered where the links are; and no one has saved the old direct link (including Google etc).

@willguv
Copy link
Member
willguv commented Apr 22, 2025

Moving @finnlewis' comment from #253

Discussing with @danchamp , received wisdom on presentation is:

The link to the file should:

  • describe the information contained within the file
  • the file type
  • the file size

Actual file name?

  • don't expose them. Listening to a file name in screen reader is often horrendous!

Other thoughts:

  • Having a download link that obfuscates the file name helps with cache issues

So how about this approach @finnlewis @ekes?

  • an editor types in text and highlights the part they wish to create a link from
  • they click the link icon, search for the doc name and select it
  • if the doc is external, the editor adds a url and then selects it
  • a link is created to the doc including the highlighted text, file type and file size
  • the link is the canonical url of the media item (/media/123)

Is this a big change from @markconroy's PR? Thanks all.

@willguv willguv removed the status in 2025 Priorities Apr 24, 2025
@willguv
Copy link
Member
willguv commented Apr 24, 2025

Let's do a design sprint/ afternoon in May

@finnlewis
Copy link
Member

@keelanfh
Copy link
Member
keelanfh commented Apr 28, 2025

Re changes to file names with new versions - at Essex in the LGD implementation we blocked search engines from crawling documents, because I was fed up of answering requests to take down outdated documents from Google search.

We did this in nginx but you could do the same in HTML with an <a rel="nofollow"> attribute on the links.

Wouldn't solve the issue of people saving old links, but could be worth considering.

Using the canonical media URL makes sense but I'd be curious to see search engine behaviour in this case (e.g. is it a temporary or permanent redirect)

@finnlewis
Copy link
Member
finnlewis commented Apr 29, 2025

We're looking to arrange a mini sprint on this, 2 hours co-working.

Suggesting at least the following:

@Adnan-cds @ekes @markconroy @willguv @finnlewis @NikLP @stephen-cox

@willguv suggesting 09:30 -11:30 on 8th May.

We also have the general question of how to present documents that are attached to pages, including how to specify the 'name' of the file.

https://demo.localgovdrupal.org/test-subsite-demo-all-components/test-pages-documents

image

@NikLP
Copy link
Contributor
NikLP commented Apr 29, 2025

@finnlewis Would it be wise to rope in someone with enhanced accessibility/usability chops? Seemed like Dan C had a good amount of sane things to say when we brought this matter up in tech drop-in a couple of weeks ago. Presumably Maria is another viable option.

@willguv willguv moved this to In Progress - Core team in 2025 Priorities May 1, 2025
@willguv willguv moved this from In Progress - Core team to Ready in 2025 Priorities May 1, 2025
@willguv willguv moved this from Ready to In Progress - Core team in 2025 Priorities May 1, 2025
@finnlewis finnlewis marked this pull request as ready for review May 7, 2025 21:02
@willguv
Copy link
Member
willguv commented May 8, 2025

@finnlewis
Copy link
Member
finnlewis commented May 8, 2025

Discussing this in our mini-sprint:

  • Current functionality allows linkit to link to a media item, but the linkit matcher actually links to the cannonical rather than the file path.
  • We can change this in the matcher to link to the acrtual file rather than the canonical.

Those present seem to mostly be in accord that we should change the linkit behaviour to link to the file, for consistency with the existing media embed behaviour.

We will then create separate issues for

  1. whether to link to /media/123/download rather than the actual file path
  2. replacing the target file (for example, an updated policy or report)
  3. how to display links to files ( name / size / type etc)
  4. cacheing issues with upstream (same filename / different file)

@finnlewis finnlewis merged commit e59db60 into 2.x May 8, 2025
28 of 29 checks passed
@github-project-automation github-project-automation bot moved this from In Progress - Core team to Done in 2025 Refresh/ Editor experience May 8, 2025
@github-project-automation github-project-automation bot moved this from In Progress - Core team to Done in 2025 Priorities May 8, 2025
@willguv willguv moved this from Done to In Progress - Core team in 2025 Priorities May 8, 2025
@willguv willguv moved this from In Progress - Core team to Done in 2025 Priorities May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Make it easier to add documents to pages
7 participants
0