Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

How to build second homepage with different home template?

Quote Reply
How to build second homepage with different home template?
How I can buld a second home page for example (index2.html) or in other directory like /home/test/ etc! I know that there is a thread in this forum, which define how to build a second homepage, but what I want is that:

I Want to build a second home-page with different home template!

Any Idea?



Leona Macdonalds
Quote Reply
Re: [leona] How to build second homepage with different home template? In reply to
Not really. An option may be to setup ModRewrite so that it points to page.cgi ... i.e;

http://www.site.com/folder/index.html

...would point to;

http://www.site.com/cgi-bin/dev/page.cgi?t=Template_Set

You would have a few other thigns you would need to change, but I'm just giving you a pointer in the right direction Smile

Cheers

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] How to build second homepage with different home template? In reply to
nope....Well I want a static second home page, driven from a template for example (home2.html)!

I saw a post made by Pudog! about this, he just give a hint that, this is possible, and he done that!

So, it is possible to have this thing working!



Leona Macdonalds
Quote Reply
Re: [leona] How to build second homepage with different home template? In reply to
I think you can do the following

1. save the template home.html as home2.html

2. open nph-build.cgi and copy the sub _build_home as _build_home2

3. change the path in this sub to something like that

my $page = $CFG->{build_root_path} . "/" . 2ndhome . "/" . $CFG->{build_index};
$USE_HTML ?
print "Building <a href='$CFG->{build_root_url}/2ndhome/$CFG->{build_index}' target='_blank'>Home Page</a> ... \n" :
print "Building Home Page ... \n";

4. copy the line which contains

# Build Home Page.
GT::Plugins->dispatch ("$CFG->{admin_root_path}/Plugins", 'create_home', \&_build_home, {});

as

# Build Home Page.
GT::Plugins->dispatch ("$CFG->{admin_root_path}/Plugins", 'create_home', \&_build_home2, {});

in the subs build_staggered build_all and build_changed

5. create the directory 2ndhome in your home dir

6. create your pages, it should work

Best regards from
Bremen/Germany

Lothar
Quote Reply
Re: [eljot] How to build second homepage with different home template? In reply to
eljot ,

Thanks very much for your help, I already done this before, it build the second homepage fine... but it use the same home.html template, not the new home2.html template!

Anyone know how to use templates in nph-build.cgi?



Leona Macdonalds
Quote Reply
Re: [leona] How to build second homepage with different home template? In reply to
change

print HOME Links::Build::build ('home', {});

to

print HOME Links::Build::build ('home2', {});

and in build.pm

copy the sub sub build_home as sub build_home2 and also change

return Links::SiteHTML::display ('home', { category => $cat_list, category_loop => $root, grand_total => $GRAND_TOTAL });


to

return Links::SiteHTML::display ('home2', { category => $cat_list, category_loop => $root, grand_total => $GRAND_TOTAL });

Best regards from
Bremen/Germany

Lothar
Quote Reply
Re: [leona] How to build second homepage with different home template? In reply to
Hi!

Just very easy!

Copy nph-build.cgi to a different name for e.g. nph-home.cgi. Then modify both the scripts and config file for links. You only need to uncomment the respective functions in their respective sub_routines!!!


Then nph-build.cgi may or may not build the new/cool pages and may or may not build an index to a different directory. The nph-home.cgi will build the index.html in a different directory and may or may not build new/cool pages. With this you can build two different index.html/home.html files, once/twice new/cool files and build the entire directory as less frequently like once a week!


Thats it.

Then you can publish different homepage i.e. index.html or call whatever you want also in a different directory. You could also publish new and cool etc pages that needs to be updated more often and leave them uncommented in the nph-home.cgi and uncomment the rest!!! Soooo easy...Smile

Last edited by:

dearnet: Jul 7, 2003, 12:07 AM
Quote Reply
Re: [eljot] How to build second homepage with different home template? In reply to
Hi eljot ,

Thanks a lot, I will try this.... For dearnet idea, well its a nice idea, but what I want is a second home page with different template.. I think eljot advice is nice, I will try it out :)



Leona Macdonalds