Thursday 03 February 2005 5:26:14 pm
Hi,
Ive been struggling with this. According to the documentation I should be able to use ezhttp to grab the variables passed via get or put.
The documentation at
http://www.ez.no/ez_publish/documentation/reference/template_operators/data_extraction/ezhttp shows the syntax, but its not working for me. Even more bizzare is that the results are sometimes shown correctly, but I havent been able to determine why it works sometimes and not others. Im using 3.4.4
The code below should have a text field and drop down menu/selection from my custom class. It should use get to pass the vars back to itself which Im using in my fetch to return the correct results. I can see the url itself does have the parameters in it eg: http://www.somesite.com/index.php/intranet/our_resources/intranet/phone_list?searchname=Bob&searchdepartment=0&searchbutton.x=7&searchbutton.y=7
{let search_name=ezhttp('searchname','get')
search_department=ezhttp('searchdepartment','get')
}
{* SEARCH FIELDS *}
{* NAME ENTRY FIELD *}
<form action="/index.php/intranet/our_resources/intranet/phone_list" method="get">
<p>Name</p>
<input id="searchname" type="text" name="searchname" size="22" maxlength="24"/>
<input type="image" border=0 name="searchbutton" src={"/images/top_nav/search_button.gif"|ezdesign}>
{* DEPARTMENT SELECTION *}
{set department_list_array=fetch( 'content', 'class_attribute', hash( 'attribute_id', 263 ) )}
<div class="element">
<label>Department</label><div class="labelbreak"></div>
<select name="searchdepartment">
<option value="-1">Any Department</option>
{section loop=$department_list_array.content.options }
<option value="{$department_list_array.content.options.$index.id}"> {$department_list_array.content.options.$index.name} </option>
{/section}
</select>
</div>
</form>
<hr>
<p>search_name={$search_name}</p>
<p>search_department={$search_department}.</p>
{/let}
the syntax being used with ezhttp is just one version Ive tried. Ive also tried without the single qoutes and also using first_set (just because there was an example of setting a variable in a post that someone had confirmed working).
Yet again its bound to be something stupid Im doing, but I cant see what. Or is just bad karma to pass vars back to the same template in this manner? Any help greatly appreciated. Arran
|