Gossamer Forum
Home : Products : Links 2.0 : Customization :

Building extra templates!

Quote Reply
Building extra templates!
Before anyone grumbles at me...I have searched the forums with no luck!

I want nph-build to build other pages not related to Links 2.0, but other pages for my site. So...I added the new templates to site_html.pl.

An example name is sub site_html_mypage {

Then I went into nph-build and in the "build all" section I added:


# Create Mypage Page
$use_html ?
print qq|Building <A HREF="$build_root_url/mypage.html">MyPage</A> . . .\n| :
print qq|Building Mypage Page . . .\n|;
&build_mypage_page;
print "\tDone\n\n";



I then added a sub to the bottom of nph-build....


sub build_mypage_page {
# --------------------------------------------------------

open (MYPAGE, ">$build_root_path/mypage.html") or &cgierr ("unable to open mypage page: $build_root_path/mypage.html. Reason: $!")
print MYPAGE &site_html_mypage;
close MYPAGE;
print "\tClosing page.\n";
}


........this just doesn't work!

What am I doing wrong!

I either get sub site_html_mypage template printed in the body of my admin page, or it says that the server closed the connection before the task could be completed!

From Paul Wilson.
http://www.audio-grabber.com
On error resume next..
Quote Reply
Re: Building extra templates! In reply to
You should be able to mod my LastLinks2 mod, see http://www.gotzespace.dk/...nksmod/lastlink2.txt to build a new page.

Quote Reply
Re: Building extra templates! In reply to
I wrote an FAQ on this and posted it in the resource center several months ago and it should be sufficient enough for you to understand...

--Drew
Quote Reply
Re: Building extra templates! In reply to
I use site_html.pl not templates!

So...it would have to be a little different to that code!

From Paul Wilson.
http://www.audio-grabber.com
On error resume next..
Quote Reply
Re: Building extra templates! In reply to
My FAQ includes instructions for both site_html.pl and site_html_templates.pl (Note there are two step 4's.)

This message will self-destruct in 24 hours. Tongue

--Drew
Quote Reply
Re: Building extra templates! In reply to
I was referring to another post!

Anyway....it doesn't work!
When I build all from the admin page, all pages build ok apart from the new ones which build themselves into the body of the admin page!

All the HTML from the pages shows up in the admin pages and when I see what has been build by going to the pages, the page is blank apart from a "1" in the corner.

From Paul Wilson.
http://www.audio-grabber.com
On error resume next..