Skip to content
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

Improve display of tags #3806

Closed
sympmarc opened this issue Jun 17, 2024 · 9 comments
Closed

Improve display of tags #3806

sympmarc opened this issue Jun 17, 2024 · 9 comments
Assignees

Comments

@sympmarc
Copy link
Contributor

sympmarc commented Jun 17, 2024

When displaying tags in the list or card view (at least), the display is rather ugly, and doesn't provide the functionality we had in older versions. This is the case even after adding Auto and enabling localization.

Here's a very simple example. In this result, the file has been tagged with two values for a Managed Metadata column: Finance and Risk. As you can see, the two values are squished together as well as being underlined, which suggests they are links.

image

I'd suggest two enhancements, the first being easier than the second:

  1. Change the formatting for the tags to list them in a more legible way. At the very least, that would mean putting some white space between them. If we can't do No. 2, then we should also remove the underline.
  2. Make the tags actual links, which filter the content for that Managed Metadata value.

I expect I could handle No. 1 -this has bugged me for a very long time, and I wish I'd already made the fix! It's probably just a CSS thing. The second is harder, and I'm not sure how to do it. (Maybe it should be a separate issue, but I wanted to capture these ideas together.)

@wobba wobba added enhancement New feature or request help wanted Extra attention is needed labels Jun 19, 2024
@kasperbolarsen
Copy link
Collaborator

Something like this is easy enough ( GitHub Copilot did most of the work)
image

I would actually prefer that the name of the tag was shown as well as the value by it self sometime doesn't make sense
image

@FelloSimon
Copy link

FelloSimon commented Jun 21, 2024

What if you don't have access to the Copilot functions?

@kasperbolarsen
Copy link
Collaborator

Then you are in a world of pains. As I recall it a GitHub Copilot license is 10 USD/month and it is worth every cent!

@kasperbolarsen
Copy link
Collaborator

I got this far: The tags are rendered ok, and the links points to <a href="?q=Tags:'{{trim tag}}'" data-interception="off">{{tag}}</a>
Getting it formatted to use the "f" argument and encoding will require a lot more work, or someone smarter then me ;-)

image

@sympmarc
Copy link
Contributor Author

I think it would be great to have a few options for tag display. The two approaches you've taken above both seem to address use cases.

@wobba
Copy link
Collaborator

wobba commented Jun 24, 2024

Someone care to PR a change to the default templates for this?

@kasperbolarsen
Copy link
Collaborator

@sympmarc How about I make a PR for this
image

And add another sample to https://github.com/microsoft-search/pnp-modern-search-layouts for the more advanced version ?
image

@sympmarc
Copy link
Contributor Author

That would be awesome. Just getting the tags to display more nicely, like in your first example, is a big step forward.

@kasperbolarsen kasperbolarsen self-assigned this Aug 5, 2024
kasperbolarsen added a commit to kasperbolarsen/pnp-modern-search that referenced this issue Aug 7, 2024
kasperbolarsen added a commit to kasperbolarsen/pnp-modern-search that referenced this issue Aug 8, 2024
@kasperbolarsen kasperbolarsen added working on it and removed enhancement New feature or request help wanted Extra attention is needed labels Aug 21, 2024
wobba added a commit that referenced this issue Aug 23, 2024
implementation of Improve display of tags #3806
@kasperbolarsen
Copy link
Collaborator

tested in 4.13 :-) Works fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants