Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Whats the purpose of <%~if ?

Quote Reply
Whats the purpose of <%~if ?
Hi

I've recently updated to 3.0.4 and noticed the if & endif statements have a tilde like <%~if instead of just <%if.

Wondering what the purpose of it was.

Thanks

Regards

minesite

Last edited by:

minesite: Nov 22, 2005, 10:47 PM
Quote Reply
Re: [minesite] Whats the purpose of <%~if ? In reply to
The ~ is used to remove the whitespace before (and if it's on the other side, after) the template code. It's just to produce nicer output, but sometimes is required (where whitespace can make a difference).

Adrian
Quote Reply
Re: [brewt] Whats the purpose of <%~if ? In reply to
Thanks Adrian, the main reason I asked is I'm getting an error when building Detailed pages although it will build most of them before the following error occurs.

Error message is:

<p><font face='Tahoma,Arial,Helvetica' size=2>A fatal error has occured:</font></p><blockquote><pre>GT::Template (9853): Unknown method '_get_value' called at /compiled/detailed.html.compiled line 470.
</pre></blockquote><p><font face='Tahoma,Arial,Helvetica' size=2>Please enable debugging in setup for more details.</font></p>
GT::Template (9853): Unknown method '_get_value' called at /compiled/detailed.html.compiled line 470.


This is detailed.html.compiled line 470

if (defined($tmp = $self->_get_value(q{~if paymentsEnabled}, $strict))) {
$return .=(ref $tmp eq 'SCALAR' ? $$tmp : $escape ? GT::CGI::html_escape($tmp) : $tmp);
}
else {
$return .= q{Unknown tag: '~if paymentsEnabled'};
}

Any clues ?

Thanks

Regards

minesite
Quote Reply
Re: [minesite] Whats the purpose of <%~if ? In reply to
Are you running glinks under mod_perl? Perhaps you have mixed versions of libraries installed?

Adrian
Quote Reply
Re: [brewt] Whats the purpose of <%~if ? In reply to
Yes it is under mod perl, how do I fix that.?

Regards

minesite
Quote Reply
Re: [minesite] Whats the purpose of <%~if ? In reply to
See this thread: http://www.gossamer-threads.com/...orum.cgi?post=263164

Adrian

Last edited by:

brewt: Nov 23, 2005, 2:11 AM
Quote Reply
Re: [brewt] Whats the purpose of <%~if ? In reply to
Hi Adrian

Made changes to modperl_startup.pl as

use lib
'/links/admin',
'/forum/admin',
'/community/private/lib';

Tried this as well:

use lib
'/links/admin',
'/community/private/lib',
'/forum/admin';

Wasn't quite sure which was the later update, community or forum,

I'm still getting error messages on detailed build, I have been deleting the parts which generates the errors to narrow it down but it finds another error else where.

I'm using heavily modified templates but prior to the upgrade had no problems.
The if statement are pretty much the same throughout the old and new versions so I can't see what the problem would be.


<p><font face='Tahoma,Arial,Helvetica' size=2>A fatal error has occured:</font></p><blockquote><pre>GT::Template (21886): Unknown method '_get_value' called at/compiled/category.html.compiled line 2171.
</pre></blockquote><p><font face='Tahoma,Arial,Helvetica' size=2>Please enable debugging in setup for more details.</font></p>
GT::Template (21886): Unknown method '_get_value' called at /compiled/category.html.compiled line 2171.


line 2171.
if (defined($tmp = $self->_get_value(q{~if paymentsEnabled}, $strict))) {
$return .=(ref $tmp eq 'SCALAR' ? $$tmp : $escape ? GT::CGI::html_escape($tmp) : $tmp);
}
else {
$return .= q{Unknown tag: '~if paymentsEnabled'};

Any suggestions.
[ I bet its something real simple and stupid that I've done.Crazy]

Thanks

Regards

minesite

Last edited by:

minesite: Nov 24, 2005, 7:51 PM
Quote Reply
Re: [minesite] Whats the purpose of <%~if ? In reply to
Perhpas you could try using the latest GT lib for all by symlinking everything to the links GT. can't recall which one, but a series of errors disappeared (there were issues between gcom and glinks despite correct loading) once we symlinked everything to Glinks GT... this happened particularly after upgrade to Glinks 3. No logical reasoning but just a shot in the dark.

This has always been requested for separating out the GT lib to a separate directory installation for running multiple GT apps under mod_perl so that it becomes easier to maintain.

Thanks
HyTC
==================================
Mail Me If Contacting Privately Is That Necessary.
==================================
Quote Reply
Re: [minesite] Whats the purpose of <%~if ? In reply to
In Reply To:
Made changes to modperl_startup.pl as

use lib
'/links/admin',
'/forum/admin',
'/community/private/lib';

Tried this as well:

use lib
'/links/admin',
'/community/private/lib',
'/forum/admin';
Do you have:

Code:
use Links::mod_perl;
in your mod_perl startup file (and also, a corresponding use Community::mod_perl and use GForum::mod_perl)? Without that, the lib order may be changed before certain modules are actually loaded.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Whats the purpose of <%~if ? In reply to
Hi Jason

Yes, as follows.

use lib
'/mysite/cgi-bin/links/admin',
'/mysite/cgi-bin/forum/admin',
'/mysite/cgi-bin/community/private/lib';

use Links::mod_perl;
use GForum::mod_perl;
use Community::mod_perl;

Regards

minesite

Last edited by:

minesite: Nov 25, 2005, 3:44 PM
Quote Reply
Re: [HyperTherm] Whats the purpose of <%~if ? In reply to
Hi HyTC

I'll see if GT can come up with an answer first, if not I'll give anything a shot.

Regards

minesite
Quote Reply
Re: [minesite] Whats the purpose of <%~if ? In reply to
UPDATE:

I deleted all the tilde's [<%~if] in the "if" statements on all the templates and it went through a full build.

Not sure why, but would like to know the reason if GT can find out.

Strange that it's just my setup.Crazy

Regards

minesite