Gossamer Forum
Home : Products : Links 2.0 : Customization :

Enhanced Template.pm, missing

Quote Reply
Enhanced Template.pm, missing
The very useful Enhanced Template.pm, before at
http://www.gossamer-threads.com/...ces/Detailed/26.html ,
is missing now.

Before, the Enhanced Template Support was included in the Resource Center
( http://www.gossamer-threads.com/...cations/Version_2_x/ );
I can not find it in the previous place. Maybe it was moved to another page. (?)

If someone knows something, please say it in this Forum. Thank you very much.
Quote Reply
Re: Enhanced Template.pm, missing In reply to
Link to a previous and long conversation about the Enhanced Template.pm, now missing:

http://gossamer-threads.com/...r=37387&part=all

Quote Reply
Re: Enhanced Template.pm, missing In reply to
Look for New parse in the Resource Center in the Links 2.0 Modification section...does the same thing as the Enhanced Template.pm codes.

Regards,

Eliot Lee
Quote Reply
New Parse mod [Re: Enhanced Template.pm, missing] In reply to
Thank you very much, Eliot! Smile

For those interested, the links to this useful mod are:

New Parse
http://www.gossamer-threads.com/...es/Detailed/704.html
http://gossamer-threads.com/...ttach/1088-parse.txt

After a first look at the code (I have not tested it yet),
it seems that this mod allows <%if and <%ifnot tags,
and the following comparisons.

For numbers:
==
<
>

For strings of characters (ASCII order):
eq
lt
gt
=~

(Same meanings as in Perl).

Examples:

<%if Field Name% =~ 'Yellow'%>
<%ifnot Field Name% =~ 'Yellow'%>

Probably, closing with <%endif%> tags.
Quote Reply
New Parse mod [Re: Enhanced Template.pm, missing] In reply to
In Reply To:
Probably, closing with <%endif%> tags.
That is a given...You have to close all conditional statements that you put in your template files, OR...they will NOT work.

And your examples are INCORRECT...

They should be:

Code:

<%if Field Name eq "Yellow"%>
<%ifnot Field Name%>


Which in standard Perl is translated as follows:

Code:

if ($rec{'Field Name'} eq "Yellow") {
print qq|HTML|;
}
else {
print qq|OTHER HTML|;
}


Regards,

Regards,

Eliot Lee
Quote Reply
New Parse mod [Re: Enhanced Template.pm, missing] In reply to
In Reply To:
They should be:

<%if Field Name eq "Yellow"%>
<%ifnot Field Name%>
Yes, that is the working way of the Alex' Enhanced Template.pm. Maybe you are using this one.

Instead, for the New Parse mod, its Resources note adds a % at the end of the field name in comparisons (see above link).

I have not used these two mods, but if you are using the New Parse, then that Resources note would have mistakes, and should be corrected.

Thank you very much again. Surely this mod will be very useful.

Quote Reply
New Parse mod [Re: Enhanced Template.pm, missing] In reply to
You're welcome.

Regards,

Eliot Lee
Quote Reply
New Parse mod [Re: Enhanced Template.pm, missing] In reply to
Hi Eliot!

I went through an instruction you wrote on how to include headers and footers in the templates. (I think it was on your own site) And you have mentioned using the enhanced template.pm. I tried the New Parse (now that the other one is missing) and it gave me blank pages. Does the New Parse work for templates or does it clash and does it require any modifications?

Best Regards!


Quote Reply
New Parse mod [Re: Enhanced Template.pm, missing] In reply to
In Reply To:
Does the New Parse work for templates or does it clash and does it require any modifications?
It seems that with the New Parse codes, you have to use tags like the following:

Code:
<%include% header.txt%>
If all you want is Header and Footer files, I would recommend using the other methods that I have posted in the FAQ!!! Because, ya know what...they work!

Regards,

Eliot Lee
Quote Reply
New Parse mod [Re: Enhanced Template.pm, missing] In reply to
Dear Eliot,
:) Thanx for the advice. In fact, since that option did not work, so I went for the SSI option you had suggested and they do work but there is another problem. I am not sure if it is related though: bgcolor in table cells is not showing any color except for white. Could this be a related issue?

Links pages on my site are located at www.aarknet.com/pages/ if you may stop by. I was also thinking of using your other tip on integrating the content for home.html on my root directory. Any comments considering the above?

Laslty, 2 other questions:
Has there been a release or update since Links 2.0?

Earlier, the Gossamer's home page used to identify the visitor's country and somewhere in the resources there was description on how it was done. I can't find that any more. Any suggestions?

Best Regards!



Quote Reply
New Parse mod [Re: Enhanced Template.pm, missing] In reply to
In Reply To:
bgcolor in table cells is not showing any color except for white. Could this be a related issue?
If you are using CSS...then the problem lies in the CSS file (links.css), which you need to edit or delete and add your own bgcolor and font codes in your template files.

In Reply To:
I was also thinking of using your other tip on integrating the content for home.html on my root directory. Any comments considering the above?
I don't know what you want me to tell you...other than if you want to have your main LINKS index page in your <ROOT> directory, then use the code hack.

In Reply To:
Has there been a release or update since Links 2.0?
Not for the flat file version. LINKS SQL 1.1 was recently released. And Alex has indicated before, that there will probably NOT be a LINKS 3.0 as a flat file version. I thought you said that this was your last question.

Wink

In Reply To:
Earlier, the Gossamer's home page used to identify the visitor's country and somewhere in the resources there was description on how it was done. I can't find that any more. Any suggestions?
It should be in the Perl/CGI scripts section in the Resource Center.

Regards,

Eliot Lee
Quote Reply
New Parse mod [Re: Enhanced Template.pm, missing] In reply to
Thanx again.

Sorry I did not explain... Yes I am using CSS. Is that a problem? Do you use them or have you knocked them off? This is the first time I am using CSS on any web project. Are they really a help or a pain?

My question regarding contents on ROOT was also with the same point of view actually. I have read your code hack. I was wondering if (generally speaking) it has any serious clash with various MODs and code hacks advised throughout the Resources etc. and CSS, Headers and Footers, etc.?

By the way, which Forum script is being used here now? Earlier it was UBB, but this looks very different.

Best Regards!

Quote Reply
New Parse mod [Re: Enhanced Template.pm, missing] In reply to
In Reply To:
Do you use them or have you knocked them off?
I do NOT use them.

In Reply To:
This is the first time I am using CSS on any web project. Are they really a help or a pain?
Pain...they are not universally accessible across browsers, thus making it complicated to have the "same experience" model in web design.

In Reply To:
I was wondering if (generally speaking) it has any serious clash with various MODs and code hacks advised throughout the Resources etc. and CSS, Headers and Footers, etc.?
Why would it clash???? If you follow the directions in the code hack, then you should be fine!

In Reply To:
By the way, which Forum script is being used here now? Earlier it was UBB, but this looks very different.
http://www.wwwthreads.com

(Which is denoted in various spots in the Gossamer Threads web site.)

Regards,


Eliot Lee
Quote Reply
Alex's Enhanced Template Support has come back In reply to
Good news: The Alex's Enhanced Template Support is again available in the Resources.
(See the links above). Smile

Copy from the notes of this mod:

-------------------------------------------------

Enhanced Template Support! - This is the third generation template parser.
It allows you to include files, use nested if's, use ifnot's, and use comparision operators!
A must have for all Links owners.
(Added: 1999-09-08 Hits: 355 Rating: 8.97 Votes:81)

-------

Note: This parse() includes the changes for

<%include filename%>
<%ifnot variable%> text <%endif%>
<%if variable eq 'string'%> text <%endif%>

You can use the following operators for comparision: eq, =, lt, gt, >, <.

-------------------------------------------------

(In fact, according as well to the code of the mod, it's "==" for numbers, and not "=").