Hi,
I've got a page producer and i need to display the contents of my page producer using a web browser.
For example, my template (testing.html) looks as follows:
<html>
<head>
<title>Testing</title>
</head>
<body>
<h1>Testing</h1>
<p>Today is <b><#date></b></p>
</body>
</html>
In the PageProducer1HTMLTag event i used the following code
procedure TForm1.PageProducer1HTMLTag(Sender: TObject; Tag: TTag;
const TagString: String; TagParams: TStrings; var ReplaceText: String);
begin
If TagString = 'date' Then
ReplaceText := DateToStr(now);
end;
In the click event of the button i used following code
procedure TForm1.Button1Click(Sender: TObject);
Var
FilePath: String;
begin
FilePath := ExtractFilePath( 'testing.html' );
ShellExecute( Handle, 'Open', PChar( FilePath + 'testing.html' ), nil, nil, SW_SHOWNORMAL );
end;
When i click the button it opens the html page in the browser but it does not replace the date tag. Instead in the browser it displays <#date> as in the template. I know i have to assign the values of pageproducer.content to the html file. but i don't know how to do that. Does any one know how to do that?
Many Thanks for u r help in advance...
Sanjna...
I've got a page producer and i need to display the contents of my page producer using a web browser.
For example, my template (testing.html) looks as follows:
<html>
<head>
<title>Testing</title>
</head>
<body>
<h1>Testing</h1>
<p>Today is <b><#date></b></p>
</body>
</html>
In the PageProducer1HTMLTag event i used the following code
procedure TForm1.PageProducer1HTMLTag(Sender: TObject; Tag: TTag;
const TagString: String; TagParams: TStrings; var ReplaceText: String);
begin
If TagString = 'date' Then
ReplaceText := DateToStr(now);
end;
In the click event of the button i used following code
procedure TForm1.Button1Click(Sender: TObject);
Var
FilePath: String;
begin
FilePath := ExtractFilePath( 'testing.html' );
ShellExecute( Handle, 'Open', PChar( FilePath + 'testing.html' ), nil, nil, SW_SHOWNORMAL );
end;
When i click the button it opens the html page in the browser but it does not replace the date tag. Instead in the browser it displays <#date> as in the template. I know i have to assign the values of pageproducer.content to the html file. but i don't know how to do that. Does any one know how to do that?
Many Thanks for u r help in advance...
Sanjna...