Forums / Developer / Node and module question

Node and module question

Author Message

Clemens T

Monday 30 May 2005 7:20:30 am

Heya All,

I'm currently using the following code to browse the Contenttree below node 86. The nodeid is passed by using the paramters in the url.

So http://mysite.com/index.php?/mydesign/mymodule/myview/86. If none is passed it automatically reverts to 86.

{switch match=is_unset($nodeid)}
{case match=1}
	{set nodeid=86}
{/case}
{case match=0}
 test
{/case}
{/switch}
{$nodeid}
{$node}
{let children=fetch( content, list, hash( parent_node_id, $nodeid,
                                     sort_by, $node.sort_array,
                                     class_filter_type, include,
                                     class_filter_array, array( 'folder') ) )}
{section name=Child loop=$children} 
  <a href={$:item.node_id|ezurl}>&gt; {$:item.name}</a><br />
{/section}
{/let}
<p>

This code does not work (well the browsing doesn't work, the listing works fine), because it is using the site url (ezurl) and not the url of the entire module path. Is there any way to get the entire module path and make this browsing work?

Or am I currently completely missing the eZPublish point here? I want to add functionality and so forth to this list of folders (like a edit button and a upload form).

Is this the way to go or? I have to ensure the advantages of a module (because this extension has to be deployed in like 5 websites or so).

Thanks for any feedback,
Clemens Timmermans

kracker (the)

Monday 30 May 2005 12:33:38 pm

Your urls should not contain a question mark ( " ? " )...

//kracker
<i>eminem : stan (instrumental)</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Clemens T

Monday 30 May 2005 3:04:27 pm

You can change this with url-rewrite, but on my system the base ezPublish url is:
http://mysite.com/index.php?/mydesign/ and this works fine (every module I install works fine, and the entire ezPublish install works fine.. that's not the problem... it's just a setting somewhere in httpd.conf or something [there is documentation on this]).

BUT can you comment on the template code? Am I doing something awefully stupid or.. does it make sense? And the myview.php looks like this (partial content):

...
$Result['content'] =& $tpl->fetch( 'design:myModule/myview.tpl' );
$Result['path'] = array( array( 'url' => false,
                                'text' => 'List of Folders' ) );
...

Thank you!
Greetins,
Clemens

Clemens T

Tuesday 31 May 2005 12:49:50 am

Ps: Important to note is that NODE 86 is a item in the contenttree which I want as base for this module. It does not have anything to do with the position of the module on the site (url of the module is different from the node in the tree)

Clemens T

Tuesday 31 May 2005 1:42:21 am

I fixed it adding this in myview.php:

(partial content)
...
$Module =& $Params["Module"];
$tpl->setVariable('module',$Module);
...

and then in myview.tpl

(partial content)
...
<a href="{concat($module.functions.myview.uri|ezurl(no),"/",$:item.node_id)}">&gt; {$:item.name}</a><br />
...

Thanks for your help Kracker.

HOPEFULLY you can still comment on my method, if it's the way to go...

Greetings,
Clemens

eZ debug

Timing: Jan 19 2025 06:28:24
Script start
Timing: Jan 19 2025 06:28:24
Module start 'content'
Timing: Jan 19 2025 06:28:25
Module end 'content'
Timing: Jan 19 2025 06:28:25
Script end

Main resources:

Total runtime1.1048 sec
Peak memory usage4,096.0000 KB
Database Queries64

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 590.0859180.8359
Module start 'content' 0.00711.0935 770.9219573.5078
Module end 'content' 1.10060.0042 1,344.429746.1094
Script end 1.1048  1,390.5391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.2736140.0002
Check MTime0.00140.1222140.0001
Mysql Total
Database connection0.00100.089010.0010
Mysqli_queries1.059095.8480640.0165
Looping result0.00050.0494620.0000
Template Total1.077797.520.5389
Template load0.00220.196220.0011
Template processing1.075697.351320.5378
Template load and register function0.00010.012810.0001
states
state_id_array0.00090.084410.0009
state_identifier_array0.00150.132320.0007
Override
Cache load0.00180.1615360.0000
Sytem overhead
Fetch class attribute can translate value0.00080.073720.0004
Fetch class attribute name0.00130.114660.0002
XML
Image XML parsing0.00070.067520.0004
class_abstraction
Instantiating content class attribute0.00000.001160.0000
General
dbfile0.00110.1033200.0001
String conversion0.00000.000930.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
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/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: 29
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs