Thursday 29 March 2012 7:51:30 pm - 9 replies
Hi All,
I'm using the online editor with eZ Web Interface.
When I want to insert an existing object using the browse tab, it shows 10 items on each page. I'd like to increase this number.
I've looked at the ini files in extension\ezoe\settings and checked the templates in extension\ezoe\...templates but can't find any settings.
Just to clarify: This happens for instance when adding an image and then clicking on the browse tab.
I hope anyone can help!
Thank you,
Maarten
Friday 30 March 2012 1:07:24 am
Hi Marten
you can edit the limit at least in the file
Line 36 in your_htdocs/extension/ezoe/modules/ezoe/expand.php
and not set a ini variable or even override the
templates/ezoe/box_browse.tpl ![]()
i checked that in ezoe 5.0.4 in ez. Hopefully this is solved arleady in the next release in may ![]()
Hope that helps.
Best Regards
Chris
Friday 30 March 2012 8:59:35 am
Hi Chris,
Thanks for your reply! However, I'm using EZOE 5.3.0alpha1 and there's no expand.php anymore.
Does anyone know where these functions have moved? I've browsed the files in the modules directory but can't find anything that looks like what I'm looking for.
Again, thanks for any help!
Friday 30 March 2012 9:38:12 am
Hi,
From Online Editor 5.2, all the AJAX calls are done through an ezjscore server functions class located in extension/ezoe/classes/ezoeserverfunctions.php. In this class, the method you are looking for is ezoeServerFunctions::browse() which actually accepts a limit parameter but the JavaScript code does set one so the default hardcoded value (10) is always used.
I would not recommend to edit this file (that's a bad practise) but instead you can "override" it with the following steps:
1. in an extension add (or edit) the file ezjscore.ini.append.php with the following content to replace the class used by Online Editor by your own:
[ezjscServer_ezoe] Class=ezoeServerCustomFunctions
2. in this extension add a php file containing the ezoeServerCustomFunctions class that will extend the default one ezoeServerFunctions and redefine the browse() method, something like should do the trick
<?php class ezoeServerCustomFunctions extends ezoeServerFunctions { public static function browse( $args ) { if ( !isset( $args[2] ) ) $args[2] = 20; // the new default limit you want return parent::browse( $args ); } }
For this to work, make sure to order of the extension loading is right (I think your extension must declared before ezoe in site.ini/[ExtensionSettings]/ActiveExtensions or you can also play with the extension.xml file) and don't forget the regenerate the autoload array for the extensions.
Cheers
Modified on Friday 30 March 2012 8:39:45 pm by Damien Pobel
Friday 30 March 2012 8:44:10 pm
Quote from Christoph Stollwerk :Did you choose the override or the bad practise?
I would be interested to make shure the override-solution works. Would be nice
@Christoph: You need a proof ? http://vrac.pwet.fr/ezoe_browse_override.png :-p
given the short time between my post and his answer and the number of syntax in errors in my original code, I bet on the bad practice ![]()
You must be logged in to post messages in this topic!