The if parameter works differently in list and search functions, than any
other function. In most functions, the value is processed as based on the
current page and determines whether or not the process is called.
In list and search, the if function is run on each item in the report to
determine whether or not it is included in the report. You can use
{+field}, {+value}, {+p}, {+p0}, {+title}, etc. Normal vars (like {p} and
the rest are processed before the function is ever called and refer to the
page you are on. So you can do if='equal {+p2} {p2}' and it will work as
expected.
In my tests, seems to be working. If something isn't, just let me know--I
can look into it a bit more. But as you have already discovered, there's
often more than one way to do things in BoltWire. :)
Cheers,
Dan
On Mon, Oct 6, 2014 at 1:04 PM, Tiffany Grenier <[email protected]>
wrote:
> Perfect :-)
> Also, as this may interest someone looking for solutions related to the
> pulldown menu, I was trying to do some filtering on the data variables of
> the result, but it seems that they are not replaced in the the if clause.
> If I put the if inside the template, however, it works great.
>
> Cheers,
> Tiffany
>
> Le lundi 6 octobre 2014 14:59:04 UTC+2, Dan a écrit :
>>
>> I was having a similar problem the other day and finally figured out the
>> reason and a workaround. I actually added a couple paragraphs to the
>> documentation on this issue at
>>
>> http://www.boltwire.com/index.php?p=docs.handbook.forms.input_select
>>
>> Look for the section on templates. Basically it has to do with the order
>> of processing.
>>
>> This morning I went back and looked at the code to find a better
>> solution, and discovered there was something already there--it just wasn't
>> working right. So I changed lines 326 and 327 in library.php to these and
>> it now allows fmts to have {+title}:
>>
>> $out = preg_replace('/\{\+([^:{}+=*]+)\}/e', "BOLTvars('$page:$1')",
>> $out); // template replacements $out = preg_replace('/\{\+:?([^{}+=*]+)\}/e',
>> "BOLTvars('$page:$1')", $out); // nested template replacements
>>
>> Also a more serious problem. I had commented out line 415 of library.php
>> when I was doing some debugging in the last release and forgot to uncomment
>> it. Please fix that while you are at it, or you will have problems on forms
>> where nextpage is not explicitly set. I'm posting an emergency patch to
>> 4.17.
>>
>> Cheers,
>> Dan
>>
>> On Mon, Oct 6, 2014 at 5:01 AM, Tiffany Grenier <[email protected]>
>> wrote:
>>
>>> Hi again :-)
>>>
>>> This time, I'm trying to create a form where people can select let's say
>>> their best friend through a pulldown menu, and I can't make it display the
>>> page titles (friend pseudo).
>>> I've tried to do the following, without success: [select bestie][(search
>>> group=member type=-{zones} fmt='[option "{+p}" "{+title}"]')][select]
>>> The following works, but is not what I wanted: [select bestie][(search
>>> group=member type=-{zones} fmt='[option "{+p}" "{+page}"]')][select]
>>> Could you please tell me what I'm doing wrong?
>>>
>>> Cheers,
>>> Tiffany
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "BoltWire" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/boltwire.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "BoltWire" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/boltwire.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/boltwire.
For more options, visit https://groups.google.com/d/optout.