[support] slight problem with encoding

Neil Coghlan neil at esl-lounge.com
Thu Apr 22 14:35:49 UTC 2010


OK, I did some playing around. I need to wrap the query part in single 
quotes, like this:

    $items[] = l($term->name, "personnel-search", array('query' => 
'type=$term->tid')) . " ($count)";

this parses now, and the ? and = sign are being passed correctly in the URL 
when clicking BUT the tid variable is staying as a variable...maybe you 
can't put variables in the array section. So I'm getting links like this 
now:

personnel-search?type=$term->tid

perhaps I need to split it off like what's been done with the $count part??

----- Original Message ----- 
From: "Earnie Boyd" <earnie at users.sourceforge.net>
To: <support at drupal.org>
Sent: Thursday, April 22, 2010 11:08 AM
Subject: Re: [support] slight problem with encoding


> Neil Coghlan wrote:
>> Thanks for the idea, unfortunately exactly the same problem. The issue
>> is with the ? and = symbols.
>>
>
> Yea well, I knew that wouldn't work.
>
> Looking at http://api.drupal.org/api/function/l/6 we see that we should
> write
>
> $items[] = l($term->name, "personnel-search?type=$term->tid")
>
> as
>
> $items[] = l($term->name, "personnel-search", array('fragment' =>
> type=$term->tid))
>
> The above is untested and you might need 'query' instead of 'fragment'.
>
> -- 
> Earnie
> -- http://progw.com
> -- http://www.for-my-kids.com
> -- 
> [ Drupal support list | http://lists.drupal.org/ ]
> 



More information about the support mailing list