Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: Please help for building my site with menus and external css

  • Subject: Re: Please help for building my site with menus and external css
  • From: Roy Schestowitz <newsgroups@xxxxxxxxxxxxxxx>
  • Date: Wed, 26 Apr 2006 18:15:36 +0100
  • Newsgroups: alt.html
  • Organization: schestowitz.com / MCC / Manchester University
  • References: <1146069758.317795.203170@e56g2000cwe.googlegroups.com>
  • Reply-to: newsgroups@xxxxxxxxxxxxxxx
  • User-agent: KNode/0.7.2
__/ [ coolunmesh@xxxxxxxxx ] on Wednesday 26 April 2006 17:42 \__

> I've designed my site long ago. but the problem is that i've a few
> menus in every page. so i need to add the same code for the same menu
> in every page except its own link( like no "about me' link in "about me
> "page). at the same time i need to put the same css code in evey page.
> and the menu is not located at the same place in every page. The menus
> in every page is different compared to other websites.
> 
> Please help to fix the problem.

Hi,

CSS should be peripheral. Several pages can share the same stylesheet and
should do so if they bear a commonality (duplication is always a bad idea),
e.g. include <link rel="stylesheet" href="/styles/yourstyle.css"
type="text/css" /> between <head> and </head>. If you want to add this line
of code to many files in one fell swoop, you could use GNU/Linux tools, e.g.

find . -maxdepth 1 -type f -name '*.html' -print |
      while read filename
        do # print all filenames
                (
                  sed 's/<head>/<head><link rel="stylesheet"
                    href="/styles/yourstyle.css" type="text/css" />/i;'
                    $filename >$filename.xxxxx
                  mv $filename.xxxxx $filename
                    # replace output files with original
                )
        done

The same strategy goes for menus. Menus are better written in a single place,
which makes them easier to change without pattern recognition and mass-file
replacement. If you don't use a CMS, you may wish to add a menu with a
complete set of links and disable individual to-self links manually, page by
page.

Hope it helps,

Roy

-- 
Roy S. Schestowitz      | "Black holes are where God is divided by zero"
http://Schestowitz.com  |    SuSE Linux     ¦     PGP-Key: 0x74572E8E
  6:05pm  up 4 days  3:16,  9 users,  load average: 0.42, 0.44, 0.54
      http://iuron.com - Open Source knowledge engine project

[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index