Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Creating a new static page that can be framed.

Quote Reply
Creating a new static page that can be framed.
Hello gt forum members!

I have recently acquired a license of Links SQL. It’s just great.

I am having trouble with one thing now that I am customizing the look of our site.
I have searched the forum for a solution but I haven’t found a clue.


I need to have a totally new static page built. I can not seem to figure out what I need to do to have the script generate new static pages from templates I have created.

I will then want to frame it on top of a page (it will by my navigation bar).
The bottom target of that page will be the home.html page.

Please help… Thanks!

Quote Reply
Re: [nt] Creating a new static page that can be framed. In reply to
Hi,

Unfortunately the only way to do this is to edit nph-build.cgi, and do some copy and pasting.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Creating a new static page that can be framed. In reply to
That is what I thought.
Is there an example of adding code to nph-build.cgi so that it builds a new page somewhere in this Forum? I couldn't find one,... Could you spare me some time and post an example of how to have extra new pages generated by the script. I think that it is a very power full tool that I would like to be able to use.

Thank you Alex!
Quote Reply
Re: [nt] Creating a new static page that can be framed. In reply to
This is the same principle as the "sidebar" or "category tree" solution that was posted for version 1.13 (I think).

The concepts would be the same for the 2.x version.

You'd want to add a call to the subroutine to build that page.

You'd want to find the build subroutine that was closest to what you wanted to do, and clone it, then modify that.

The ratings page is a "basic" page. It doesn't call other pages, and it doesn't include other stuff. You might want to use that as the model to build from.

FWIW... I thought someone had done, (or proposed?) a way to build new static pages in a specified directory. (might have been me, actually... don't remember). You might want to search for it.

I can actually see this as a "plugin" or a simple change to the configuration interface.

The plugin is simply a routine that knows what pages to build (ie: template names) and where to put them. It's called at the end of the build cycle.

You'd enter the pages to build by either listing them in a web interface, or (something I like better) just read whatever templates are in a specified subdirectory, and process them. You could specify where each template is to go by putting a comment tag at the top of the file the plug in looks for with the output path.

It's actually a rather simple concept, and now that it's been proposed, and I've thought about it <G> I'll probably create it in the next few days. This will solve my problem of keeping my "information pages" up todate with current headers. Previously this was a nightmare (solved by using page.cgi <G>).

You could then edit/list the templates by simply using the built in editor, and moving to that template directory.

I'll see (when the 2.1 final comes out) which is easier to implement -- the "gulp" directory, or an itemized list.

Please..... I can't take requests yet, I'm still getting back on my feet, but this seems exceedingly useful.

BTW... for those who might not realize it, you can use page.cgi to display a template in a "static" mode dynamically. It uses a bit more CPU than a static page, but it doesn't have to be built during a build either -- it's always "fresh".

Check out:
http://gossamer-threads.com/...cgi%20static;#137912


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Creating a new static page that can be framed. In reply to
Hey that's interesting about the 'p=' parameter. I had never heard of that and it seems like a quick and dirty way to get an extra dynamic page added.

I actually went through the code and duplicated the routines in order to have Links build a Featured page. Which is a page full of 'Featured' links which users have paid a premium for. As a Featured link they get various advantages including being at the top of their category, etc.

I even managed to get the Featured page to list the links randomly each time it was built, but now the problem is I have about 60 links and the page is getting too big.

The problem I ran into, and have yet to tackle, is how to have my new page span pages once a certain number of links have been included, like Links does with many of the other pages. I looked at the code, but it just got too confusing for me to follow since it seems like it's in two different locations.

Is this relatively easy to hack or is it a major undertaking?

Last edited by:

BryanL: Dec 12, 2001, 6:24 PM
Quote Reply
Re: [BryanL] Creating a new static page that can be framed. In reply to
spanning pages....

The actual span page code is fairly complex, since it has to keep track of forward and backwards links.

If you just want to break a page in 2, you can use a simple loop.

If not, you'll need to follow the logic for spanning pages, search.cgi has a simpler logic I think. Try following that, then compare it to the static build pages.




PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Creating a new static page that can be framed. In reply to
Okay,
thank you for your help, but it seems that I need some more.

I copied and pasted the code for the ratings page (in nph-build.cgi).
I changed the name "ratings" to "navigation", (since I want to frame this page that is supposed to be my navigation bar).

I up loaded the file in ASCI, chmod it to 755 and now when I try to build all, I am getting CGI wrapper errors. I obviously messed up somewhere...


# ------------------------------------------------------------------
# Generate the navigation page.
#
_time_start();

my $page = $CFG->{build_navigation_path} . "/" . $CFG->{build_index};
my $url = $CFG->{build_navigation_url} . "/" . $CFG->{build_index};

$USE_HTML ?
print "Building <a href='$url' target='_blank'>Navigation</a> ... \n" :
print "Building Navigation ... \n";

($CFG->{build_navigation_path} =~ m,^$CFG->{build_root_path}/(.*)\s*$,) and _build_dir($1);
open (PAGE, "> $page") or _cant_open($page, $!);
print PAGE Links::Build::build ('navigation', {});
close PAGE;
my $perms = oct ($CFG->{build_file_per});
chmod ($perms, $page);

print "Done (", _time_display(), " s)\n\n";
}


Any ideas?
Quote Reply
Re: [nt] Creating a new static page that can be framed. In reply to
Hi,

I don't use cgi wrap, so I don't know what to look for with that.




PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [nt] Creating a new static page that can be framed. In reply to
Well,

1. Did you add a sub _build_navigation to the top?
2. Did you add $CFG->{build_navigation_path} to the configdata file?
3. Did you add a build_navigation subroutine in Links::Build?

You might just want to do:

open (FH, "> /path/to/save/file") or die "Open: ($!)";
print FH Links::user_page('navigation.html');
close FH;

instead.

Cheers,

Alex
--
Gossamer Threads Inc.