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

Add tag dropdowns #690

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

LDannijs
Copy link
Contributor

@LDannijs LDannijs commented Nov 1, 2023

Summary

Add a dropdown menu that lists certain types of tags to filter through the devices.

Screenshot 2023-11-01 at 13 55 23
Screenshot 2023-11-01 at 13 55 36

Changes

  • add rudimentary code for tag dropdown
  • added a bit of styling (just for testing mainly)

Note

This is basically the same PR as #680 but i accidentally deleted the fork. Whoops. Please refer to that PR for the discussions around it.

@pierrephz
Copy link

Device.Repo.Homepage.Proposal.mov

here is a proposal for an uplifting of the Device Repository home page
Open for feedback

cc @KrishnaIyer

Expend to view the mockup

desktop-device-repo

@pierrephz pierrephz self-assigned this Nov 15, 2023
@KrishnaIyer
Copy link
Member

KrishnaIyer commented Nov 30, 2023

This looks really fantastic. @wienke @kschiffer please review the new design. @mjamescompton: Can you please comment on the SEO implications?

@KrishnaIyer
Copy link
Member

@pierrephz: Where does the Submit Your Device button lead to?

@mjamescompton
Copy link
Contributor

These filter need to work for everything page type not just the homepage.

For now I think we are good having a page that contains every single device in the repo but at some point this page will become very slow. This may in happen when we start to parse the json and render everything when we are not using our Shinny new M1's. At this point it might time to add a more curated homepage #188 and then spilt the devices up in to categories.

Our second most valuable page other then the homepage is https://www.thethingsnetwork.org/device-repository/tags/temperature/ (we can still get this page a little higher if we complete this task #185 @KrishnaIyer )

This tag page will also need these filters as there are already to many devices on this page.

For this work the filter need to populated based on the content on the page and the page need to contain all devices already in the html.

I think the best way to do this is

With a JSON object containing all the device data on a page (homepage, tag, or device maker) on the page. We would still have all the devices on the page in html when it loads, this json object will also be there ready for js to consume. When the filter dropdown is press we could rebuild the devices list from this json

The json object will be generated by hugo, I believe as we are already requesting the tag we will already have an object with the devices from that tag and it might even already have the attributes. We are already generating something similar to this json object on the single device page website/layouts/devices/single.json.json which is imported into the page

<script>
  var config = {
    device: JSON.parse("{{ .Params | jsonify }}")
  }
</script>

We need to write the custom js to filter the elements.

@mjamescompton
Copy link
Contributor

mjamescompton commented Nov 30, 2023

@pierrephz

I think we should also add sorting as well as filters and they should be visually different from each other.

The sorting should include

  • Featured order - (Lets add a order number somewhere and then sort by that)
  • Title - A-Z
  • Title - Z-A

Can we think of any more? Maybe creation date if we have it.
Vender could be both sorting and a filter

Screenshot 2023-11-30 at 13 52 31

There are things like weight

and from the dimensions we could get a size value

Screenshot 2023-11-30 at 13 54 07

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

Successfully merging this pull request may close these issues.

None yet

4 participants