Gossamer Forum
Home : Products : Links 2.0 : Discussions :

using templated pages with Links2.0

Quote Reply
using templated pages with Links2.0
On my site, I use a template system on all of my pages, so that everything looks the same. For example, the HTML for a page so that the templated page would be used when the page is loaded would look like this:

Code:
<!--webbot bot="HTMLMarkup" startspan -->
<!-- template '/domains/civnation.com/docs/template/template.txt' -->
<!-- start insert '1' -->
<!-- PAGE CONTENT STARTS HERE -->
<!--webbot
bot="HTMLMarkup" endspan -->

---Page Text---

<!--webbot bot="HTMLMarkup" startspan -->
<!-- PAGE CONTENT END HERE -->
<!-- stop insert '1' -->
<!--webbot bot="HTMLMarkup" endspan -->

I'm using the HTML templates for Links, so I tried to enter this code onto the HTML, so that all generated links page would look like the rest of my site, but it doesn't work. Is there anyway I can get this code to work, or even a way to restructure the code so that it would do the same thing?

Also, I have the nested ifs mod installed, if that means anything to you.
Quote Reply
Re: using templated pages with Links2.0 In reply to
I am assuming that you are using Front Page for your other web pages and you are using the Insert Page WebBot.

What you can do is add some codes into your site_html_templates.pl that will allow the insertion of .txt files in your LINKS pages. This will require that you can use SSI on your Server.

1) Add the following sub-routine in your site_html_templates.pl file:

Code:
sub insert_file {
# ---------------------------------------------
# Inserts file in pages.

open (INC, "/domains/civnation.com/docs/template/template.txt") or return "Can't find include file:
$foot_file{$_}";
return join ("", <INC> );
}

2) Create a global variable:

insert_file => &insert_file

3) Then in your templates files, you can add the following code that will insert this file:

Code:
<%insert_file%>

Is your server NT or UNIX using the Front Page extension patches? If it is the former, you may run into difficulties using the above code. If it is the latter, then you can save your files in LINKS as .shtml and it should work fine.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us