How can i make this?

Hi SP

I am currently working on a smaller project where i try to achieve something similair to when you visit a online store and get these options “all” “small” “medium” “large” through a sidebar/nav or similair.
When you etc tick “small” off “all” also ticks off and and the options where “small” only is abaliable this “category” will dissapear and all of the remaning “large” & “medium” stays and ofc align together, also the pagination has to shrink.

I hope you get an idea of what i am thinking, how can i achieve this? which language will be used, i assume html,css,mysqli,php,jquery/ajax? any tutorials or keywords i guess i have to build a database system?
What i will use it for is something a bit different to what the shop/store use it for, i will use it for my youtube channels videos, i make different videos like no commentary, highlights & cinematics etc etc so it would be nice if people could tick off the categories they dont like and only get to watch the ones they like?

Could anyone help me out here?

not sure i can offer you constructive suggestions, but the database portion of what you’re looking for is extremely minimal

perhaps as in the javascript forum

Okay thank you i will try :smile:

Please don’t create another thread. I’ve moved this one :wink:

Sorry i think i did, :oden:

Hey there,

This is called filtering, usually this type of thing is done server side by add query string params such as ?size=small to the url and then returning just those items in the page.

Can be done in javascript too by either tagging the items in the list with something for the different sizes like a class name.

<li class="item item-small item-medium" />
<li class="item item-large" />
<li class="item item-medium" />

Then you want to show and hide those elements whenever the filter buttons or checkboxes are changed. Make sense?

1 Like

Yes this is exactly what i want, hide/show the elements, if this is usualy done serverside i would like to do it with php.

So lets say i have 5 things i want to tick off

  1. Videos
  2. Cinematic
  3. Pvp
  4. How to
  5. Guides

I could filter all of these if i want to?

Also how difficult is this ?

[quote=“applytobecome, post:7, topic:211341, full:true”]I could filter all of these if i want to?

Also how difficult is this ?
[/quote]

Yes you can filter those.

The techniques that are used differ, depending on if there will be 10 items, or 10,000 items to filter.

With numbers below 100 it can easily be done on the page with JavaScript.
Items over 1000 are better done by sending a request server side for processing.

Have you worked out what your maximum number of items to filter, will be?

1 Like

Hi Paul.

There will be a ton of videos eventually over 1.000 by time (This will take long but eventually)

What do you suggest?

Christian.

With that many videos, having the full list of videos loaded to each and every visitor then filtered by JavaScript is infeasible.

I suggest instead that you store a list of the videos and their keywords server-side in a database, and query that database for the results that should be shown on the screen.

In other words, I don’t think that JavaScript is the solution that you’re looking for.

1 Like

It might be part of the solution though, if you want to use AJAX

Although if you do use that it wouldn’t have anything to do with the original concept and would be for other purposes such as creating an endless scroll to match the search criteria.

No no not all in one page, i want pagination and when you tick off etc “fails” the pagination will shrink and and the videos of “fail” on the current page has to dissapear, if this makes sence :slight_smile: ?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.