[Solved] content/keyword and empty view_parameters

Author Message

Jeremy B.

Thursday 20 August 2009 1:32:52 am

Hi all,

Has anyone managed to work with $view_parameters in a content/keyword template ?

In an overrided template, it works like a charm, but not in a "content/keyword". The parameters are just not there, but the url has its parameters.

Any ideas ?

Thanks in advance :)

André R.

Thursday 20 August 2009 2:26:31 am

Its not supported by the keyword view, a quick glance in the 20 lines of code in kernel/content/keyword.php shows that it supports 'Alphabet', 'Offset' and 'ClassID'.
in kernel/content/module.php the last two are defined as unordered params meaning the syntax is like:
content/keyword/SomeKeyword/(offset)/0/(classid)/2

These parameters are available in the template, and I'll let you figgure out where from the view code(simplified):

$tpl->setVariable( 'view_parameters', array( 'offset' => $Offset, 'classid' => $ClassID ));
$tpl->setVariable( 'alphabet', $Alphabet );

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Jeremy B.

Thursday 20 August 2009 2:55:46 am

Thanks André for your quick reply :)

I didn't think about checking the php file.

I'm going to do an override of the keyword.php and module.php files in order to set the params I need to the template.

Thank !

Jeremy B.

Thursday 20 August 2009 3:45:26 am

Hi again...

I folowed this article :
http://ezpedia.org/en/solution/overriding_kernel_classes_within_an_extension

in order to override the keyword.php file.

Then I get the message "var/autoload/ezp_override.php not found". I don't understand what to put in this file...

Am I on the right way ?

Any help would be very appreciated :)

André R.

Thursday 20 August 2009 4:15:10 am

Neither module.php or view files like keyword.php are classes, so you can't override them like that.
You can however copy it to your own module instead (you'll need to create one in a extension) and have your very own custom keyword view there.
Optionally you can in addition use url alias to redirect urls from content/keyword to mymodule/keyword, but only if you don't want to correct the url in the templates.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Jeremy B.

Thursday 20 August 2009 5:53:30 am

Ok I get it now.

Thanks for your help :)

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 16:02:09
Script start
Timing: Jan 18 2025 16:02:09
Module start 'layout'
Timing: Jan 18 2025 16:02:09
Module start 'content'
Timing: Jan 18 2025 16:02:10
Module end 'content'
Timing: Jan 18 2025 16:02:10
Script end

Main resources:

Total runtime0.5739 sec
Peak memory usage4,096.0000 KB
Database Queries66

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 588.0625152.6406
Module start 'layout' 0.00590.0022 740.703139.4766
Module start 'content' 0.00810.5645 780.1797568.6484
Module end 'content' 0.57260.0013 1,348.828116.1250
Script end 0.5739  1,364.9531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.5642160.0002
Check MTime0.00130.2237160.0001
Mysql Total
Database connection0.00070.130410.0007
Mysqli_queries0.520890.7410660.0079
Looping result0.00050.0934640.0000
Template Total0.546795.320.2734
Template load0.00200.350120.0010
Template processing0.544794.915720.2724
Template load and register function0.00020.028610.0002
states
state_id_array0.00070.117810.0007
state_identifier_array0.00070.121620.0003
Override
Cache load0.00170.3039360.0000
Sytem overhead
Fetch class attribute can translate value0.00080.137820.0004
Fetch class attribute name0.00100.173170.0001
XML
Image XML parsing0.00080.133320.0004
class_abstraction
Instantiating content class attribute0.00000.002880.0000
General
dbfile0.00090.1498170.0001
String conversion0.00000.000940.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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs