You are here: Re: Menu « HTML « IT news, forums, messages
Re: Menu

Posted by Oli Filth on 06/07/05 03:20

Luigi Donatello Asero said the following on 06/06/2005 23:59:
> "Oli Filth" <catch@olifilth.co.uk> skrev i meddelandet
> news:W64pe.2704$K5.478@newsfe4-win.ntli.net...
>>
>>Yes, but how many pages do you have? Let's say 50.
>
>
> Much more. The website contains over 1500 files and over 800 pictures.
>

In which case it would be sheer insanity not to use a centralised system
for managing and maintaining the structure of your pages. Lets say it
takes 15 seconds to open each HTML file in an editor, delete the old
navigation section, paste in the new version, save it and close. 1500 *
15 = 22500 seconds = 6.25 hours (non-stop)!!! And that's *every* time
you want to change something.

I would say that it is physically impossible for one person to manage
1500 pages and keep them up to date and consistent, unless you some sort
of automated/dynamic system.

>>So every time you want to make a change to your menu, you have to make
>>the same change on *every* page *every* time, i.e. 50 times.
>>With an include(), you have to make the change *once*. That doesn't
>>sound like an advantage?
>
>
> Yes, it does. But does it not have any disadvantages?

None that I can think of, unless you specifically want very different
menus on different pages (and even that you can cope with if you get
clever with your PHP).

The only disadvantage is that you'll have to go through all your pages
initially to put in the necessary include() statements. But you only
ever have to do that once! Then you're free to alter your menu file as
many times as you like.

But this is where it comes back to re-thinking the back-end design of
your site. If you go ahead and do what I've suggested, that's great,
because you'll have an easily-maintainable navigation system. But what
happens a month down the line, when you realise that you also want a
section on every page that displays the user's log-in details, for
example? You'll have to go and add another include() line to each of
your 1500 pages. What happens if you decide that you want your search
bar at the top of the page? That's another 1500 changes.

Once you get to a site of this proportion, if you are just adding bits
here and there as you think of them, it gets you nowhere (I realised
this once my site reached 10 pages!!). You need to sit down and work out
exactly the sort of changes that you might want to make to your pages in
the future, and design a template (or some other automated/dynamic)
system in PHP that will allow you to make changes with ease, without it
taking you 6 hours each time.

Another example would be your product pages. Rather than having a
separate HTML page for each make of shoe, for instance, you'd be better
off storing all the information about prices, sizes, manufacturers and
images in a database. Then design a PHP-driven system so that when a
user clicks on the link for a particular shoe, the correct details are
automatically pulled out of the database, and placed into a page
template (e.g. shoe.php). This way, you can add, edit and remove new
shoes without having to change any HTML. Equally, if you want to
re-design the shoe page, you only have to do it once.

That's what PHP is there for! To make your life easier.


> What about bookmarking the pages?

PHP has no affect on this. To the user's browser, a page that came from
a static HTML file and a page that was generated by PHP look identical
in every respect.

Basically, the only thing that screws up bookmarking is frame-based
websites.

--
Oli

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация