Jump to content

module blocktopmenu


Recommended Posts

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

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

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

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

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

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

×
×
  • Create New...