I'm currently working on a website for a friend, doing it in HTML/CSS, finished most of it actually, but i'm having this issue that i need to solve before moving on, the website is going to have new pages and going to be updated frequently.
The thing is, there is one part in the header that is going to be updated with new text every now and then, and it should show on all pages, currently, i'll have to go thru each page and edit it. In the future when the number of pages become too big this will not be a logical way to do it if i want to change text.
I would like to learn and know if there is a way to make this particular part accessible from like one place, and when i change it in this one place changes will reflect in all other pages which will only have a link or reference to that single place.
I know it can be done in php, but i'm not a php expert and my website is already in html.
Any help is appreciated.
If you are using a program like Dreamweaver you can create library items (or something like that) but they are not very good.
I've written a simple post about how to do this with PHP. You really don't need any PHP skills to do this, and it can be done on HTML pages if you like. Have a read of this and see if it helps:
Hi ARayess, welcome to SitePoint! :wave:
Here is another thread with some info too.
Nice tutorial Ralph, I especially liked the "DOCUMENT_ROOT" tip, enabling the paths to be absolute! :)
Many thanks Erik. That compliment is especially encouraging coming from you!
Originally Posted by Erik J
Your link was useful too, as it led me to looking into the .shtml option, which I was not really familiar with.
I came to the right spot, thanks alot Ralph and Erik, i'm following Ralph's tutorial on this.
Just in case you were still interested, most server-side languages have some kind of includes system, I've added a few of the other language based commands you can insert to embed depending on which you choose to use, might be useful for other people reading the thread. :)
- SHTML – <!--#include virtual="file.html"-->
- PHP – <?php include('file.php'); ?>
- ASP – <!--#include file="file.asp" -->
- ColdFusion – <cfinclude template="file.cfn">
- JSP – <jsp:include page="file.jsp" />
PS: What do includes have to-do with accessibility? :p
Nice list Alex. Thanks
The OP said: "I would like to learn and know if there is a way to make this particular part accessible from like one place"
Originally Posted by AlexDawson
"Accessibility" means something different in common parlance.