469,647 Members | 1,728 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,647 developers. It's quick & easy.

Repeat a theme or picture on several pages


I have a
<DIV>
....
</DIV>

containing several items such as text and images.
I'd like to repat it on several pages (for instance like repeating a
logo
or a header, etc)

What is the cleanest and most maintenable way to do that. Can i place
it
in a separate html file and link it to any file where it must appear ?

Can I specify a specific top -left position for each page where it
appears?

-P

Dec 8 '06 #1
8 1609
wrote:
What is the cleanest and most maintenable way to do that. Can i
place it
in a separate html file and link it to any file where it must
appear ?
Google for Server Side Includes (SSI), or ASP Include Files. You can
create a small html file, which is basically a snippet of reusable
code, which can be referenced in another html file. If you want to
position it differently on various pages, you should set an id on the
include file's container, and then style it in the header of the master
page.

I've not tried it on Apache myself, but I did read once that your
htaccess file might need to be set-up to enable SSI, assuming you use
the default extension of shtml. Hopefully, someone will correct me if
I'm wrong.

--
K A Nuttall
www.yammer.co.uk
Re-type the e-mail address how it sounds, remove .invalid
Dec 8 '06 #2
Hi,

I am looking for something that works without a IIS server. Possibly,
pure CSS/HTML.

Must be also usable by a user in disconnected mode on his local
computer (like a sort
of manual or book).

I have the impression your suggestion relies on and ASP server. Am I
wrong?

-P

K A Nuttall ha scritto:
wrote:
What is the cleanest and most maintenable way to do that. Can i
place it
in a separate html file and link it to any file where it must
appear ?

Google for Server Side Includes (SSI), or ASP Include Files. You can
create a small html file, which is basically a snippet of reusable
code, which can be referenced in another html file. If you want to
position it differently on various pages, you should set an id on the
include file's container, and then style it in the header of the master
page.

I've not tried it on Apache myself, but I did read once that your
htaccess file might need to be set-up to enable SSI, assuming you use
the default extension of shtml. Hopefully, someone will correct me if
I'm wrong.

--
K A Nuttall
www.yammer.co.uk
Re-type the e-mail address how it sounds, remove .invalid
Dec 8 '06 #3
wrote:
I am looking for something that works without a IIS server.
Possibly, pure CSS/HTML.

Must be also usable by a user in disconnected mode on his local
computer (like a sort
of manual or book).

I have the impression your suggestion relies on and ASP server. Am
I wrong?
The second suggestion is ASP. SSI is a *nix/Apache thing.

Both technologies are server-side. If you need client-side, then you're
limited to using inline frames (google iframe). This is something I
haven't tried myself, so I'm not sure about its suitability.

--
K A Nuttall
www.yammer.co.uk
Re-type the e-mail address how it sounds, remove .invalid
Dec 8 '06 #4


K A Nuttall ha scritto:
wrote:
I am looking for something that works without a IIS server.
Possibly, pure CSS/HTML.

Must be also usable by a user in disconnected mode on his local
computer (like a sort
of manual or book).

I have the impression your suggestion relies on and ASP server. Am
I wrong?

The second suggestion is ASP. SSI is a *nix/Apache thing.

Both technologies are server-side. If you need client-side, then you're
limited to using inline frames (google iframe). This is something I
haven't tried myself, so I'm not sure about its suitability.


Thanks,

I tried :

<iframe src="logo.htm" id ="Logo" frameborder="0" >
</iframe>

where:

#Logo
{
top: 20px;
left: 20px;
width: 97%;
height: 280px;
}

this seems to work. I need it to work at least for FF and MSIE.

I had to specify the size to avoid scrollbars.

Does anybody know if there is a way to have the frame automatically fit
the contents and
do not show scrollbars, so that one can change the content at will
without need to change the CSS code ?

-P



>
--
K A Nuttall
www.yammer.co.uk
Re-type the e-mail address how it sounds, remove .invalid
Dec 8 '06 #5
On 8 Dec 2006 04:14:22 -0800, pa***********@libero.it wrote:
I have a
<DIV>
....
</DIV>

containing several items such as text and images.
I'd like to repat it on several pages (for instance like repeating a
logo or a header, etc)

What is the cleanest and most maintenable way to do that. Can i place
it in a separate html file and link it to any file where it must
appear ?

Can I specify a specific top -left position for each page where it
appears?

-P
--------------------------------------------------------------------------

How about making it an <iframerather than a <divand then putting
the content in a separate html file? If you want the <divfor other
reasons, make it:

<div>
<iframe>
</iframe>
</div>
Regards,
Kent Feiler
www.KentFeiler.com
Dec 8 '06 #6
<pa***********@libero.itwrote:
I have a
<DIV>
...
</DIV>

containing several items such as text and images.
I'd like to repat it on several pages (for instance like repeating a
logo
or a header, etc)
See http://www.htmlhelp.com/faq/html/des...l#include-file
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

Why is "abbreviated" such a long word?
Dec 8 '06 #7
In article
<11*********************@f1g2000cwa.googlegroups.c om>,
pa***********@libero.it wrote:
Hi,

I am looking for something that works without a IIS server. Possibly,
pure CSS/HTML.

Must be also usable by a user in disconnected mode on his local
computer (like a sort
of manual or book).

I have the impression your suggestion relies on and ASP server. Am I
wrong?

-P

K A Nuttall ha scritto:
wrote:
What is the cleanest and most maintenable way to do that. Can i
place it
in a separate html file and link it to any file where it must
appear ?
The easiest way to do what you want off line without a server and
avoid any problems to do with frames is to simply repeat the
markup on all the pages concerned. This does not mean you have to
even copy and paste, let alone type long-hand.

Use a good text editor with a good Search & Replace function and
do all this stuff automatically on masse, on a whole folder
basis. Want more details? Or do you know what I mean?

Please try to bottom post here as it helps a lot in following the
thread on many newsreaders.

--
dorayme
Dec 10 '06 #8

K A Nuttall wrote:
The second suggestion is ASP. SSI is a *nix/Apache thing.
IIS can do SSI too, without using ASP. Pretty much any competent web
server can, usually with identical syntax.

Dec 15 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Keith Patrick | last post: by
1 post views Thread by Miguel Dias Moura | last post: by
3 posts views Thread by dvan | last post: by
reply views Thread by Jeff | last post: by
1 post views Thread by Henry Stock | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.