>2 8 : Frames  A 8
AscToHTM 

Documentation for the OAscToHTM conversion utility



9

This documentation can be downloaded as part of the  documentation set in .zip format (370k)




V Previous page $@ Back to Contents List#R Next page 


 

8 Frames

 

8.1 Overview



# New in version 4



D New in version 4 is the ability to have the program generate a setD of frames from your source file. The program works to a model setB of frames as shown below, but you have a great degree of control@ over how the frames are laid out, and what their contents are.


D      +------------------------------------------------------------+D      |                       Header frame                         |D      |                        (optional)                          |D      +-------------+----------------------------------------------+D      |  NOFRAMES   |                                              |D      |    link     |                                              |D      |             |                                              |D      |             |                                              |D      |             |                                              |D      |  Contents   |               Main                           |D      |   Frame     |               Frame                          |D      | (optional)  |                                              |D      |             |                                              |D      |             |                                              |D      |             |                                              |D      |             |                                              |D      |             |                                              |D      +-------------+----------------------------------------------+D      |                       Footer frame                         |D      |                        (optional)                          |D      +------------------------------------------------------------+
&









 #

8.2 The frames generated

 3

8.2.1 The master <FRAMESET> document



G Frames are implemented under HTML by having a document that describesE the frame layout by using one or more nested <FRAMESET> tags.M These tags group together <FRAME> tags that identify other HTML filesD that describe the contents of the individual frames or panes. TheP HTML page containing the <FRAMESET> doesn't normally contain any visibleE content. The source of this HTML page looks something like this :-

*
&      <FRAMESET ROWS="110,*,90">5        <FRAME NAME="header" SRC="header.html">%        <FRAMESET COLS="260,*">;          <FRAME NAME="contents" SRC="contents.html">3          <FRAME NAME="main" SRC="main.html">        </FRAMESET>6        <FRAME NAME="footer" SRC="footer.html"">        <NOFRAMES>          <BODY>@          <p>This browser does not support FRAMES<p>,          <p>Visit <A TARGET="_top"P                      HREF="noframes_main.html">this link</A></p>          </BODY>        </NOFRAMES>      </FRAMESET>
1

H

This example produces a layout similar to that shown in the diagramI in 8.1. There are four frames as follows :-

 R

The <NOFRAMES> tag describes the content to be displayed if the browserJ doesn't support frames. This is less common now, but is still importantE as many search engines don't understand frames, and will only index6 the pages linked to in the <NOFRAMES> tag.

L

In HTML the frame names and source file names can be whatever you like.B AscToHTM uses the frame names "header", "footer", "contents" andF "main", but will vary the source file names according to the name of your input filename.

F

Depending on the details of your conversion, not all of the aboveI frames are generated, in which case the <FRAMESET> tags will look slightly different.

I

You don't need to worry about any of this as AscToHTM will determineO what layout is required and will generate the necessary HTML <FRAMESET> code.

K

By default if you convert a file called "myfile.txt" the files created are named as follows:-


/,  *   ) (   + *   $ #    & 
myfile_frame.html

- Master <FRAMESET> file

myfile_header_frame.html
- "header" source file.
myfile_contents_frame.html
- "contents" source file.
myfile_footer_frame.html

- "footer" source file.

myfile.html
- "main" source file.
6


 

8.2.2 The "main" frame

F

The "main" frame will contain the conversion of your source file.B If you elect to split a document into many pages, then this willL show the start page (which will have links to any next/previous page).

h

See also Splitting the document into many HTML pages


 #

8.2.3 The "contents" frame

B

If your document has recognised headings, then the program isk able to generate a contents list (see 5.6.2). In such cases a8 "contents" frame is generated and the contents list is; placed in a file called "myfile_contents_frame.html".

D

If no contents list can be generated, then no contents frame is` created unless you supply a CONTENTS_FRAME HTML fragment to beW used as the contents of the "contents" frame (see 8.4)

@

The contents frame is placed to the left of the main frame.V It will include a hyperlink labelled "NOFRAMES" (see 8.5)O and the generated contents list. This is different from the <NOFRAMES>: tag described in 8.2.1.

e

You can use policies (see 8.3) to suppress the creation of a contents) frame or to control the following:-

 F

You can also customize the frame's appearance using the followingU HTML fragments (see 8.4)


 /

8.2.4 The "header" and "footer" frames

J

The software cannot "detect" headers and footers in your source text,F so you will only get a header or footer frame if you supply the HTMLG yourself. Header and footer frames can be useful as they provide youF with the opportunity to supply titles, navigation links or copyright& notices that are always visible.

H

Prior to version 4 the software already had the ability to add HTMLC headers and footers to each page generated using HTML supplied inE separate files identified by policy values. From version 4 onwardsF HTML fragments may also be used.

l

NOTE: We recommend that, where possible, you use HTML fragments3 to define any header and footer HTML

I

It's expected that you may want to convert the same source into bothF frames and non-frames forms, using the same policy file. Given thisG the program has the ability to "promote" the HTML headers and footersE used in non-frames production into their own always-visible frames.C Equally there may be times when this behaviour is not wanted.

E

The relationships between headers and footers used in non-framesI conversion and those used in frames-based conversion are quite complex.A In the following sections we describe how headers (footers) areF calculated. The logic is described for headers, but applies equally= well to footers if you make the necessary name changes.


 /

8.2.4.1 Non-frames use of HTML headers

I

In non-frames conversion each page created will get a HTML header if


    
  1. b The policy "HTML header file" is set
  2. 
  3. Q The HTML fragment HTML_HEADER is defined
  4. 
I

If both are set, the HTML_HEADER fragment is used in preference.

G

The selected header is referred to as the "standard" header in the* discussion in the next two sections.


P
Note:
For HTML footers the fragment HTML_FOOTER is used, and theb policy
"HTML footer file" is tested.

 $

8.2.4.2 "main" frame header

J

In frames conversion the HTML header added to each page is determined by three things

 I

If the fragment MAIN_FRAME_HEADER is defined, then that is used.

F

If the fragment MAIN_FRAME_HEADER is not defined, and there is noA "standard" header, then the main frame gets no HTML header.

I

If the fragment MAIN_FRAME_HEADER is not defined, and the policy is  notI set then the "standard" header is used as in non-frames conversion.

L

If the fragment MAIN_FRAME_HEADER is not defined, and the policy is setE then the "standard" header is promoted into its own "header" frame,- and the main frame gets no HTML header.


R
Note:
For HTML footers the fragment MAIN_FRAME_FOOTER is used, and„ the policy
"use main footer in footer frame" is tested.

 

8.2.4.3 "header" frame

D

In frames conversion whether or not a "header" frame is created# is determined by three things

 O

If the fragment HEADER_FRAME is defined, then that is used as the contents of a "header" frame.

L

If the fragment HEADER_FRAME is not defined, and there is no "standard"0 header, then no "header" frame is created.

L

If the fragment HEADER_FRAME is not defined, and the policy is not set,( then no "header" frame is created.

M

If the fragment HEADER_FRAME is not defined, and the policy is set, thenF the "standard" header is used as the contents of the "header" frame.I In other words "standard" header is promoted from the "main" frame into its own "header" frame.


M
Note:
For HTML footers the fragment FOOTER_FRAME is used, and„ the policy
"use main footer in footer frame" is tested.
 ><

8.3 Using policies to control the frame structure

G

A large number of policies influence frames generation. These areDQ described more fully in the Policy manual.

1

general


b

"Place document in frames"
Q "Output frame name"

BR

"Add Frame border"

f

"New frame link window name"
k "Open frame links in new window"

:
t

contents frame


n

"Add contents frame if possible"

V

"Add NOFRAMES links"
Q "NOFRAMES link URL"

Tv

"Number of levels in contents frame"

Z

"Contents Frame width"
o "Contents frame background colour"
oc "Contents frame text colour"

c
A

main frame


`

"First frame page number"


Dl

A number of file generation policies affect the main frame's appearance, including :-


I

"Split level"
oT "Min HTML File size"
T "Add navigation bar"


f*

header and footer frames


p

"Use main header in header frame"
S "Header Frame depth"
Ik "Header frame background colour"
I_ "Header frame text colour"

<p

"Use main footer in footer frame"
S "Footer Frame depth"
vk "Footer frame background colour"
f_ "Footer frame text colour"



n
w >

8.4 Using HTML fragments to override frame contents

g

HTML fragments were introduced in version 4 as a means of allowing C users to customize some the HTML generated by the software. This 3 feature is heavily used in frames generation.

>

The fragment names used in frames production includes


E
HEADER_FRAME
If defined, this fragment is used as the 7 contents of a header frame at the top of the screen J
FOOTER_FRAME
If defined, this fragment is used as the3 contents of a footer frame at the bottom of the screenU
CONTENTS_FRAME
If defined, this fragment is used as the contents 6 of the "contents" frame on the left of the screen.6 If not defined the "contents" frame will contain a generated contents list O
MAIN_FRAME_FOOTER
If defined, this fragment is used as the 0 HTML footer of each page that appears in the3 main frame, overriding any HTML_FOOTER or value  defined via policy file.O
MAIN_FRAME_HEADER
If defined, this fragment is used as the 0 HTML header of each page that appears in the3 main frame, overriding any HTML_HEADER or value- defined via policy file.
A

Other HTML fragments may have an effect. For example :-


F
START_TOC
A fragment to be output before any generated2 table of contents. If not defined the default8 behaviour is to output the title "Table of Contents"N
END_TOC
A fragment to be output after any generated table6 of contents. If not defined the default behaviour5 is to simply put out a horizontal rule <HR>&
…

For a fuller description of HTML fragments see the Tag manual.

s
t -

8.5 NOFRAMES tag and NOFRAMES link

n
M

There are several reasons why providing a non-frames alternative to your& pages is a good idea. These include

 M

To help with these problems the software supplies a <NOFRAMES> tag.K in the main <FRAMESET> document, and a visible "NOFRAMES" hyperlink; in the contents frame.


e t'

8.5.1 The "NOFRAMES" hyperlink

T
H

The program can place a hyperlink in the contents frame. This linkD is labelled "NOFRAMES" and will link to the first main page. ThisK will allow users who don't like frames to view your pages in a non-frames G window. You can control this link to a limited extent using policieso* (see 8.3)


h '

8.5.2 The <NOFRAMES> tag

s
C

HTML provides a tag whose contents is displayed to any browseraP that doesn't support the <FRAMESET> tag. The program will automaticallyI generate a <NOFRAMES> tag that displays a message saying the page.D requires frames, and offering a link to the first main page. ThisI will allow users with non-frames browsers, and search engines to accessr your main pages.


r d8

8.5.3 Generating frames and non-frames versions

H

You should consider whether or not your pages are suitable for bothI frames and non-frames viewing. If they are, then you can use the first"K page displayed in the main frame as your NOFRAMES hyperlink target. Thiso) is, in fact, the default behaviour.

.K

There are a number of reasons that you might want to maintain two sets of pages :-n

 UI

If you do want two sets of files, simply convert the file twice withBH and without frames generation selected. You can either move the filesF into different directories, or change the output filename for one ofC the sets. Other than these changes you should be able to use the_ same policy file.

…

If you create two sets of files, make sure you set the "NOFRAMES link URL"R8 policy to point to the first non-frames HTML page.


 "

8.6 Hyperlink targets

J

One of the reasons people dislike frames is that when they click on aJ hyperlink the selected page can end up being displayed inside the frame,C rather that in a full window. Alternatively the selected link is( displayed in a new browser window.

1

AscToHTM defaults to the following behaviour

 n
o

"Open frame links in new window"
New frame link window name"

p
EG

The default behaviour for links in the last category is to displaynH them in the "_top" window. The name "_top" is reserved by browsers toC mean the main browser window, so in most cases clicking on a linkw@ to an external site will cause the current set of frames to beG replaced by the selected page without creating any additional browserm windows.


n .$

8.7 Splitting large files

I

When generating frames documents the area of screen allocated to therD "main" frame is necessarily smaller than the whole browser window.G For his reason you may want to split your document into many, smalleroD pages to reduce the need for scrolling. This can work well with aG contents list on the left, and is in fact the main reason people like I frames as a means of navigating through a large set of information.

Hm

See File generation policies for details on the policies thatNB may be used to split large files into a set of smaller pages all linked together.


< aP

8.8 Selecting "Output HTML as a set of FRAMES" in the Windows version

H

For your convenience the Windows version of the software allows youM to select a conversion type and includes a "Output HTML as a set of FRAMES"r option.

iD

If you select this option a number of policies are set for your! convenience. These include


c

"Place document in frames"
dF "Split Level"


aK

The former is set to "yes", and the latter is set to "2", which should) hopefully prove a suitable default.

rH

When this option is first selected the "Frames" properties sheet is8 displayed to allow you to review and edit the selectedA frames policies.


m 2


V Previous page $@ Back to Contents List#oR Next page 


B& 
Valid HTML 4.0!Converted from 6 a single text file by A AscToHTM
aJ© 1997-2001 John A Fotheringham
Lr