Gossamer Forum
Home : Products : Gossamer Links : Discussions :

<%if Contact Name%> tag problem

Quote Reply
<%if Contact Name%> tag problem
How to handle such template operation?
<%if Contact Name%><%Contact Name%><%endif%>

It will be always false because only Contact Name isn't handled together.

Using quotes <%if "Contact Name"%>, I get the following error:
GT::Template (3732): Unable to run compiled template file '/path/link.html.compiled'. Reason: $@: syntax error at /path/link.html.compiled line 106, near "() "
(Might be a runaway multi-line {} string starting on line 100)
syntax error at /path/link.html.compiled line 110, near "else"

The error is at line 106, that value is missing from if () statement:
Code:
if () {
if (defined($tmp = $self->_get_value(q{Contact Name}, $strict))) {
$return .=(ref $tmp eq 'SCALAR' ? $$tmp : $escape ? GT::CGI::html_escape($tmp) : $tmp);
}
else {
$return .= q{Unknown Tag: 'Contact Name'};
}
}
else {
$return .= q{-};
}

Any idea how to solve the problem?

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] <%if Contact Name%> tag problem In reply to
<%if Contact_Name%><%Contact_Name%><%endif%>

... works fine for me.
Quote Reply
Re: [Payooo] <%if Contact Name%> tag problem In reply to
Yes, of course works, if you use that way: <%Contact_Name%>

My problem is when using without the _ sign.
Using <%Contact Name%> works. But using <%if Contact Name%> doesn't work.

Do you see the problem?

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] <%if Contact Name%> tag problem In reply to
Hmmm, I get Unknown Tag: 'Contact Name' when using <%Contact Name%>
Quote Reply
Re: [Payooo] <%if Contact Name%> tag problem In reply to
Smile Because you don't have such field.

Note: <%Contact Name%> and <%Contact_Name%> are different fields.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: May 25, 2003, 8:49 PM
Quote Reply
Re: [webmaster33] <%if Contact Name%> tag problem In reply to
Crazy
Quote Reply
Re: [webmaster33] <%if Contact Name%> tag problem In reply to
Short answer is you can't =) ...tags with spaces aren't supported.
Quote Reply
Re: [Paul] <%if Contact Name%> tag problem In reply to
Paul,
Well, if <%Contact Name%> works, then <%if Contact Name%> should also work, shouldn't it?

Jason,
Why is not possible the quoting of a tag like: <%if "Contact Name"%> ?
Could be possible to add such quoting feature into template parser?

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] <%if Contact Name%> tag problem In reply to
Jason?

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] <%if Contact Name%> tag problem In reply to
Quote:
Well, if <%Contact Name%> works, then <%if Contact Name%> should also work, shouldn't it?

Fraid not, <%Contact Name%> only works because if the template parser can't determine what the tag is (i.e. an include, if, else, function, etc), then it assumes it's a regular variable. Making the parser support variables with spaces would be quite difficult to do.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] <%if Contact Name%> tag problem In reply to
Quote:
Making the parser support variables with spaces would be quite difficult to do.
I don't suggest to support spaces directly. I suggest to support quoting of variables, so withing quotes space would be also acceptable:
<%if "Contact Name"%>

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] <%if Contact Name%> tag problem In reply to
Hi,

It would be very difficult to do, and add a lot of complexity to the template parser for what I think is little gain.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] <%if Contact Name%> tag problem In reply to
That's true, we doesn't gain too much with that fix.
It's not difficult for the html developer to replace space to _

Just wanted to make you to know about that missing feature.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...