Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

Regular HTML pages instead of templates?

Quote Reply
Regular HTML pages instead of templates?
How do I use regular html pages instead of the templates?

Quote Reply
Re: Regular HTML pages instead of templates? In reply to
What do you mean "regular" HTML pages???

Regards,

Eliot Lee
Quote Reply
Re: Regular HTML pages instead of templates? In reply to
This is where I lost track:

# Use Templates: instead of editing site_html.pl, you can edit regular html pages
# encoded with special <%links_tags%>. It's not as flexible as site_html.pl, but it
# may be easier.
$build_use_templates = 0;

Where are the instructions on how to perform this?

Quote Reply
Re: Regular HTML pages instead of templates? In reply to
I don't think my question was clear enough...how do I use the html pages instead of the templates?

Quote Reply
Re: Regular HTML pages instead of templates? In reply to
Based on your "confusion", I would recommend using TEMPLATES...by NOT using templates, you will have to edit the site_html.pl, which is full of Perl codes...

Stick with templates...set that variable to 1 and then edit the template files.

Regards,

Eliot Lee
Quote Reply
Re: Regular HTML pages instead of templates? In reply to
Like all the other "flag" variables: '0' is 'no', '1' is 'yes'. (this is even mentioned in links.cfg)

...although I thought that variable as set to 1 by default now?

did you even try?

--Drew
Links 2.0 stuff
http://www.camelsoup.com
Quote Reply
Re: Regular HTML pages instead of templates? In reply to
Try what? I set the variable to 0 because I want to try to use different templates for each category. On the top of each category I want a targeted banner that suits that audience. Please try and explain this to me. I have been trying for about 10 hours now searching through the forum. I would really like to have a different banner in each category.

Quote Reply
Re: Regular HTML pages instead of templates? In reply to
I found an adult oriented site that has targeted banners at the top of each category. This is exactly what I want to do: http://www.nichelinks.com
Sorry about the R rating but they have your script and exactly how I want it.

Quote Reply
Re: Regular HTML pages instead of templates? In reply to
Uh...using 0 will TURN OFF TEMPLATES!

You need to use 1...

LIKE the following:

Code:

$build_use_templates = 1;


IF you want to use different CATEGORY TEMPLATE{/b] files, then you need to use the Multiple Category Template Mod, which is linked in the Resources section!

Regards,

Eliot Lee
Quote Reply
Re: Regular HTML pages instead of templates? In reply to
That site is probably using the Multiple Category Mod or hacked version of WebAdverts that inserts different banners based on the category.

Regards,

Eliot Lee
Quote Reply
Re: Regular HTML pages instead of templates? In reply to
OK...I will give this a try. The following is a peice of the multiple template code. So if the category name was "cars" and that file was located in www.cars.com/types/cars.htm is the code below right?


Add the following (in blue):

my $template;

# Set the appropriate template file to load
if ($category_name =~ /^Category1/) {
$template = "cat1.html"; }
elsif ($category_name =~ /^Category2/) {
$template = "cat2.html"; }
elsif ($category_name =~ /^Category3/) {
$template = "cat3.html"; }
else { $template = "category.html"; }

($category_name =~ /^cars/) {
$template = "/types/cars.htm"; }

Is this right?

Quote Reply
Re: Regular HTML pages instead of templates? In reply to
No...you need to have ALL the template files in the template folder! LINKS 2.0 will not allow you to select another file outside of the TEMPLATE directory. LINKS SQL does, but not LINKS 2.0....

The following codes that you posted:

Code:

$template = "/types/cars.htm";


MUST be:

Code:

$template = "cars.htm";


AND cars.htm MUST be in the template folder!

Got it???

Regards,

Eliot Lee
Quote Reply
Re: Regular HTML pages instead of templates? In reply to
Pardon me,

But you don't seem to understand the concept behind links. All of the template files go in your
/cgi-bin/links/admin/templates/
folder.

When you create a category a directory is created in your
mydomain/links/pages/
folder that is the name of your category,
thus if your category name is "cars" the index file with your links will reside in
mydomain/links/pages/cars/
and your template "cars.htm" will reside in the template folder as already stated.

Try reasoning this out before you proceed and you'll save yourself a lot of time.

Quote Reply
Re: Regular HTML pages instead of templates? In reply to
I seem to be off track still. In the directory:
/cgi-bin/links/admin/templates/
I uploaded cars.htm

I made a category called cars that resides here
mydomain/links/pages/cars/

Everytime I add a test link, it creates the default template (not my template) in:
mydomain/links/pages/cars/index.htm

How come it doesn't create?:
mydomain/links/pages/cars/cars.htm

This is how I set the variables:

my $template;

# Set the appropriate template file to load
if ($category_name =~ /^cars/) {
$template = "cars.htm"; }
else { $template = "category.html"; }

Are these right? I uploaded cars.htm to the templates file and created a category called cars.




Quote Reply
Re: Regular HTML pages instead of templates? In reply to
Okay, hang in there, you're getting closer. The index.htm in
mydomain/links/pages/cars/index.htm
is your static html page that is viewed by your visitors. It contains the information from your template file cars.htm and the information loaded into it from your links database. In otherwords, it is functioning exactly as it is suppose to be functioning!

Users don't look for a page called "cars.htm", they choose a category from your home page, or category page, or your search engine called cars or containing cars and voila through the magic of perl they are transfered automatically to
mydomain/links/pages/cars/index.htm
which just by luck and good planning happens to be your "cars" category page based on your "cars.htm" template.

It is called index.htm so that it is the default file in that directory. Once you get used to the idea, you'll see that this is actually a very sensible way to organize your directories, database and links, and will wonder why you have been trying to swim upstream all this time.

Quote Reply
Re: Regular HTML pages instead of templates? In reply to
The script works!! Its modification from here on. I have 2 questions (let me know if you want me to start posting in the customization forum):

I want to use an "new image" for the new links, instead of the text with the red box. So I modified link.html

<%if isNew%>
<small><sup class="new">new</sup></small>
<%endif%>

Here is what I did to try to use the image:
<%if isNew%>
<img src="http://www.mysite.com/images/new1.jpg" width="33" height="11" alt="New Link!">
<%endif%>

After I modified the link.html page in the templates file to look like this, it completely stopped posting links from the database. Any suggestions?

Question #2
I tried to get the links to appear in a numbered list with this:
<ol></ol>

I keep getting a bulleted list. I edit through frontpage and publish with WS_FTP, maybe that is the code for frontpage only. Any suggestions here?