Skip to content

Commit

Permalink
#102271 CR fixes: added new fields to menu block
Browse files Browse the repository at this point in the history
Also fixed some docs
  • Loading branch information
Jose Ortega committed Sep 15, 2023
1 parent 508d7ff commit b15979c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Block/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Magento\Framework\View\Element\Template;
use Magento\Framework\Event\Manager as EventManager;
use Magento\Framework\Escaper;
use Snowdog\Menu\Api\Data\NodeInterface;
use Snowdog\Menu\Api\MenuRepositoryInterface;
use Snowdog\Menu\Api\NodeRepositoryInterface;
use Snowdog\Menu\Model\Menu\Node\Image\File as ImageFile;
Expand Down Expand Up @@ -268,7 +269,7 @@ public function isViewAllLinkAllowed($nodeType)
}

/**
* @param NodeRepositoryInterface $node
* @param NodeInterface $node
* @return string
*/
public function renderViewAllLink($node)
Expand All @@ -279,7 +280,7 @@ public function renderViewAllLink($node)
}

/**
* @param NodeRepositoryInterface $node
* @param NodeInterface $node
* @return string
*/
public function renderMenuNode($node)
Expand Down Expand Up @@ -381,7 +382,7 @@ public function getMenuCssClass($defaultClass = '')
}

/**
* @param NodeRepositoryInterface $node
* @param NodeInterface $node
* @return Template
*/
private function getMenuNodeBlock($node)
Expand All @@ -404,6 +405,9 @@ private function getMenuNodeBlock($node)
->setImage($node->getImage())
->setImageUrl($node->getImage() ? $this->imageFile->getUrl($node->getImage()) : null)
->setImageAltText($node->getImageAltText())
->setImageWidth($node->getImageWidth())
->setImageHeight($node->getImageHeight())
->setImageAltText($node->getImageAltText())
->setCustomTemplate($node->getNodeTemplate())
->setAdditionalData($node->getAdditionalData())
->setSelectedItemId($node->getSelectedItemId());
Expand Down

0 comments on commit b15979c

Please sign in to comment.