Jump to content

Sorting articles?


JustRob

Recommended Posts

Hello guys. I'm working on a website, and right now I am working on the "articles" page. What do I want? Look at the picture. So here's the rundown:

  • When a letter is clicked, I want to show only the articles that start with that letter.
  • When All is clicked, I want to show them all.
  • Beneath that is a dropdown menu. When it is clicked, it shows the options "Title", "Author", and "Date". I want it so that when one of these options is selected, and "go" is clicked, it sorts the articles by that criteria.
  • Next to that is an input box that shows "xx items per page". Same story, I want it so that if a number is entered and go is clicked, it shows that amount of items per page.

bpgLORg.png All of these should obviously also work in combination with each other. And now for the problem: I have no idea how to make this. I know HTML and I know CSS, but I can't figure this out. Could anyone give me advice or point me in the right direction?

Edited by JustRob
Link to comment
Share on other sites

Neither HTML nor CSS will do this. At mimimum Javascript will be required if you wanted to sort the articles in the users browsers without a reload, or with a server side language leveraging the backend to sort the content before the page loads, and would require a reload of the page for each new sort.

Edited by thescientist
Link to comment
Share on other sites

1. How much JavaScript do you know? This is mostly a JavaScript project. Maybe AJAX if there's a lot of data involved. 2. Are you planning to hardcode the data into your document? Is it stored in a database? In an XML document? Doing as much preparation on your server before sending it to the browser could really speed things along. The data could even be stored in an easily editable "flat file," which would save you from having to update a lot of HTML every time you need to make a change.

Link to comment
Share on other sites

This is probably best as a PHP project, actually, with a database that can retrieve data by letters. The most Javascript would be involved in, is to make a request to PHP to do this without reloading.

Link to comment
Share on other sites

Much harder than HTML or CSS (which are not programming languages), but not anything as difficult as C or C++ because there's no memory management.It's a programming language (some may argue it's a "scripting language") so principles of programming need to be learnt to use it. The W3Schools tutorial is good, but it might fall a little short. http://php.net/ has a manual with more information which you can refer to after studying the W3Schools tutorial.

Link to comment
Share on other sites

The only way I see what you requested getting done correctly without PHP is to have hundreds of HTML pages with links between eachother, and that's one tedious site to work with. Just a little example of the list of pages you would need without a programmed system:All - page 1All - page 2...A - page 1A - page 2...Z - page 1Z - page 2...A Guide to EvilGame Creation Process... If you want this done soon, you can ask somebody else to do it in PHP, else you can learn PHP and do it yourself, though that's going to be a slow process. Edit: Hey! there's a third option. You can look for a content management system that's already built for this as well. Unfortunately, I can't name any specific ones at the moment, I'd have to search for it on Google (or you can use your favorite search engine)

Edited by Ingolme
Link to comment
Share on other sites

Managing hundreds of HTML pages is virtually impossible, I don't have that much free time nor the strength of mind to not go insane while doing it. That was never an option to begin with. Alright, I guess what I want to know now is what else can I do with PHP. You may have noticed in my screenshot earlier there's a login field. Eventually, I want to make it so people can register and log in on my website, have their own profile page, and the ability to submit articles and videogames (which will then be moderated by me and either accepted or denied). Does that also fall under PHP? Because in that case even if it takes a long time, it's worth learning. I do have the idea to get this website running and manage it, and I doubt anyone would invest that much of their time for free.

Link to comment
Share on other sites

Edit: Hey! there's a third option. You can look for a content management system that's already built for this as well. Unfortunately, I can't name any specific ones at the moment, I'd have to search for it on Google (or you can use your favorite search engine)
I actually tried this, with WordPress. But turns out WordPress is simply a "blog" type of system which I do not want. I want my website to look and function exactly as I want to, as in the above screenshot. Unless that's possible, it's not something I will consider.
Link to comment
Share on other sites

Managing hundreds of HTML pages is virtually impossible, I don't have that much free time nor the strength of mind to not go insane while doing it. That was never an option to begin with. Alright, I guess what I want to know now is what else can I do with PHP. You may have noticed in my screenshot earlier there's a login field. Eventually, I want to make it so people can register and log in on my website, have their own profile page, and the ability to submit articles and videogames (which will then be moderated by me and either accepted or denied). Does that also fall under PHP? Because in that case even if it takes a long time, it's worth learning. I do have the idea to get this website running and manage it, and I doubt anyone would invest that much of their time for free.
PHP and MySQL are used for register/log-in systems.
Link to comment
Share on other sites

I just hope I can pull it off... PHP programming is as far as I'm concerned a minor problem. I know how variables, operators, and if statements work, all I'd need to learn is PHP's way of writing the syntax. But this MySQL database stuff is confusing the ###### out of me.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...