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

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 31 2025 08:15:56
Script start
Timing: Jan 31 2025 08:15:56
Module start 'layout'
Timing: Jan 31 2025 08:15:56
Module start 'content'
Timing: Jan 31 2025 08:15:56
Module end 'content'
Timing: Jan 31 2025 08:15:56
Script end

Main resources:

Total runtime0.0168 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 588.1328151.2109
Module start 'layout' 0.00580.0021 739.343836.6484
Module start 'content' 0.00800.0071 775.992294.2656
Module end 'content' 0.01510.0016 870.257833.9922
Script end 0.0168  904.2500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002514.7330140.0002
Check MTime0.00116.3300140.0001
Mysql Total
Database connection0.00106.217810.0010
Mysqli_queries0.002615.627530.0009
Looping result0.00000.059610.0000
Template Total0.00127.110.0012
Template load0.00095.377210.0009
Template processing0.00031.674110.0003
Override
Cache load0.00073.872110.0007
General
dbfile0.002716.350380.0003
String conversion0.00000.035540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs