NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: patrick de laet on June 10, 2011, 12:29:12 AM

Title: HOW TO: insert external files on start/end of <HEAD>, <BODY>, ...
Post by: patrick de laet on June 10, 2011, 12:29:12 AM
I have a lot of webpages, generated with a 3rd party product (Artisteer).
In the content area, I can add <!-- Net:f:xxxx.txt --> statements and they are generated by Artisteer in the resulting webpages.
That's OK.
But i'd like to insert extra <LINK>, <SCRIPT>, ... statements at the beginning and end of every <HEAD>, <BODY>, . . . in every webpage.
In which embed can I do that?

PS: I'm only using NetWebSource procedures (no NetWebPage, NetWebBrowse, ...)

I'd like to do it once for all my webpages, in the WebServer procedure.

regards

Patrick De Laet
Title: Re: HOW TO: insert external files on start/end of <HEAD>, <BODY>, ...
Post by: Bruce on June 10, 2011, 09:30:18 PM
So, the first thing to note is that you don't really want to do this for all requests. For example it wouldn't go into CSS, js, png, zip.files etc.

So really the request is to parse all htm files.
There is a mechanism for parsing HTML, using the <!-- net:tags done by the ParseHtml method.

It sounds to me like you'd want to override the parsehtml method a bit (in webhandler) to add the functionality you need.

Cheers
Bruce