I think you have to use PHP for thatOriginally Posted by 768768
<? include../(file)?> or something like that I'm not to sure.
If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the largest domain name community on the internet and continues to grow every day. There are over 105,000 domainers on DNForum doing everything from buying domains, selling domains, learning about domains and discussing domains. Take a minute and Register.
Register Today on DNForum IT'S FREE!I know basic HTML... just getting to CSS.
I want to place a number of text links on several pages of a website. I would like to have these text links in one place where I can update them and have it updated on all pages. So I don't have to manually make the changes on all pages. I don't know if I explained myself very well but is this possible?
Thank you.
I think you have to use PHP for thatOriginally Posted by 768768
<? include../(file)?> or something like that I'm not to sure.
Not what I wanted to hear but thanks for the response.
So what did you expect ?
Using include files is the way to go
NameNewsletter.com - free lists of available domain names
ZoneFiles.net (beta) - ccTLD and gTLD droplists
Create a file that has all your links in it and name it something like links.html. Then on your pages, use <!--#include file="links.txt" --> where you want the links to go.
You can set up the links.html file any way you want, so you could use an unordered list, table, ect. Where ever <!--#include file="links.txt" --> appears, the contents of links.html will be printed. The files have to end in .shtml, though, instead of .html.
http://imgshark.com Free image hosting, No account needed, 5mb upload
If you use the software Dreamweaver you can select the code you want to update on all pages and add it to the library. This way when you update one you update them all without the need of includes and it works with static HTML pages.
Enterprise Communications and Social Media in Uist
Read up on SSI here: http://www.bignosebird.com/ssi.shtml
SSI=server Side Includes. Will work for your purpose very well.
PHP includes are very similar
Good Luck!
Don't have Dreamweaver but #include file is what I was looking for. And the link cursal posted was helpful.
Thanks guys. I appreciate it!
One method would be to convert your .html pages to .shtml and use server Side Includes (SSI).Originally Posted by 768768
You could use php, ssi or javascript to include a file.
If you want to use ssi, you do not need to change your pages to .shtml if you are able to use .htaccess.
Yes, javascript would do it too.
Create a file called "links.js" and enter your links in document.write(); statements like so:
Then call it from a SCRIPT tage like so:<!--
document.write('<a href="http://www.link1.com">link 1</a>');
document.write('<a href="http://www.link2.com">link 2</a>');
//-->
<SCRIPT SRC="links.js"></SCRIPT>
★ Neil Hillman - Web Developer, Pixel Pusher...
Thanks, guys. Everything works like I think it should but...
When my files were .html files I could click on them and view them via IE locally - on my computer. I could view it before uploading to make sure everything is ok.
Now that they're .shtml files I can no longer view them. I have right clicked on them and chose "use IE to open" but nothing. Of course I need to view the pages before I upload them so what do I do? I'm using WIN XP home edition with the latest v of IE.
Is there some way I'm suppose to convert .html to .shtml? All I did was rename them. It seems to have worked except for the above problem.
Help!
I would prefer using PHP includes to SSI.
Profoundly influenced by #Bauhaus, @Nameslave unrepentantly embraces #Minimalism in his #multimedia portfolio. His early works include an experimental adaptation of Chekhov’s Cherry Orchard inspired at least partly by Robert Fripp. His totally irrelevant M.Ed. dissertation examines Organizational Culture and Change Management.
You did the right thing, you just have to rename the files.Originally Posted by 768768
To edit the .shtml files, open them up in a html editor such as dreamweaver.
nameslave: Thanks but I don't know PHP. It's next but I have to get thru html first.![]()
dcristo: Thank you. I can edit the files (I usually just use notepad) but after editing, I want to be able to see the actual page b4 uploading them. I can no longer do that after I renamed them to .shtml.
The pages worked after you uploaded? They should still be viewable in IE even with the .shtml extension. The included part will not be visible, but everything else on that page should be.
http://imgshark.com Free image hosting, No account needed, 5mb upload
Pages worked fine after uploading. But the pages are not viewable in IE. I even renamed them back to .html and then I was able to view them again. Renamed them back to .shtml and nope.
Since you say they should still be visible it must be something with my system. But I'm at a lost as to what to do now. I right click on the file... click on "open with IE"... it doesn't do anything.
If the dynamic portion of the included file contains broken table structures, the files won't display correctly locally. Try uploading them to a test portion of your web site in order to preview.
I'm not a PHP expert either. But to use PHP includes, you only need to:Originally Posted by 768768
a) rename your .htm(l) files to .php
b) add an include tag (very much like any other HTML tag)
c) create a separate .inc file (rename from a plain text file) which holds the data you want to change more often
The best thing is: it is fast and powerful. I use PHP includes to write most of my web pages now (in "building blocks") so I can change site-wide changes by modifying just 1 single file (the .inc one).
Search over at Google for e.g. "php incudes" or go straight to php.net for some entry-level tutorials, and you'll find they are not much different than HTML. Hope this helps.
Profoundly influenced by #Bauhaus, @Nameslave unrepentantly embraces #Minimalism in his #multimedia portfolio. His early works include an experimental adaptation of Chekhov’s Cherry Orchard inspired at least partly by Robert Fripp. His totally irrelevant M.Ed. dissertation examines Organizational Culture and Change Management.
No, no tables. My original intent was for text links which I would be able to easily change when I wanted to. I didn't like the way they looked so I have one which is just AdSense and another which is just a copyright footer.Originally Posted by Acroplex
I have noticed when the files are .html that locally they have the IE logo. When they're .shtml they just show the .txt logo. For some reason my system is not associating IE with them... even when I tell it to open the files with IE. Something I would like to figure out but I think I'm going to try the php or java script suggested by nameslave and Mr.Domains.
Thanks, nameslave. I did find this http://www.ibdhost.com/help/templates/ which I found very helpful. I've included the link as other newbies may find it useful.Originally Posted by nameslave
A question that comes to mind with php though... If you're "calling" all your pages, none of the content is actually there for the search engines, is it? You know, content is king. I must not be thinking about this right or it wouldn't be so popular. But how are the SE reading your pages if most of the content is in other files?
Thanks!
Last edited by 768768; 11-06-2005 at 11:09 AM. Reason: Automerged Doublepost
Bookmarks