Jaf
Posts: 70
Joined: 2/1/2006 Status: offline
|
AscToHTM doesn't currently offer a template function, but you can achieve much the same effect by using the "HTML fragments" feature. In particular by defining HTML_HEADER and HTML_FOOTER fragments you can effectively place your generated HTML wherever you want inside standard HTML that you've defined. Suppose you want to create a page that has the following HTML structure
<div class="top_menu">
... (common menu code) ...
</div>
<table class="maintable" width="100%">
<tr><td valign="top">
<div class="main">
... (main body goes here) ....
</div>
</td></tr>
</table> <!-- end of main table -->
<div class="footer_menu">
... (common footer code, copyright statements and disclaimers etc) ...
</div>
You can split this into an HTML_HEADER fragment that is all the HTML code before where the main body goes, and an HTML_FOOTER that is all the code after it. That is you define a HTML_HEADER as follows
$_$_DEFINE_HTML_FRAGMENT HTML_HEADER
<div class="top_menu">
... (common menu code) ...
</div>
<table class="maintable" width="100%">
<tr><td valign="top">
<div class="main">
$_$_END_BLOCK
and an HTML_FOOTER like this
$_$_DEFINE_HTML_FRAGMENT HTML_FOOTER
</div>
</td></tr>
</table> <!-- end of main table -->
<div class="footer_menu">
... (common footer code, copyright statements and disclaimers etc) ...
</div>
$_$_END_BLOCK
Note, it doesn't matter if - as here - you've split the HTML code for a table between the two fragments. All that means is that the HTML generated when AscToHTM converts your text will end up inside this table - which is usually part of what you want to achieve. When AscToHTM converts your text, it will create the <BODY> and <HEAD> tags, then copy in the HTML_HEADER before outputting the converted HTML, after this it will append the HTML_FOOTER content and close the <BODY> tag. The result is that you have an HTML file with the content you want converted from text, but with the overall layout and structure of a template created site, with standard menus headers and footers. Much of the JafSoft web site is created in exactly this manner. For more information, see the "Using HTML fragments" section of the AscToHTM manual included with your download. Notes: (1) The HTML_HEADER is inserted into the created document *after* the HTML <HEAD> section, i.e. immediately after the <BODY> tag. To insert code into the <HEAD> section (e.g. some JavaScript or META tags) you can use the reserved fragment HTML_SCRIPT.
< Message edited by Jaf -- 5/27/2006 12:32:57 PM >
|