June 14th, 2012, 09:01 PM
Easy updating news sidebar?
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?
P.S. Hope the question made sense.
June 14th, 2012, 11:23 PM
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.