Gossamer Forum
Home : Products : Links 2.0 : Customization :

'IFNOT' works and doesn't work (???)

Quote Reply
'IFNOT' works and doesn't work (???)
Hi

I don t understand what happens.

In category.html, i use <%ifnot%> tag and it works fine with the variables 'img' or 'banner' :

**********
<%ifnot banner%>testBANNER1<%endif%>
or
<%if banner eq ''%>testBANNER2<%endif%>

Idem with 'img'

<%ifnot img%>testIMG1<%endif%>
or
<%if img eq ''%>testIMG2<%endif%>

All that works very fine. If there is not a variable 'banner', then 'testBANNER1' appears and if there is a variable 'banner', then the <%banner%> appears.
**********

BUT the problem is that it does NOT work with the variable 'bannervert' :

<%ifnot bannervert%>testBANNERVERT1<%endif%>
or
<%if bannervert% eq ''%>testBANNERVERT2<%endif%>

There is no data in 'bannervert' field but still nothing appears. But if there is a data in 'bannervert' field, then the <%bannervert%> appears in my pages. I cannot find why it does not work when there is no variable 'bannervert'. It does not seem to be a problem of <%ifnot%> because it works with 'img' and 'banner' variables.

I thought it could be a problem in 'nph_build.cgi' but testing different ways, no result :

# ********************** nonenglish modification - begin ****************
# ($description, $related, $meta_name, $meta_keywords, $header, $footer) = @{$category{$cat}}[2..7];
($id,$category_name,$description, $related, $meta_name, $meta_keywords, $header, $footer, $nonenglish,$catsort,$subcat,$type,$img,$banner,$bannervert) = @{$category{$cat}}[0..15];
# *********************** nonenglish modification - end ******************


NB : i use the 'nonenglish mod too'

Here are the files 'category.def', 'site_html_template' and 'nph_build.cgi'.
Has anyone got any idea ???

Thanx a lot.

J
Quote Reply
Re: [jigme] 'IFNOT' works and doesn't work (???) In reply to
I'm not sure <%ifnot ...%> is supported in Links 2. Have you tried;

Code:
<%if var%>
... dont do anything here
<%else%>
... he is the equivelant area of where
the 'ifnot' statement would take you
to normally....
<%endif%>

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] 'IFNOT' works and doesn't work (???) In reply to
Thanks a lot for your answer !!! Wink

<%ifnot ...%> does work with 'img' and 'banner' variables' but it does not with 'bannervert' (???).

I tried your suggestion but this is what is replied :

Unkown Tag: else testBANNERVERT2

Argh ... Crazy
Quote Reply
Re: [jigme] 'IFNOT' works and doesn't work (???) In reply to
Do you have the Enhanced Template mod installed?

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] 'IFNOT' works and doesn't work (???) In reply to
yes
Quote Reply
Re: [jigme] 'IFNOT' works and doesn't work (???) In reply to
I'm stumped then I'm afraid :(

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] 'IFNOT' works and doesn't work (???) In reply to
Sorry to insist :

Did you have a look to the attached files ?

If yes, i will give up then (you know all that better than i)

if not i will keep on to search ...



Thanks a lot for your kind efforts.

Best regards,

J
Quote Reply
Re: [jigme] 'IFNOT' works and doesn't work (???) In reply to
Do you have template usage enabled? If so, why did you paste/work on site_html_templates.pl ?

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] 'IFNOT' works and doesn't work (???) In reply to
Yes, in 'links.cfg', it is :

$build_use_templates = 1;


It is said there :

# 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.


Then, as since i ever worked on 'links2' script, i use 'site_html_template.pl', and untill now all worked fine.

'site_html.pl' is useless when '$build_use_templates' =1

Isn't it ? Pirate
Quote Reply
Re: [jigme] 'IFNOT' works and doesn't work (???) In reply to
No idea then...sorry Frown

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] 'IFNOT' works and doesn't work (???) In reply to
In case of it might help, here is how i finally got it :

'bannervert' was the last of the 14 category variables in 'category.def'.

i added a 15th variable in 'category.def' and now it works, the 'bannervert' works fine with 'ifnot'. it does not work with the last variable of 'category.def'. I don't understand why ... but finally it works !!! SlySlySly

Thank you VERY MUCH for your kind help.

Cheers

Wink

J