How to make custom module handle request to certain node

Author Message

Mihhail Rekun

Tuesday 04 July 2006 12:16:06 pm

Hello,

I have learned templates override system but couldn't find any place where it is described how to run module when a certain node is requested - for example I have a folder "company" and a custom content object in it - publications (file) and there is a template override for it.
Then, how do I make my module run when user requests index.php/company/publications so that object in the folder is displayed by my module, not by default content module ?

Thanks in advance,

Mihhail

Xavier Dutoit

Tuesday 04 July 2006 1:43:18 pm

Hi,

Not sure to understand what you want to do.

One solution would be to create an template operator in your module "whatever".

Then you override a template for your node and {whatever param=xxx}

X+

http://www.sydesy.com

Kristof Coomans

Wednesday 05 July 2006 4:04:44 am

What would you like to let your custom module do? Maybe this can be solved in another way.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Mihhail Rekun

Wednesday 05 July 2006 6:20:14 pm

I'm trying to implement the following task -

There is an object of my custom class - publications (which is a CSV file with links to publications). This object sits in an content tree in a folder company.
When I type in http://localhost/index.php/company/publications/ then I need data from this file to be parsed and passed to the custom template.

How can I know from the PHP class in module what is current node to reach current object properties?

I have tried this construction and it doesn't work:

{let pubs=fetch( 'AgiPubs', 'fetchPubs',hash('node_id',$module_result.node_id) ) a=$module_result.node_id}

{$a|attribute( show, 3 )}

{let}

Parameter $node_id that arrives to fetchPubs is empty and $a appears to be empty either.

I also found out that inside of a module class "$tpl->variables['']['node']->NodeID" - returns the desired number

What would be the best way to get properties of a current object from a custom module class?

Sorry for a bit messy questions,

Best regards,

Mihhail

Mihhail Rekun

Thursday 06 July 2006 7:50:17 am

And another related problem I have -

if I have a site tree made of content objects:

-Company (folder)
-Products
-Registration(folder)

This site tree structure is a requirement to make menus and automatic site map.

When a user goes to "/localhost/registration/new_user" for example - "registration" module is run and "new_user" view is shown, but current node is not "/registration/" any more, and location is not shown on a sitemap and menus.

I'm not sure this is a good approach, please advice :)

Thanks,

Mihhail

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 19 2025 01:00:23
Script start
Timing: Jan 19 2025 01:00:23
Module start 'layout'
Timing: Jan 19 2025 01:00:23
Module start 'content'
Timing: Jan 19 2025 01:00:24
Module end 'content'
Timing: Jan 19 2025 01:00:24
Script end

Main resources:

Total runtime0.6778 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 589.4063152.6563
Module start 'layout' 0.00610.0031 742.062539.4922
Module start 'content' 0.00920.6674 781.5547601.1875
Module end 'content' 0.67660.0012 1,382.742212.1094
Script end 0.6778  1,394.8516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4647160.0002
Check MTime0.00140.1999160.0001
Mysql Total
Database connection0.00110.155210.0011
Mysqli_queries0.613290.4643650.0094
Looping result0.00060.0931630.0000
Template Total0.639094.320.3195
Template load0.00200.300020.0010
Template processing0.637093.975620.3185
Template load and register function0.00020.031910.0002
states
state_id_array0.00220.323010.0022
state_identifier_array0.00100.147320.0005
Override
Cache load0.00180.2586450.0000
Sytem overhead
Fetch class attribute can translate value0.00070.107630.0002
Fetch class attribute name0.00100.144070.0001
XML
Image XML parsing0.00110.161830.0004
class_abstraction
Instantiating content class attribute0.00000.002470.0000
General
dbfile0.00270.3917220.0001
String conversion0.00000.001540.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/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: 22
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs