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