1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Rep Power

    Easy updating news sidebar?

    Hi everyone,

    Really new to web development and learning a bit of HTML5 and CSS. I'm working on a site that needs an announcement bar to appear on every page. At the moment, every page has the structure code for the sidebar, but I'm curious as to how I could keep them linked.

    In other words, what would be an effective way so that when the site goes live, I can add news and announcements and then have it change for every page that the sidebar appears on?

    I'm also a little confused about these announcement sidebars in general. Do most people add stuff by actually editing the source code for the website? Like actually go in and add a new announcement element to the sidebar?

    Or can you do something more roundabout like create a page that is not accessible to the general public that has a form where you can type new information to send to all the other pages?

    Is this something that can be accomplished simply? Or is this something that requires javascript?


    P.S. Hope the question made sense.
  2. #2
  3. Code Monkey V. 0.9
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2005
    A Land Down Under
    Rep Power
    Most of the time any site that has a 'news' section will use some form of blogging software so make it easier. That also lets them integrate any sort of 'Latest News' easily, because it's all in the same system.

    Of course, if you have a static HTML site that's not going to help. There's a couple of options:

    First is to update the source code of the pages every time you update the news area. That's really the worst way to do it because it is very easy to miss one or two pages every update.

    Second way is to use server-side-includes (if your server allows this) or use a server-side language like PHP to include a single file into your HTML layout that contains just the sidebar code. That will let you update only one file, but have that single file be included on every page that it needs to be seen on.

IMN logo majestic logo threadwatch logo seochat tools logo