Forums / General / How to make custom module handle request to certain node

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

eZ debug

Timing: Jan 20 2025 05:08:35
Script start
Timing: Jan 20 2025 05:08:35
Module start 'content'
Timing: Jan 20 2025 05:08:37
Module end 'content'
Timing: Jan 20 2025 05:08:37
Script end

Main resources:

Total runtime2.0252 sec
Peak memory usage4,096.0000 KB
Database Queries202

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 589.1875180.8047
Module start 'content' 0.00651.7372 769.9922606.2969
Module end 'content' 1.74370.2814 1,376.2891337.3594
Script end 2.0252  1,713.6484 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.2097210.0002
Check MTime0.00150.0737210.0001
Mysql Total
Database connection0.00080.038410.0008
Mysqli_queries1.933295.45662020.0096
Looping result0.00250.12442000.0000
Template Total1.994198.520.9971
Template load0.00230.112420.0011
Template processing1.991898.349620.9959
Template load and register function0.00040.017710.0004
states
state_id_array0.00100.051610.0010
state_identifier_array0.00230.112620.0011
Override
Cache load0.00190.0949450.0000
Sytem overhead
Fetch class attribute can translate value0.00220.106440.0005
Fetch class attribute name0.00430.212770.0006
XML
Image XML parsing0.00150.072740.0004
class_abstraction
Instantiating content class attribute0.00000.000870.0000
General
dbfile0.00720.3563330.0002
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs