Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help on PageProducer

Status
Not open for further replies.

sanjna000

Programmer
Aug 1, 2003
132
GB
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...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top