Jump to content
xisto Community
anwiii

Css Or ? webpage content

Recommended Posts

i'm looking for a way so that i don't have to edit all web pages if i have something to edit that is on all my web pages.would this be css? i don't know much about it. obviously the content would be saved in a different file and called in. in any case, i would like an example to view of the code and how to impliment this within the html file

Share this post


Link to post
Share on other sites

Something like a Menubar or Header/Footer?
Check out php "includes" which will grab a file (html/php/text, etc) and plunk it into the calling page.

*wait*

check the tutorials here on the Xisto... start with this one, maybe: http://forums.xisto.com/topic/35271-templating-system-using-php-includes-building-a-dynamic-site-using-includes-and-flat-files/

Share this post


Link to post
Share on other sites

The alternative is to use server side includes (SSI). This is the same as the PHP method, but just doesn't need PHP. It's also fairly simple to do.First, make sure you name your files with the .shtml file extension if you haven't already started your site. If you have, and the files already have a different extension, we can work around this. Then, use this code to insert a page into the normal flow of your HTML:

<!--#include virtual="filename.shtml" -->

So, for example, you could have the following markup:

<html><head>    <title>Page</title></head><body>    <!--#include virtual="header.shtml" -->    <!--#include virtual="news.shtml" -->    <!--#include virtual="sidebar.shtml" -->    <div id="content">        <p>This is unique page content for this page.</p>    </div>    <!--#include virtual="footer.shtml" --></body></html>

Share this post


Link to post
Share on other sites

Well it would be better to create a footer, a header, and include it in all pages. Then in the header

<head>
section you could place a link to an external sheet file of css:

<link rel="stylesheet" href=style.css screen="media" />

Edited by webishqiptar (see edit history)

Share this post


Link to post
Share on other sites

ok- thanks for the tips. the ssi's(html &php) was what i was lookin' for. i never used them before. i practiced with it a little last night. i think it's about time i learn css as well...will come back to this thred when i have other questions. thanks again

Share this post


Link to post
Share on other sites

Depends on what you want to change. Css might not be able to do it. Beside SSI and PHP, you might also want to consider javascript. In the javascript file, you can do a document.write to "write the html".

Share this post


Link to post
Share on other sites

yea, js was something else i was looking in to, but i think i'll stick with the ssi for now...thanks for reminding me. i need to learn a little js soon too for other things....

Share this post


Link to post
Share on other sites

Obviously, PHP (or ASPx) is the best way to go for dynamic server-side web pages. However, if you are only a beginner, it is recommended to learn CSS, then add on to that via JavaScript, and finally something like PHP. Currently, I'm in the second to third stage; if I ever get the opportunity to learn PHP in a realworld environment, I'll start immediately.

 

Also, because you are using scripting programs such as PHP, make sure that you are using XHTML, which is slightly more refined for programming purposes.

 

Sincerely,

Jonnyabc

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.