Work with POST/GET

Author Message

Thomas Brandl

Wednesday 10 September 2003 5:15:19 am

Hi all (I'm flooding the forums today...),

need a piece of info for a very simple task:
I want the user to choose/filter objects based on a select-box.
So I need to access POST/GET variables in order to use them in a let-fetch-statement, like pseudo code:
{let obj=fetch(content,list,hash(node_id,$POST.formfield_name,...))}

How can I do this in the most simple manner? Do I need a module for that? Does anyone have a *really* simple example of such a module, using some common API-functions to demonstrate, how to work with modules?

Thanks a lot!
Tom

Paul Forsyth

Wednesday 10 September 2003 6:10:04 am

Look at the contribution for ezenv. I dont have the url at hand but it should be easy to find. This will allow you to use post/get variables in templates.

Paul

Thomas Brandl

Wednesday 10 September 2003 8:30:07 am

Thanks Paul, that will do, I guess!

For those interested:
http://ez.no/developer/ez_publish_3/contributions/ezenv

Paul Borgermans

Wednesday 10 September 2003 8:36:53 am

This is only a temporary work-around I wrote out of frustration, you need to turn of view caching!

Its on ez's todo list for a more general mechanism: the main problem is that such variables should be included in the standard view caching

You can implement the caching yourself with cache-blocks which include the post/get variable value in the cache block key.

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Thomas Brandl

Monday 15 September 2003 9:21:31 am

So what you did is turn off view-caching and apply cache-blocks everywhere, where they were neccessary??

Don't you loose lots of performance that way?
t

Paul Borgermans

Monday 15 September 2003 9:28:15 am

Yes, it puts a heavy burden on CPU and end-user patience.

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Thomas Brandl

Tuesday 16 September 2003 4:29:32 am

Damn, I was hoping to come around this easily! My machine is a PII 233MHz - can't afford to turn off caching!

Any ideas on how to accomplish that - well then not the easy way?

@eZ: I definitely think that such basic communication between forms and the system should be possible without much hassle. Are there any plans to support sht. like this in the near future? Or any reasons, why you do not want to implement it?

(I feel really bad when pushing eZ, since they already have a load of work to do, and I actually should just sit still and be thankful ...)

Btw: Thanks for the attribute_filter info, Paul, should have found this myself ;)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 21:01:49
Script start
Timing: Jan 18 2025 21:01:49
Module start 'layout'
Timing: Jan 18 2025 21:01:49
Module start 'content'
Timing: Jan 18 2025 21:01:49
Module end 'content'
Timing: Jan 18 2025 21:01:49
Script end

Main resources:

Total runtime0.6990 sec
Peak memory usage4,096.0000 KB
Database Queries71

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 587.7969152.6094
Module start 'layout' 0.00560.0036 740.406339.4297
Module start 'content' 0.00920.6882 779.8359612.0469
Module end 'content' 0.69750.0015 1,391.882816.1875
Script end 0.6990  1,408.0703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.5751160.0003
Check MTime0.00140.2031160.0001
Mysql Total
Database connection0.00080.107310.0008
Mysqli_queries0.636591.0648710.0090
Looping result0.00070.0993690.0000
Template Total0.666195.320.3330
Template load0.00230.326220.0011
Template processing0.663894.962020.3319
Template load and register function0.00020.022910.0002
states
state_id_array0.00110.159210.0011
state_identifier_array0.00090.127320.0004
Override
Cache load0.00190.2775380.0001
Sytem overhead
Fetch class attribute can translate value0.00110.162130.0004
Fetch class attribute name0.00100.143280.0001
XML
Image XML parsing0.00080.115030.0003
class_abstraction
Instantiating content class attribute0.00000.002990.0000
General
dbfile0.00090.1276170.0001
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 26
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs