FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


How do you make a multi-page website?





ratanegra
I'm sure there are easier ways to do this, so I find it quite frustrating to have to copy and paste the design in every .html document and link one to another. If I want to do a minor change, I have to change manually every one of them. How do you put your design in one place, including the menu (that will be the same for every one of the 6 or 7 subpages), the logo, the footer, etc., and the content on another one?

The way I did it was with PHP includes, but I'm not very good with that and perhaps there is another way that I'm missing.
darthrevan
I do not know of another way except using php . I personally would create a page template and use php to include it. There days I use CMS to manage my site(s).
ratanegra
darthrevan wrote:
I do not know of another way except using php . I personally would create a page template and use php to include it. There days I use CMS to manage my site(s).


How would you include it? My way had a lot of includes (one for each part) and there were even some pages where I included a page with two or three includes in it (just so I had the menu, the logo, the footer and all other parts in different files to edit). It all became difficult after a while.
darthrevan
If you look at how to create templates for Wordpress, you will see you split up the HTML code into seperate files, like header.php, sidebar.php, footer.php and you could for your site, create a page-layout.php


The header.php would contain from <html> to the very beginning of the content tag(<div id='main'> or similar)

so your index would look like maybe:

Code:

<?php include('header.php');?>

<?php include('sidebar.php);?>

*Your content for your home page here*

<?php include('footer.php');?>


footer.php would contain the html code the footer.

in your sidebar.php put in the code for the theme's sidebar
then you would include your sidebar.php(if your theme has a 'sidebar' or similar with
Code:
<?php include('sidebar.php');?>



Here is an example for the HTML code:
Imagine this as your HTML code
Code:

<!--header.php-->
<html>
<head>
<title>
...
</head>
<body>
<div id="main">
<!--end of header.php-->

<!-sidebar.php-->
Menu
<link>
<link2>
<!-end of sidebar-->

<!--index.php-->
Main content
<!-end of index.php>

<!-footer.php>
Copyright ...
<!-end of footer-->


You would slice them up. On the index.php, for your multiple pages, you would put the same code into each page's file. So your about.php would contain the same thing as index.php but with the *Your content for your home page here* being different in content


I hope this makes sense, I am not that great at explaining things. I learned this when I first learned how to convert HTML templates into Wordpress templates, and it has been a while since I have done that and currently looking into re-learning it.
metalfreek
The best approach would be to create different php includes files so that while making pages, you will just need to include those and if anything has to be edited than you can edit in one place.

Here is what I generally do for my pages.


include header
<title> I don't generally put title tag in other include files because it needs to be changed on every page. </title>
include menu
include sidebar
<div>Your page content goes here<div/>
include footer

That's it. That's the way I work.
ratanegra
Oh, then I guess everyone does it the way I did. Sorry for bothering you, haha. I guess this will help anyone willing to use the search bar. Thank you very much for your suggestions. However, I didn't remember it all before, so thanks to you I'll be able to start a little ahead from what I had thought before.

metalfreek wrote:
I don't generally put title tag in other include files because it needs to be changed on every page.


This was one of the things that made me think that people would have found an easier way to do this all. It was all so complex that I thought that people could put it in one file only or things like that. Maybe it can be done with other languages (js, for example), but I'm not aware of it. I also put an include to a 'logo.php' in the heather just so I could change it easily, but I don't think I'll be doing that again. It's too troublesome

Thank you again. Very Happy
metalfreek
ratanegra wrote:
Oh, then I guess everyone does it the way I did. Sorry for bothering you, haha. I guess this will help anyone willing to use the search bar. Thank you very much for your suggestions. However, I didn't remember it all before, so thanks to you I'll be able to start a little ahead from what I had thought before.

metalfreek wrote:
I don't generally put title tag in other include files because it needs to be changed on every page.


This was one of the things that made me think that people would have found an easier way to do this all. It was all so complex that I thought that people could put it in one file only or things like that. Maybe it can be done with other languages (js, for example), but I'm not aware of it. I also put an include to a 'logo.php' in the heather just so I could change it easily, but I don't think I'll be doing that again. It's too troublesome

Thank you again. Very Happy


Dealing with title of the page is a bit complex. If you are using MySQL database for data storage than it will be very easy if you store title on the database itself. I generally do this with my sites.

If you are not using MySQL then putting title manually is the only way I guess. I might be wrong but this is what I do with titles.
Dialogist
ratanegra wrote:
Oh, then I guess everyone does it the way I did.


Usually a sure fire sign that you're doing something wrong as a designer, no? I personally would not have a database generate my fresh content for the simple reason of SEO and the only crawl you're gonna get being old cache data, if the content isn't readily accessible in raw html, your options in terms of search engine ranking are kind of limited, especially in terms of defining Leverage browser caching in the .htaccess which you probably should be doing. Darthrevan suggested using Wordpress and that would be a wise suggestion being that you could then utilise Wordpress backend to actually get a few looks and backlinks, because if you're pushing a single page dynamically including content from an uncrawlable server side database, you'd actually be better off going back to 1998 and inserting an iframe. A least your one page website would actually have something of a little bit more sustenance for the search bots to get their teeth into. Of course the usual reply is "I don't care about SEO". Then don't put a web page up. Just keep it on your desktop. I've been sitting at #1 to #25 for my targeted search term on google for the past 7 years. I maintain this by doing laborious html editing (including the meta tags). You get out of it what you put in to it.
ratanegra
Dialogist wrote:
ratanegra wrote:
Oh, then I guess everyone does it the way I did.


Usually a sure fire sign that you're doing something wrong as a designer, no? I personally would not have a database generate my fresh content for the simple reason of SEO and the only crawl you're gonna get being old cache data, if the content isn't readily accessible in raw html, your options in terms of search engine ranking are kind of limited, especially in terms of defining Leverage browser caching in the .htaccess which you probably should be doing. Darthrevan suggested using Wordpress and that would be a wise suggestion being that you could then utilise Wordpress backend to actually get a few looks and backlinks, because if you're pushing a single page dynamically including content from an uncrawlable server side database, you'd actually be better off going back to 1998 and inserting an iframe. A least your one page website would actually have something of a little bit more sustenance for the search bots to get their teeth into. Of course the usual reply is "I don't care about SEO". Then don't put a web page up. Just keep it on your desktop. I've been sitting at #1 to #25 for my targeted search term on google for the past 7 years. I maintain this by doing laborious html editing (including the meta tags). You get out of it what you put in to it.


What do you suggest other than Wordpress? My website will be in Spanish and the Spanish version of Wordpress is difficult to install (I have tried twice, but something must be wrong with the way I'm doing it). Also, the Wordpress informal translations suck (dates and things like that have to be done manually). When you enter my webpage and look at the source code, it's not like a frame. You can see the metatags. I didn't think the bots would download the file and view it? My webpage, ratanegra.com, was on the fifth place on google search for a long time (I used includes). Now it's not, since I haven't done anything to it in a year or so, and it's ugly and no one would enter on free will. I'm planning on doing it all over from scratch, but I want to optimize the way I do it, since it is a difficult task knowing only HTML, CSS and the PHP includes. How do you maintain your webpage? I could add new pages with the includes. The hard part would be updating the homepage so that the new content is there each time (I'd like to automate it, but I don't know how).
metalfreek
ratanegra wrote:
Dialogist wrote:
ratanegra wrote:
Oh, then I guess everyone does it the way I did.


Usually a sure fire sign that you're doing something wrong as a designer, no? I personally would not have a database generate my fresh content for the simple reason of SEO and the only crawl you're gonna get being old cache data, if the content isn't readily accessible in raw html, your options in terms of search engine ranking are kind of limited, especially in terms of defining Leverage browser caching in the .htaccess which you probably should be doing. Darthrevan suggested using Wordpress and that would be a wise suggestion being that you could then utilise Wordpress backend to actually get a few looks and backlinks, because if you're pushing a single page dynamically including content from an uncrawlable server side database, you'd actually be better off going back to 1998 and inserting an iframe. A least your one page website would actually have something of a little bit more sustenance for the search bots to get their teeth into. Of course the usual reply is "I don't care about SEO". Then don't put a web page up. Just keep it on your desktop. I've been sitting at #1 to #25 for my targeted search term on google for the past 7 years. I maintain this by doing laborious html editing (including the meta tags). You get out of it what you put in to it.


What do you suggest other than Wordpress? My website will be in Spanish and the Spanish version of Wordpress is difficult to install (I have tried twice, but something must be wrong with the way I'm doing it). Also, the Wordpress informal translations suck (dates and things like that have to be done manually). When you enter my webpage and look at the source code, it's not like a frame. You can see the metatags. I didn't think the bots would download the file and view it? My webpage, ratanegra.com, was on the fifth place on google search for a long time (I used includes). Now it's not, since I haven't done anything to it in a year or so, and it's ugly and no one would enter on free will. I'm planning on doing it all over from scratch, but I want to optimize the way I do it, since it is a difficult task knowing only HTML, CSS and the PHP includes. How do you maintain your webpage? I could add new pages with the includes. The hard part would be updating the homepage so that the new content is there each time (I'd like to automate it, but I don't know how).


If you are thinking of automating your homepage than some form of programming is a must. You have to use php and mysql to create these pages dynamically otherwise you are stuck with the manual work of creating each HTML page by yourself using includes.

PHP is the best option as far as I can see. I am not a good coder but I do some php and its not too hard to learn. Try watching some YouTube lessons on PHP and you will be on your way on making your own little CMS. Very Happy
Dialogist
ratanegra wrote:
What do you suggest other than Wordpress? My website will be in Spanish and the Spanish version of Wordpress is difficult to install (I have tried twice, but something must be wrong with the way I'm doing it). Also, the Wordpress informal translations suck (dates and things like that have to be done manually). When you enter my webpage and look at the source code, it's not like a frame. You can see the metatags. I didn't think the bots would download the file and view it? My webpage, ratanegra.com, was on the fifth place on google search for a long time (I used includes). Now it's not, since I haven't done anything to it in a year or so, and it's ugly and no one would enter on free will. I'm planning on doing it all over from scratch, but I want to optimize the way I do it, since it is a difficult task knowing only HTML, CSS and the PHP includes. How do you maintain your webpage? I could add new pages with the includes. The hard part would be updating the homepage so that the new content is there each time (I'd like to automate it, but I don't know how).


Metalfreek has a point in terms of achieving convenience programatically but I was thinking that since your site isn't a huge one and you control the content anyway (ie: no userbase or members, that I can determine) then maybe you'd benefit more in the long-run from choosing rigorousness over convenience and yeah, actually doing all the really boring, laborious stuff. I see that this isn't exactly your problem though and that you are more concerned with how to achieve this single page with all of your content (in all or any possible way).

The spanish Wordpress, I cannot speak on as I have never tried to install it. My wordpress was very straight forward to install. Actually it was even easier than that. I used the "Famous 5 minute install"

http://codex.wordpress.org/Installing_WordPress#Famous_5-Minute_Install

Although it clearly wasn't famous because I hadn't heard of it until then. Their Spanish translations probably do suck, but they are better than the English translations that you are currently using aren't they? They must be because you don't have any. This is why I would utilize their backend if I was you. While google will provide a "Translate this page" link next to your search term, it's not ideal and what you want is English content displayed to the English viewer automatically when they open the page. There's wordpress plugins that do this. Along with many others you could find beneficial. Not to mention the interaction it will provide (comments, backlinks, wordpress themselves giving you traffic, etc). Themes, you can get a lot of design problems off the to-do list too. I would try to find a spanish version that works. Other than that, you can always find another blog provider. I would actually consider Tumblr.com. Everything is already and installed for you. You can customize any theme you want, change the css and the html and even add your own domain name. In short, if you wanted to go down that route, you could use tumblr for your whole site without anyone being able to notice it is a tumblr. I think wordpress is the best option, but if convenience is your thing, try tumblr.

Ratanegra wrote:
How do you maintain your webpage?


A couple of notes, since you've given your link and I've had a chance to take a look at it:

Your targeted search term would be Rata Negra right? Space or no space? It's spanish for Black Rat, if my 5th year Spanish class serves me correctly. Wikipedia is going to eat you up on page 1 for google's search results for that, but you can definitely slide in right behind it (or even above it at Number 1 spot if you're really interested). To do this, you need to do a few things. You need "Rata Negra" written on your homepage more than wikipedia uses it (do a keyword density check for all other pages above you too - see how many times they use the words "Rata Negra", and also how many links they have with those exact words in the title). Trump them all.

Get back links. The more pages (your facebook, twitter, friends pages etc) that link to you, improves your ranking. Link back to them too. And up you climb...

Your whole site is in spanish (only). While this fine (if your intended audience is Spanish only) you speak very good English. Take advantage of this skill. Google are also English speakers and their programmers wrote their bots in English. If the bot spots a search term that has more relevance or destiny in English then it will regard it as more relevant. The trick here is to be just as relevant in the U.S as you are Spain. As a bilingual speaker, this shouldn't be a problem for you. But it is - because all of your meta tag keywords are in Spanish only. You're only allowing one language (and not the predominant language of the internet) to search for your stuff, and ultimately - to find you at all.

Last, but definitely not least, in maintaining your page, if the bots find something they can't crawl, they won't, and in some instances, won't come back. At least until you've fixed it. Certain browsers will fail on certain errors too. This will also affect your search ranking, because if the search engines find your page problematic, they can't or won't crawl, and they put you in the same relevance category that they put spammy, phish and crack sites in. You don't want that.

So I would fix the 88 Errors in your markup here:

http://validator.w3.org/

and also use:

http://gtmetrix.com/

Which will help you clean up the whole entire performance. Stuff like that inline js in your page needs to be external to prevent block rendering. etc. Sorting out these things speeds everything up, pleases the search engines and usually always improves your ranking.

I know your concern at this point is mainly how to implement this content but my advice is still manually. If you agree with Metalfreek, learn php. If you don't want to, get a Wordpress (recommended). If wordpress sucks in Spain, try a www.blogger.com or a www.tumblr.com (recommended). Either way, all of these things should help.

Keep us posted on the progress.
likeabreeze
To make a multi-page website, here are two methods:
1. Write the page one by one, manually.
2. Import data from website database, in this way, all the pages will have the same template. So you can use all the server scripting language, such as asp, php, jsp, etc.
Robert_Redbeard
ratanegra wrote:
I'm sure there are easier ways to do this, so I find it quite frustrating to have to copy and paste the design in every .html document and link one to another. If I want to do a minor change, I have to change manually every one of them. How do you put your design in one place, including the menu (that will be the same for every one of the 6 or 7 subpages), the logo, the footer, etc., and the content on another one?

The way I did it was with PHP includes, but I'm not very good with that and perhaps there is another way that I'm missing.


I'm just jumping into this with my suggestion. I got tired of the same things. So I started using A CMS. A Content Management System allows you to modify something in the page theme and it will filter down to every single page on the site all by itself.

I use Drupal and Wordpress. Drupal has a learning curve in order to use it well. But if I can do it anyone can. I am not as familiar with WordPress. But it does have some great themes you can get. And the setup for my one site I used it on was easy.
codersfriend
Yes you need to use a CMS or maybe you can also use a framework like Codeigniter or Yii Smile
Robert_Redbeard
codersfriend wrote:
Yes you need to use a CMS or maybe you can also use a framework like Codeigniter or Yii Smile


I use a framework for the style of my drupal sites. 960.CS I think it's called. Good stuff. You can make good looking sites fast once you get the hang of how it works.
c'tair
That's what frameworks are for.

Depending on the language you are most familiar with:

    - CakePHP if you know PHP
    - Django if you know Python
    - Ruby on Rails if you know Ruby


There are tons of others like Drupal, Joomla, Pylons, Pyramid, Sinatra and I could go on and on but the best thing to do is to chose one and stick with it. They all will get the job done, trust me, and you can pick up the skills needed to set up each one within a week or less.

You'll learn all about how to template your website, which is what you're looking for, and how to change one file and have it changed in all of your pages at once. Plus, it'll introduce you to things like databases and maybe user authentication, so you can add some cool features to your website later on.

Don't be afraid to learn, it's a great bunch of fun, trust me on this Very Happy . Django and Rails have the most documentation floating around, CakePHP will run on almost any server with PHP and an SQL database, and I'm sure that Drupal, Wordpress, and Joomla would also hit the spot, although personally I'm more in favor of CakePHP when it comes to php driven sites. Just couldn't wrap my head around Joomla/Drupal and Cake was easy as a Saturday morning bike ride Wink
Robert_Redbeard
I will have to look into Cake. I have never heard of it. But if you say it is that easy I am willing to take a good look at it. I am trying to get familiar with most CMS software. That way I have options and I can hel others with problems on Fiverr.com.
jordivh
Thanx everybody tthis helps me out as well.
Alex4141
I would like to say that maybe it can be done with other languages but I'm not conscious of it.
Arrogant
You can create dynamic pages using PHP and mySql
You can include the repeated portions using the include in the webpages
venkat_60
It's easy we needn't use php we can do it with html
save each page as one html file
give no.'s are names spcfcally to them and create a bar which contains those
and give link to each correspondingly ..... !!!! Wink
Related topics
Un programme pour réduire automatiquement la taille des imag
Free Domain Name (TLD) Providers list
&raquo; Which Browser Do You Find The Best ?
Making a homepage?!
i use frontpage
Banners needed Urgently
All my FRIH$ for a small task..
Ayr United Archive Site
Becoming a SEO Guru
website timing out a little too often!
Global Warming
New Web Site
Need help
Tell if a download is a bad link
Reply to topic    Frihost Forum Index -> Webmaster and Internet -> Design Tips

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.