[pmwiki-users] if directive and pagelist and LocalTemplate

SMETS Stephane BKS-IT stephane.smets at banksys.be
Thu May 3 07:49:25 CDT 2007


> The if directive returns always false excepted when the page contains emsquery.
> 
> So my conclusion is : in the case of a pagelist, the "name" test uses the current page name and not a pagename coming from the pagelist, by opposite of the wiki variables like $FullName

That is the correct behaviour.

(:if name ...:) always tests the name of the current page, whether the
condition is inside a pagelist template or not.

Hum, it seems not logical to me, but if it is the normal behaviour.. (That means also we can't use any of the if directives related to pagename in a pagelist format,...)

I can't remember whether there is an if condition that does matching (as
distinct from equality).  If you could make do with equality, you could
have something like:

(:if equals "{=$Name}" "EMSQUERY":)
The fact here is that I need a substring. 
I have find another way by creating a $Condition more, but I was looking to find a way to do that in the core,... which is always better than coding myself
This is the code I use now : 
global $Conditions;
$DefaultEMSQueryGroupName = 'EMSquery'; 
$Conditions['emsq'] = "stristr(\$condparm,'$DefaultEMSQueryGroupName')";

If you want to reused it, put your string to find in $DefaultEMSQueryGroupName . The directive is (:if emsq {=$FullName} : )
Stéphane 

Kathryn Andersen
-- 
 _--_|\     | Kathryn Andersen	<http://www.katspace.com>
/      \    | 
\_.--.*/    | GenFicCrit mailing list <http://www.katspace.com/gen_fic_crit/>
      v     | 
------------| Melbourne -> Victoria -> Australia -> Southern Hemisphere
Maranatha!  |	-> Earth -> Sol -> Milky Way Galaxy -> Universe

_______________________________________________
pmwiki-users mailing list
pmwiki-users at pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


sa Banksys nv - Chaussee de Haecht 1442 Haachtsesteenweg 
- 1130 Brussels - Belgium
RPM-RPR Bruxelles-Brussel - TVA-BTW BE 0418.547.872
Bankrekening-Compte Bancaire-Bank Account 310-0269424-44
BIC BBRUBEBB - IBAN BE55 3100 2694 2444

"The information contained in this e-mail and any attachment thereto is confidential and may contain information which is protected by intellectual property rights.
This information is intended for the exclusive use of the recipient(s) named above.
This e-mail does not constitute any binding relationship or offer toward any of the addressees.
If you are not one of the addressees , one of their employees or a proxy holder entitled to hand over this message to the addressee(s), any use of the information contained herein (e.g. reproduction, divulgation, communication or distribution,...) is prohibited.
If you have received this message in error, please notify the sender and destroy it immediately after.
The integrity and security of this message cannot be guaranteed and it may be subject to data corruption, interception and unauthorized amendment, for which we accept no liability."




More information about the pmwiki-users mailing list