• 0

Show Updated or New Links/Files


Question

So I maintain and intranet site. Nothing too fancy (html/css/js) and I'm doing a redesign as the old site is looking a bit tired and things are being lost under too many pages.

I see on some sites that links sometimes have "New" or "Updated" next to them and/or are a different colour. Is this something people are doing manually or is it something I can code into the design?

I'd snoop at the code of another site but I'll never manage to remember the sites that had it implemented.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

This is certainly not done manually. I would recommend doing it on server side and saving the info in cookies. A very simple example would be... a user visits a site on a Tuesday. The date is stored in a cookie called last visit. When the user logs in later information stored in the cookie is returned. Files posted after that date can be set to a different style to indicate they are new.

Link to comment
Share on other sites

  • 0

Ye, it did seem madness for someone to be doing that manually.

That sounds like a nice way to do it but how would I go about it? I don't know the first thing about implementing cookies. Assuming I could figure out the tracking how do I get it to then implement the style change?

I suddenly feel a bit out of my depth

Link to comment
Share on other sites

  • 0

May not be the best but this is how I would do it. Retrieve the list of files and the dates when they were created from database. Retrieve the date of last visit from the cookie data returned. Loop through the files data while comparing the file creation date to the date of last visit. If the file was created after last visit add a class to the html element and give a style that would make it stand out. This would be the logic. When it comes to code it depends on your choice of server side language.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.