View Full Version : Layout questions
Save the trees 08-01-2005, 07:00 PM Hi all. Well, I'm new at learning CSS and I have a question that I'm hoping someone can answer. To start on my site, I'm using the layout from here called "Basic two column layout with header" http://www.lissaexplains.com/css3.shtml
I want to know if there is a way, on all my pages, to have just the left navigation bar stay the same on all my pages (like, if I had to update my bar with another link, it will change on all of the pages). Right now, if I want to add a link to the bar, I'd have to change it on every page.
If it helps I can provide a link to my site, just ask.
luvhartz 08-01-2005, 07:06 PM Hi all. Well, I'm new at learning CSS and I have a question that I'm hoping someone can answer. To start on my site, I'm using the layout from here called "Basic two column layout with header" http://www.lissaexplains.com/css3.shtml
I want to know if there is a way, on all my pages, to have just the left navigation bar stay the same on all my pages (like, if I had to update my bar with another link, it will change on all of the pages). Right now, if I want to add a link to the bar, I'd have to change it on every page.
If it helps I can provide a link to my site, just ask.
What i am suggesting isnt CSS, but you could use SSI includes its found on lissas site under HTML. But basically, you make a page (nameofpage.txt) with your menu on, and then on your other pages in the appropriate place where you want the menu you use this tag:
<!--#include file="nameofpage.txt" -->
then when you want to change your menu you just change the .txt page
correct, SSI or PHP includes would be the solution you are looking for. doing a search for those should turn up some already discussed answers.
or an alternative is to use a frame setup or iframes.
Save the trees 08-01-2005, 07:23 PM Alright, thank you, I will give that a try. Would I have to change my file names to .shtml?
I will post an example of what I mean though. I found this site and it's HUGE, but on every page the left column is exactly the same. But those pages aren't named .shtml.
http://toughpigs.com/index.htm If you click around it's easy to see that every column is the same. Is what's on here the same kind of thing you've suggested? (I'm just trying to understand a little better)
Edit: No, I don't like frames, I'm going to stay away from frames. I just want to know if there's an easier way. I will give this a try and if it doesn't work (though it should), I'll be back to troubleshoot! ;)
oldcrazylegs 08-01-2005, 07:25 PM Not every host offers Server-Side Includes. If you host doesn't there is another way around this. You can do the same thing with JavaScript Includes.
Let's say you wanted to put the following text on everyone of your pages.
<p>I want this text on all of my pages</p>
I would copy and paste that paragraph into the top textarea of the following tool to turn it into a document.write After doing pasting it click the "convert code" button to see the new code appear in the bottom textarea.
http://dwight.tendirect.com/a/blscr02.htm
Below is what the code will look like.
document.writeln('<p>I want this text on all of my pages<\/p>');
Paste the code into Windows Notepad or some other text editor and save it as "include.js" without the quoutes. I could have used any name here but I chose include because it best described what I was trying to do.
Now you put the following code into every page you want that text to appear in.
<script type="text/javascript" src="include.js"></script>
luvhartz 08-01-2005, 07:29 PM lissaexplains used SSI (BTW yes you do need to name your pages .shtml), that site uses I-Frames. Theres a section in the frames section at lissas again, and i actually use them when i make a layout.
Basically you make a separate page and call it whatever you want, it can .htm , .htm whatever. Then on the page you want it to apear you use this code:
<iframe src="name of page.watever" width="number" height="number" scrolling="no" frameborder="number"></iframe>
^^^ you can also change the scrolling="no" i have it as "auto" so as it grows, it makes a scrollbar :)
EDIT: your links may need a different target, i believe it is target="top" another alternative is target="blank" it depends what you want
Save the trees 08-01-2005, 07:38 PM Okay, I don't think my host can allow the server side includes, so that's out.
luvhartz, if I try the iframes like you just suggested, is there a way I can keep my background continuous the way that I have it now? www.freewebs.com/redwallfan
luvhartz 08-01-2005, 07:40 PM you can make the iframes transparent would that help?
EDIT *found code* if its what you are after, add this to your iframe code:
allowtransparency="true"
sooo it will look something like this:
<iframe src="name of page.watever" width="number" height="number" scrolling="no" frameborder="number" allowtransparency="true"></iframe>
EDIT AGAIN: i think iframes would be best but for future reference freewebs do allow SSI
Save the trees 08-01-2005, 07:55 PM Cool. I tried it out on one of the pages, and I really like it. The only thing I can't fix is the background. Take a look: http://www.freewebs.com/redwallfan/nothing.html
On my page where the iframe is saved, should I have no background there?
Save the trees 08-01-2005, 08:08 PM Sorry for double posting, but I ran out of edit time.
Fixed the background issue, and the links are opening in the right spots now, but for some reason, they keep opening new windows. That's just a links issue though, and I think I can fix that one myself. Thanks for all your help on here, it works great! (And looks great too)
luvhartz 08-01-2005, 09:17 PM ok, your welcome and anytime :) if you need anymore help feel free to pm or email me, kerrygamble04@hotmail.com
|