Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

null and not null for different templates

Quote Reply
null and not null for different templates
for Links Sql 2.1 and for photo use,

Using two different templates : default and template2

Is it possible to have a photo column null for default and not null for template2?

Many thanks

Antoine

Quote Reply
Re: [antoined] null and not null for different templates In reply to
I don't think you need 2 templated for this. You can solve within 1 template set:

In category.html or even in link.html template page you can use this template code:
Code:
<%if Photo%>
<%include photo.html%>
<%else%>
<%include nophoto.html%>
<%endif%>

Hope that helps.

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] null and not null for different templates In reply to
I am using 2 templates for two differents forms to fill out and to display links differently.

I can't use <%if Photo%> because Photo Column is set to yes (Null), so in any case it is presented.

That means that your suggestion for

<%if Photo%><%include photo.html%><%else%><%include nophoto.html%><%endif%> is always to display photo.html ! or I am wrong???

Thanks

Antoine

Quote Reply
Re: [antoined] null and not null for different templates In reply to
Wait, thinking...

EDIT:
Got confused a bit for a moment. Now is clear.

  • The template code I suggested will work, as long you have the photo.html & nophoto.html files in both template sets.
  • If you want to have only 1 copy of them, then makes the things a bit difficulter, and should use global for that task.
    But I think first solution should be fine for you and no need for a global.

    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 5, 2003, 7:24 AM
    Quote Reply
    Re: [antoined] null and not null for different templates In reply to
    If the Photo column is set to NULL then doesn't that mean the if/else would work?

    Link One:
    Photo = me.jpg

    Link Two:
    NULL

    Thet means the "if Photo" would catch Link One and the "else" would catch Link Two.