Composite data structure#43
Conversation
25ef636 to
6ee54aa
Compare
|
I just changed the visibility of This allows overrides of this module to add additional data to the node. protected function createNode($type, array $data = array())
{
if (BlocktopmenuNode::TYPE_CATEGORY === $type) {
$category = new Category($data['id'], $this->context->language->id);
$data['image'] = $this->context->link->getCatImageLink($category->link_rewrite, $category->id, 'small_default');
}
return parent::createNode($type, $data);
} |
6ee54aa to
d6afa29
Compare
There was a problem hiding this comment.
please make createCategoryNode public (see #40). It's very useful to be able to reuse such a helper.
There was a problem hiding this comment.
why not public? It's a very useful HTML menu generator?
There was a problem hiding this comment.
Because it is only here for backward compatibility: the module still assigns the $MENU variable with HTML code. Future versions should not generate the HTML anymore and this method should be deprecated ASAP.
If you want to change the HTML code, you should do it in the view, not in the controller.
|
very nice! |
|
Will this be merged one day ? @Quetzacoalt91 @gaillafr @tchauviere |
d6afa29 to
d04d77d
Compare
|
You will never merge this PR, isn't it ? |
|
... and that would be a very bad signal to the community. We all have in mind one (or a couple) of PHP software having gone that awful road. I'm also waiting PSP input for too long and too much bugfixes or PR. |
|
+1 |
|
Got feedback from the team for you:
There you go. The Core devs is aware of this PR, and it is approuved. It "only" needs a code-review and a QA review which, now that we've reached the alpha 3 stage for 1.7, we should soon finally find time to do properly. Thank you for your patience! |
|
You are welcome, better late than never 👍 I tried my best to keep it BC, the |


Hello,
Reopening PR #42 on the dev branch
As agreed with @djfm, I sort of backported this branch to be retrocompatible: https://github.com/PrestaShop/blocktopmenu/commits/feat/starter-theme
This introduces a composite data structure for the menu items: now theme developers can completely redefine the HTML structure of the menu using Smarty.
To keep things retrocompatible, the
$MENUvariable is still assigned, usingSuperfishNodeVisitorto replicate the legacy behavior.I still need to make a few adjustments, but please start reviewing.