May 17, 2008

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

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > CSS (Cascading Style Sheets)

free web hosting

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

Damen
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")


Thanks in advance for any help.

Reply

jlhaslip
php includes will do that.

have a read of the Tutorials at the http://w3schools.com
if you need an example, I can write a Tutorial for you.

Reply

Damen
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.

Reply

rvalkass
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

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


I use it on this site to get the menu to appear on the left (ignore the poor CSS tongue.gif ). 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.

Reply

Damen
QUOTE(rvalkass @ Nov 7 2007, 01:26 AM) *
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

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


I use it on this site to get the menu to appear on the left (ignore the poor CSS tongue.gif ). 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
CODE
<!--#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?

 

 

 


Reply

jlhaslip
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?

CODE
<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

Reply

rvalkass
QUOTE(Damen @ Nov 7 2007, 12:29 PM) *
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 http://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.

QUOTE(jlhaslip @ Nov 7 2007, 01:37 PM) *
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 tongue.gif

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 tongue.gif

Reply

Damen
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!

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : , global, news, problem, change, paragraph, text, css, style, change,

  1. Question About Css
    Setting the style of titles. (5)
  2. Align Text Column Without Tables Using Css
    Is it possible to get a 3 column alignment without using tables with C (13)
    I know I can use tables to get this effect but I am not sure if CSS can do it. I have not found any
    examples so far, the only alignments with CSS I have come across are whole div elements and nothing
    for inside formatting like tables offer. Heres my current stage of my layout so far. select a
    character to see output. http://sonesay.trap17.com/chars.php
    http://sonesay.trap17.com/profile.css The attached file is of my original plan but at this stage
    I cannot do a php+ajax pagination for characters because of lack of knowledge so I went with the
    simple drop down lis....
  3. Is It Possible To Align Text To The Center And Justify It?
    Example inside! (6)
    Basically, I have a list (like shown below) but as you can see, some parts stick out more than
    others, and it doesn't look ordered. What I wish to know is if it's possible to justify the
    text so it's ordered, but also keep it in the centre, using CSS /tongue.gif"
    style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /> Although if another coding
    language needs to be used, then that's ok /smile.gif" style="vertical-align:middle" emoid=":)"
    border="0" alt="smile.gif" /> Example: Beginning with A Beginning with O Beginning with V Beginn....
  4. How Can I Indent Text A Specified Amount
    (every line, not just the first) (4)
    Hey all I'm working on several pages in HTML using external CSS formatting and i need a table
    for navigation along the left hand side with links in it and i want the text to sit next to this
    table to the right the entire length of the page even though the table will end, probably about half
    way down. eg: QUOTE ____ ____| text text text ____| text text text ____| text text text ____|
    text text text ------text text text ------text text text (the "-"'s are to add spacing as i
    cant use multiple spaces. See how the text stays in line and doesn't rever....
  5. Creating Style Sheets
    (5)
    I am attempting to create style sheets in order to make editing easier. I have created one style
    sheet that has the basics for my horizontal menu. However I would like to create another that will
    have the links for the menu. My first menu works because it is all css formatted. However, the
    portion I want to use that has the "link details" is in .html. Can this be put into a style sheet,
    and if so how do I create that? The website can be viewed at http://www.faithcity.org/test2.html ....
  6. Alternate Style Sheet
    hows that? (6)
    I know that you can declare alternate stylsheets for your pages, but i dont know how will a user
    change it, i mean, i know you can change styles depending on media, or even with some js or server
    side coding, but with pure html? how does the user set what style he wants to be displayed? the
    code goes something like that: CODE <link title="Alternate Style"
    href="/alt1.css" rel="alternate stylesheet" media="screen"
    type="text/css" /> thanks... -lozbo....
  7. Free: Css - Style Sheet Editors And
    CSS Scrollbar Makers (7)
    CSS - Style Sheet Editors : Ranfo Cascading Style Sheet Editor http://ranfo.com/csseditor.htm
    EclipseStyle http://www.greeneclipsesoftware.com/eclipsestyle.htm BHead - Meta Tags & CSS
    Generator http://home5.swipnet.se/~w-52253/hyper/pro...ead/bhsetup.exe CSS Style Generator
    http://www.10002.org/download/CSSStyleGen.zip Balthisar Cascade
    http://www.balthisar.com/site/index.php CSS Scrollbar Makers: Scrollbar Skinner
    http://www.survivorx.com/telechargement/Sc...%20Skinner2.zip ScrollBar
    http://home.hccnet.nl/s.j.francke/software...ollbarsetu....

    1. Looking for , global, news, problem, change, paragraph, text, css, style, change,

Searching Video's for , global, news, problem, change, paragraph, text, css, style, change,
advertisement



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



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE