Forums / Developer / Browse mecanism

Browse mecanism

Author Message

Maxime Thomas

Wednesday 23 January 2008 4:04:14 am

Hi,

I would like to know if a documentation exists on the browse mecanism used in eZPublish and how to plug it in a custom extension.
If someone have a nice exemple, it would be welcome too !

Thanx.

Maxime Thomas
[email protected] | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Ɓukasz Serwatka

Saturday 26 January 2008 2:58:15 pm

Hi,

On PHP level you have to use eZContentBrowse class http://pubsvn.ez.no/doxygen/trunk/html/classeZContentBrowse.html

There are plenty of examples inside eZ Publish kernel folder (kernel/classes/datatypes). You can look on examples there.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Maxime Thomas

Wednesday 30 January 2008 2:07:39 am

Thanks, it works...
Maybe we can put this in the eZPedia.

Cheers.

Maxime Thomas
[email protected] | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Maxime Thomas

Thursday 14 February 2008 9:04:30 am

Hi,

I've got another problem. I wished to improve my module by adding a new select button but I haven't expected the following beahviour : each button are working well, they provide the select interface I have chosen, but when used sequencially, I cannot dissociate it.

In my module :

$browse_result_1 = eZContentBrowse::result("select1");
$browse_result_2 = eZContentBrowse::result("select2");

eZDebug::writeDebug($browse_result_1);
eZDebug::writeDebug($browse_result_2);

if (isset($browse_result_1[0]) and $browse_result_1 != '')
{
	$selected_node_1 = $browse_result_1[0];
}

if (isset($browse_result_2[0]) and $browse_result_2 != '')
{
	$selected_node_2 = $browse_result_2[0];
}

if ($http->hasVariable('Select1'))
{
	eZContentBrowse::browse( array( 'action_name' => 'Select1', 'from_page' => 'module/function'), $module );
}
else if ($http->hasVariable('Select2') and $selected_node_1!=0)
{
	eZContentBrowse::browse( array( 'action_name' => 'Select2', 'from_page' => 'module/function/'.$selected_node_1), $module );
}

And in my browse.ini :

[Select1]
StartNode=images
SelectionType=single
ReturnType=NodeID

[Select2]
StartNode=images
SelectionType=single
ReturnType=NodeID

And in the debug, I have $browse_result_1 and $browse_result_2 are the same even if I have not clicked in the second button. Where is my mistake ?

Cheers.

Maxime Thomas
[email protected] | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas