| Home Beta programs |
Welcome to Mobipocket Developer Center |

Support of Frames in Mobipocket ReaderFramesets in Mobipocket reader are bound to a given HTML location: the frameset is automatically activated whe the user jumps to that location in the content. Think of them as page headers, footers, "lefters" and "righters" rather than traditional HTML framesets. Content <mbp:frameset> tag <mbp:slave-frame> tag Slave frame positionning (display attribute) Cross-platform support (device attribute) Using frames in the index search screen Using frames in ASP pages Remarks and Tips Mobipocket introduces two custom tags for handling frames and framesets
<mbp:frameset> tagBy default a new HTML page defines a default frameset, which means that if only
one frameset has to be defined in the HTML page, the <mbp:frameset>
tag is optional and can be ommitted. A <mbp:pagebreak/> is automatically inserted by prcgen before an opening <mbp:frameset> tag (and also an opening <mbp:section> tag). You should therefore not add a <mbp:pagebreak/> tag explicitly between framesets, as this will add a second page break, and the frame will not appear on the first page. I.e. do not use : <mbp:frameset>...</mbp:frameset><mbp:pagebreak/><mbp:frameset>...</mbp:frameset> <mbp:framset> attributes reference
<mbp:slave-frame> tagThe <mbp:slave-frame> tag can be placed anywhere after the <body> tag in the HTML page of the main frame, if there is only one frameset in the HTML page or inside a <mbp:frameset> tag. The frame will display in the Reader as soon as the X-HTML flow containing the <mbp:slave-frame> tag is being parsed. There are two syntaxes : 1 Frame source in separate HTML fileThe <mbp:slave-frame> tag must be self-closing and contain an src attribute pointing to the HTML file. If you use this approach, you will have to set margins in the <BODY> tag of the HTML file which defines the frame. Example : <mbp:slave-frame device="all" display="bottom" breadth= "auto" src="nav.htm"/> 2 Inline HTML source of frame content:Example : <mbp:slave-frame device="all" display="bottom" breadth= "auto"><p>Hello</p> </mbp:slave-frame> Important: the definition of the frame should not contain a <body> tag. 3 <mbp:slave-frame> attributes reference
Slave frame positionning (display attribute)Each slave frame is placed in the order of appearance of the <mbp:slave-frame> in the main frame HTML, and occupies the remaining space in the screen. Example: <mbp:slave-frame display="top" breadth= "auto" src="nav_top.htm"/><mbp:slave-frame display="left" breadth= "auto" src="nav_left.htm"/> will display the following screen :
whereas, <mbp:slave-frame display="left" breadth= "auto" src="nav_left.htm"/><mbp:slave-frame display="top" breadth= "auto" src="nav_top.htm"/> will display the following screen :
Cross-platform support (device attribute)It is possible to specify several <mbp:slave-frame> tags in the same position in one HTML file with different target devices. This allows to optimize the use of frames of different platforms, i.e. display a different frame on a PC and on a PDA. Example : <mbp:slave-frame device="pda" display="bottom" breadth="50 px" src="nav_pda.htm"/><mbp:slave-frame device="pc" display="bottom" breadth="90 px" src="nav_pc.htm"/> Remarks and Tips1 Slave Frame margins attributeIf the frame content is in an external HTML file, you can use margin attributes
in the <BODY> tag of the slave frame file. <mbp:slave-frame device="pda" display="top" breadth="auto" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">Some slave content </mbp:slave-frame> 2 No scrolling in framesThere is no scroll bar in a frame. The breadth must therefore be chosen carefully to display the full content of the frame. Use of the em unit, proportional to the current font size can come in handy, the "auto" value can be helpful when the size is not predictable (available for "top"/"bottom" frames only). 3 Use of <mbp:pagebreak/> with framesetsA <mbp:pagebreak/> is automatically inserted by prcgen before an opening <mbp:frameset> tag (and also an opening <mbp:section> tag). You should therefore not add a <mbp:pagebreak/> tag explicitly between framesets, as this will add a second page break, and the frame will not appear on the first page. I.e. do not use : <mbp:frameset>...</mbp:frameset><mbp:pagebreak/><mbp:frameset>...</mbp:frameset> Using frames in the index search screenAll the functions that display the index search screeen (index_search, cond_index_search, filtered_index_search, sql_search, sql_bullet_search) have an extra parameter where the name of a frameset can be specified. The index search will then be displayed within that frameset. If the FrameSet parameter is not specified or if it is an empty string, the current framset remains active when the index search screen is displayed. If you want to make sure that no frameset is displayed when in the index search screen, pass the name of a frameset that does not exist in your publication, for example "no_frames". Using frames in ASP pagesIn an ASP script, the Mobipocket specific Frameset object can be used to specify the frameset to be displayed around the page generated by the ASP script. Example: Frameset.Use ('my_frameset') |
© Copyright 2000-2007 Mobipocket.com