Go Back   Velocity Reviews > Newsgroups > HTML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

HTML - Auto insert code into another html page

 
Thread Tools Search this Thread
Old 07-19-2006, 12:01 AM   #1
Default Auto insert code into another html page


I'm using this free program called Ganttproject for projects at work.

The program lets you export the project into several different html
document which link to each other. Each project is saved with its html
pages within a folder which has the same name as the project.

I have created a master file which lists all the project folders and
when you click the project name the project is displayed using the
automatically generated pages

One problem I have found is the automatically generated pages obviously
dont have a link back to my main page.

I dont want to edit all the newly created project documents with the
link so my question is can you automaticlly insert the link into the
pages when the user clicks the project file from my main page?

so

1 User creates new project and exports the html docs into a folder with
the same name.
2 Other user opens my main page which displays the newly created
project listed.
3 He opens the project which inserts a link to the main page of the
project.
4 If the link allready exists then dont insert it again.

Hope this makes sense?

Geoff



g.ormesher@ntlworld.com
  Reply With Quote
Old 07-19-2006, 01:10 PM   #2
bizshop
 
Posts: n/a
Default Re: Auto insert code into another html page

I magine you could create a script to do this when the project main
page is loaded. For example, you could use the good old search and
replace to replace a tag with the one you wanted.

perl -pi.bak -e 's/<body>/<body><a href="http://yourpage.com">Your
page</a>/i' *.html

Note - the above line done from memory, might have to be tweaked. One
thing to be careful of is to avoid the use of quote/doublequotes within
the material to be changed. For instance in the line above, because I
use single quotes for the 's/.../..../i' section, the text inside there
should not have single quotes.

A good explanation is at
http://www.debian-administration.org/articles/298


wrote:
> I'm using this free program called Ganttproject for projects at work.
>
> The program ets you export the project into several different html
> document which link to each other. Each project is saved with its html
> pages within a folder which has the same name as the project.
>
> I have created a master file which lists all the project folders and
> when you click the project name the project is displayed using the
> automatically generated pages
>
> One problem I have found is the automatically generated pages obviously
> dont have a link back to my main page.
>
> I dont want to edit all the newly created project documents with the
> link so my question is can you automaticlly insert the link into the
> pages when the user clicks the project file from my main page?
>
> so
>
> 1 User creates new project and exports the html docs into a folder with
> the same name.
> 2 Other user opens my main page which displays the newly created
> project listed.
> 3 He opens the project which inserts a link to the main page of the
> project.
> 4 If the link allready exists then dont insert it again.
>
> Hope this makes sense?
>
> Geoff


  Reply With Quote
Old 07-19-2006, 08:53 PM   #3
g.ormesher@ntlworld.com
 
Posts: n/a
Default Re: Auto insert code into another html page

Thanks Bizshop

I will have to look into perl, never used it before.

I fixed my site by adding a footer with the homepage link in IIS to all
the pages in my site.

Geoff




bizshop wrote:
> I magine you could create a script to do this when the project main
> page is loaded. For example, you could use the good old search and
> replace to replace a tag with the one you wanted.
>
> perl -pi.bak -e 's/<body>/<body><a href="http://yourpage.com">Your
> page</a>/i' *.html
>
> Note - the above line done from memory, might have to be tweaked. One
> thing to be careful of is to avoid the use of quote/doublequotes within
> the material to be changed. For instance in the line above, because I
> use single quotes for the 's/.../..../i' section, the text inside there
> should not have single quotes.
>
> A good explanation is at
> http://www.debian-administration.org/articles/298
>
>
> wrote:
> > I'm using this free program called Ganttproject for projects at work.
> >
> > The program ets you export the project into several different html
> > document which link to each other. Each project is saved with its html
> > pages within a folder which has the same name as the project.
> >
> > I have created a master file which lists all the project folders and
> > when you click the project name the project is displayed using the
> > automatically generated pages
> >
> > One problem I have found is the automatically generated pages obviously
> > dont have a link back to my main page.
> >
> > I dont want to edit all the newly created project documents with the
> > link so my question is can you automaticlly insert the link into the
> > pages when the user clicks the project file from my main page?
> >
> > so
> >
> > 1 User creates new project and exports the html docs into a folder with
> > the same name.
> > 2 Other user opens my main page which displays the newly created
> > project listed.
> > 3 He opens the project which inserts a link to the main page of the
> > project.
> > 4 If the link allready exists then dont insert it again.
> >
> > Hope this makes sense?
> >
> > Geoff


  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump