Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Having two index.html files with different layouts.

Quote Reply
Having two index.html files with different layouts.
Hi,

As well as listing my categories at http://www.servicepals.com/directory I also wish to list them on the homepage at http://www.servicepals.com

The easiest way for me to do this is create the normal index page in the /directory folder, and create a second index page without a header of footer - I can then just CFINCLUDE this on the homepage.

So, basically, I need to create a a second index-style page, listing categories, etc, that is automatically updated within the build system. To ensure that the relative URLs remain correct, it should be built in the site root, not the normal servicepals.com/directory folder.

Is there any way that this can be achieved?
Quote Reply
Re: [thewombat] Having two index.html files with different layouts. In reply to
All you would really need to do is to put a routine in the nph-build.cgi file to build another "home" page, but instead of calling home.html it calls home_root.html (or whatever). That file only needs to have the layout you want to 'include'.

I did this for my category_sidebar.html routines for links SQL 1.1x




PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [thewombat] Having two index.html files with different layouts. In reply to
Hi,

If you edit your home.html template to only be the include you need, then create a /directory/home.htm or some other file that is listed before index.html, you will be fine.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Having two index.html files with different layouts. In reply to
Hi Alex,

That's a very elegant solution, thankyou.

in the servicepals.com/directory folder, I now have both index.cfm (which has no header or footer - just basic category listing) and a default.cfm (which CFINCLUDEs the index.cfm file). I then used IIS manager to set default.cfm as a higher default document.

Therefore, www.servicepals.com/directory shows the default.cfm file, but I can still use the index.cfm file generated to CFINCLUDE from the homepage.

Didn't have to play with scary Perl. Can anyone guess yet that I'm not a programmer at heart!! Wink

Thanks for your help guys. Very pleased indeed,

All the best,

Ross
Quote Reply
Re: [Alex] Having two index.html files with different layouts. In reply to
Alex,

That's a really interesting idea.

It works for people using SSI, ASP, PHP, etc for your main page where a file can be included into another file.

For those who might have missed it, what Alex is suggesting requires you to be able to edit the apache config's DirectoryIndex command, (or I think also an .htaccess file) to set the main directory to check for a default.html or default.asp or default.cfm, etc file BEFORE it looks for the index.html or index.htm files.

ex:

#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
DirectoryIndex default.asp index.html index.htm index.cgi index.php index.shtml index1.htm index1.html


When someone calls that directory without a file name, apache will add the _FIRST_ file it finds in the list and display it.

If Links generates an index.html, but as above, your server is looking for default.asp, when someone visits you, default.asp will be found (if you have it in your directory) and it will include the index.html that Links generated, since 'default.asp' is listed BEFORE index.html.

Similarly, in the above example, if you generate index.html, but you are running .php pages, you would need to move your index.php IN FRONT OF the index.html to use it as an include file properly, otherwise your server will find the index.html file first, and display it, rather than the index.php (which is listed 5th in the search order).

This works because home.html is _ONLY_ used for the "top" level access. You can do the same thing for each category (more or less) by using the custom template feature.

I have to admit, this is one permutation of page generation I hadn't thought of in the past 2 years.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [thewombat] Having two index.html files with different layouts. In reply to
I also want the same thing (different home page with different home template!). Can anyone of you please explain, how we can do this? for the dummies like me :)



Leona Macdonalds