Jump to content
xisto Community
Damen

Need Help On "global News" Problem. Change paragraph of text with CSS style change?

Recommended Posts

I am making a website for my IT Support class and a program called "Cox Connects Kids" for my mid-term assignment. Now I have the whole layout made and I will post a screen shot down lower.

 

My basic problem/question is this:

 

I have a right section of the page(A div) and it is supposed to be a global news part that shows the same on every page(I.e. home,contacts,help) and I was wondering if I can somehow edit my CSS file to have it in there and just change it the one time for all the pages.

 

I am guessing there is some way to do this but I couldn't figure it out.

 

If any of this was unclear please ask me to explain further on any points.

 

A screen shot: (Right part entitled "Global News1/2")

Posted Image

 

Thanks in advance for any help.

Share this post


Link to post
Share on other sites

Grrr, I was hoping that it wasn't going to come to that.I will have a look at the tutorial though. I know quite a bit about PHP. But the problem that I was coming up with was that I was told by my adviser that the district will have to do something with the HTML file and convert it to some kind of file with "nuke" in the name, it wasn't "PhpNUKE" though, I know that.So I will have to ask him tomorrow if the server we have will be able to run any PHP.Thanks for the reply I will edit this post with more information when I get any confrimation, and looked through the tutorials.-EDIT-All right! Well it looks quite easy to do after looking through the tutorials but again I will still have to see if they can be PHP files instead of HTML.

Edited by Damen (see edit history)

Share this post


Link to post
Share on other sites

You can avoid PHP if you want. Using some clever Apache knowledge, you can get another file included in a document. All you need to do is put this line in where you want to load the external document, then rename the file with the extension .shtml

<!--#include virtual="INCLUDE.html" -->

I use it on this site to get the menu to appear on the left (ignore the poor CSS :rolleyes: ). I have a file called menu.html which I include in every other page using the code above (with INCLUDE replaced with menu, obviously). Then I renamed all the files that include the menu to have the .shtml extension.

Share this post


Link to post
Share on other sites

You can avoid PHP if you want. Using some clever Apache knowledge, you can get another file included in a document. All you need to do is put this line in where you want to load the external document, then rename the file with the extension .shtml

<!--#include virtual="INCLUDE.html" -->

I use it on this site to get the menu to appear on the left (ignore the poor CSS :rolleyes: ). I have a file called menu.html which I include in every other page using the code above (with INCLUDE replaced with menu, obviously). Then I renamed all the files that include the menu to have the .shtml extension.

Okay well I copied all the files to try it this way.

I went into the index.html to test it out, took out the "News Part" and replaced it with
<!--#include virtual="globalnews.html" -->
. I made a new HTML file named "globalnews.html" and put what I took out of the index in there. I then changed the extension of the index to .shtml.

Went to the index.shtml and there was nothing in the news...

Anything I might have done wrong, or do I need to install apache to see the effects without uploading?

Share this post


Link to post
Share on other sites

check with rvalkass for the correct .htaccess file information on that method

also, I found a code snippet which might work for you using standard (?) html. Treat the menu as an Object and include the html file?

<object type="text/html" data="linktest.html" width="600" height="40">  <param name="BorderStyle" value="1" />  <param name="MousePointer" value="0" />  <param name="Enabled" value="1" /></object>
I have not had a chance to test this method myself, yet.
Reports are that it is slow and also, IE may have some trouble with it.

http://w3schools.invisionzone.com/index.php?showtopic=16231

Share this post


Link to post
Share on other sites

Went to the index.shtml and there was nothing in the news...
Anything I might have done wrong, or do I need to install apache to see the effects without uploading?


You need to have Apache running, and you need to view the file through Apache ( i.e by going to LOCALHOST/ ). You have added all the code in correctly and from the sound of it have renamed everything correctly too. The code you use is picked up by Apache as a special command it follows before it serves up the HTML. Of course if you directly open the file up in a web browser (the path will be something like file:///path/to/file/index.shtml ) then it hasn't been through Apache, so the command never gets run. If you upload it to your web hosting or use Apache on your local machine then you will be able to see the effect.

check with rvalkass for the correct .htaccess file information on that method

No .htaccess file is needed for this one - it works out of the box :rolleyes:

You can do some very powerful and useful stuff with these commands. One of my favourites is using it to issue different style sheets to different browsers. It avoids all the messy hacks to get IE to work right and keep the code much cleaner and easier to manage. It also allows you to send witty insults to people still using IE ;)

Share this post


Link to post
Share on other sites

Well I tried to apache one again and uploaded it here to test it out and it didn't work.I was able to get the "OBJECT" one to work but only in firefox! I tried to look up how to use OBJECT with EMBED so it will work in both versions but I couldn't find anything. If anyone knows how to get it to work in IE also this will solve my problem.I asked my adviser about PHP yesterday and he told me he would ask the server admin, hopefully I will get a reply on that today.The file "conversion" thing I was talking about was to something called ".NET NUKE" or something of the sort. I don't think he is talking about ASP.NET but I am not sure.Again, thanks for all of your helpful solutions!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.