mexique1 Posted March 27, 2012 Share Posted March 27, 2012 Hi, I finally started making my own changes on the blocktopmenu module. You can find the related ticket on the forge : http://forge.prestashop.com/browse/PSFV-715 The first goal was to make it more MVC by stopping compiling the HTML code inside the controller. Now the menu is managed as a Composite (http://en.wikipedia.org/wiki/Composite_pattern) and uses modern PHP techniques like RecursiveIterator. Check my changes and tell me what you think : https://github.com/alexsegura/prestashop/commit/38cb697dbbf49f605b376ea4540b54effae5ec96 https://github.com/alexsegura/prestashop/commit/63c6af050c481acad8786f63bdc44ae8e753a40f I'm still not really statisfied with the template however. It does not use recursion in Smarty but it's a little bit complicated. Still wondering how to allow easy customization... Maybe a Smarty plugin with a customizable class for rendering would help ? It would be nice if the developer of the module could come here and discuss about the changes. Link to comment Share on other sites More sharing options...
Raphaël Malié Posted March 27, 2012 Share Posted March 27, 2012 Hello, the blocktopmenu module is an old module which was not developped by PrestaTeam, I agree that this module need A LOT of refactoring, and it was already planned in my todo list. But since you took the time to make some good changes on this module, I will probably use your contribution (I will just do a code review first). Anyway just be patient, I have no time right now, but I will do this in few days (maybe next week). Regards Link to comment Share on other sites More sharing options...
mexique1 Posted March 28, 2012 Author Share Posted March 28, 2012 Really, really happy to hear that from you This is definitely going in the right direction. Yep, this module is not as good as it should/could be. IMHO this module is one of the most important pieces of the new layout, so it needs more attention. It's the main navigation tool and obviously one of the first things that the user will click ! --- Another thing I want to remove is ALL the SQL code : the queries are not more optimized than using the existings APIs, so let's remove SQL code duplication. Bye & thx again 1 Link to comment Share on other sites More sharing options...
indus Posted May 27, 2012 Share Posted May 27, 2012 Can you guys implement search auto complete into this module ? I have been trying to do that without luck. Link to comment Share on other sites More sharing options...
presty Posted July 4, 2012 Share Posted July 4, 2012 Hello, the blocktopmenu module is an old module which was not developped by PrestaTeam, I agree that this module need A LOT of refactoring, and it was already planned in my todo list. But since you took the time to make some good changes on this module, I will probably use your contribution (I will just do a code review first). Anyway just be patient, I have no time right now, but I will do this in few days (maybe next week). Regards So... has this module been refactored? is it planned for the short-term? I keep checking the repository and the code seems almost the same as was some months ago. Link to comment Share on other sites More sharing options...
mexique1 Posted July 5, 2012 Author Share Posted July 5, 2012 No, the developer said he would take my changes into consideration, but he didn't. Lots of promises, but... Link to comment Share on other sites More sharing options...
presty Posted July 6, 2012 Share Posted July 6, 2012 Ouch! I've been working with this module and it sure needs a code revision. Thank you mexique1. Link to comment Share on other sites More sharing options...
mexique1 Posted July 6, 2012 Author Share Posted July 6, 2012 If you have PHP skills, you can get the version I have modified for my needs. It very, very far from being totally working, but at least you can customize the HTML. Instead of computing the HTML in a $MENU variable, it creates a hierachical object representing menu "nodes". Also, I haven't merge back the latest changes. Check my changes. https://github.com/alexsegura/prestashop/compare/blocktopmenu Link to comment Share on other sites More sharing options...
Raphaël Malié Posted July 8, 2012 Share Posted July 8, 2012 (edited) Edit Edited August 21, 2012 by Raphaël Malié (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts