__/ [ 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.
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;'
mv $filename.xxxxx $filename
# replace output files with original
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
Hope it helps,
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