Our web site does not allow frames. The ODS HTML system can easily create a frames setup with a contents, page, and table file completely set up. I need to create the same look, but on the same page and, with a header logo. I assume that means I need a table into which each of the content, page, and stat tables are entered. Can proc template be used to create such a setup? Does anyone have such a template style?
Maybe you could create your own "main" page, using the IFRAME tag instead of the frame panels.
I don't have examples so far, but check a little help on the tag and build the HTML document with a DATA _NULL_ step...
You would either have to design your own custom TAGSET template for HTML in order to generate the custom tags you need. What you want to do is NOT a style change -- it is not the style template that builds multiple, linked files -- that happens in the generated HTML tags -- which means you'd have to change the TAGSET template to work differently than it does. Or you would have to generate the kind of HTML tags you want in a DATA step program.
The trick with generating your own tagset is that ODS builds hyperlinks to link the CONTENTS=/PAGE= file with the BODY= file. For example, ODS would build this link for a PROC UNIVARIATE table for Basic Measures:
<a href="body.html#IDX1" target="body">Basic Measures of Location and Variability</a> -- which would be completely wrong if you were dumping both the body output and the contents output into the same file....the body.html would be wrong and the target="body" would also be wrong -- you'd have some work to do to get what you want.
If an HTML frame is not appropriate, how about delivering a PDF file -- where the bookmark area in the PDF file would be the equivalent of the HTML contents file??? Most browsers these days have Acrobat Reader.
I'm still stuck to my previous idea, how much clever and wise hints from Cynthia may be.
Here is an example of what I was referring to : IFRAME tagset in a data-step-generated main HTML page. [pre]
ODS HTML PATH = "c:\temp" (URL=NONE)
CONTENTS = "contents.htm"
FRAME = "with_frames.htm"
BODY = "body.htm"
STYLE = astronomy ;
PROC MEANS DATA = sashelp.prdsale MEAN MEDIAN ;
VAR actual ;
CLASS country product ;
WAYS 1 ;
ODS HTML CLOSE ;
DATA _NULL_ ;
FILE "c:\temp\no_frames.htm" ;
PUT "" ;
PUT "" ;
PUT "" ;
It approximately looks like the framed main page produced by the ODS HTML statement, doesn't it ?
I knew what you meant, but I took the first sentence "Our web site does not allow frames."
to mean ALL frames, including inline-frames. If the web folks will allow in-line frames, then your method is indeed the better method.
If the web folks will NOT allow in-line frames, then there is a way to create BODY.HTM and CONTENTS.HTM and then essentially use a DATA _NULL_ step to concatenate the 2 files together.
The trick is to create the CONTENTS.HTM file WITH the TOP HTML tags, but WITHOUT the bottom HTML tags, and to create the BODY.HTM WITHOUT the TOP HTML tags, but WITH the bottom HTML tags. That way, when you concatenate the 2 files together, in a simple format, you have the TOC at the top, immediately followed by the BODY content..clicking on links at the top take you further down on the page.
This method doesn't use FRAMES or IFRAMES at all -- but like your program, does do some post-processing to get the 2 files concatenated together. (You could do some fancier processing in the DATA _NULL_ to get 2 tables side-by-side, but the example I have is a simple concatenate.
Here's the code sample I described. It was for someone who wanted the TOC info at the top of the BODY info. The key is to change target="body" from the TOC file into target="_self" (otherwise, you're popping up windows every time you click on a link) and to change the file name in the HREF from the ORIGINAL file name (BODY.HTML) to the NEW name (NEWBOTH.HTML). Then, you can get rid of the original HTML files you created and use the new HTML file (NEWBOTH.HTML) on your web site.
** create contents and body file only;
** do not even create a FRAME= file;