How to display category image in top navigation menuDisplay Magebuzz Category Sidebar Navigation only on home menuExclude a specific categoryTop Menu cache problemCreate categories through installerHow to add custom attributes as top navigation menu items?How to add custom top menu navigation link not categoryMagento 1.9.2.4: Show category images in top navigation menuHow To Display Placeholder Image In CategoryDisplay child categories in the top menu in magento 1.9Magento 1.9 How to display subcategory image in top navigation menu

Looking after a wayward brother in mother's will

Is a hash a zero-knowledge proof?

How can a single Member of the House block a Congressional bill?

Accidentally cashed a check twice

Grep complete name including dot in the word

Can a rogue effectively triple their speed by combining Dash and Ready?

Can an old DSLR be upgraded to match modern smartphone image quality

Are grass strips more dangerous than tarmac?

If a problem only occurs randomly once in every N times on average, how many tests do I have to perform to be certain that it's now fixed?

Creating Fictional Slavic Place Names

The original word for a wild boar

What is the intuition behind uniform continuity?

Why is there a need to modify system call tables in Linux?

Why does the UK have more political parties than the US?

arcpy.GetParameterAsText not passing arguments to script?

The oldest tradition stopped before it got back to him

Where can I find the list of all tendons in the human body?

Applicants clearly not having the skills they advertise

Why use water tanks from a retired Space Shuttle?

Is the world in Game of Thrones spherical or flat?

California: "For quality assurance, this phone call is being recorded"

Why don't I have ground wiring on any of my outlets?

'chmod' would set file permission to 000 no matter what permission I try to set

Expenditure in Poland - Forex doesn't have Zloty



How to display category image in top navigation menu


Display Magebuzz Category Sidebar Navigation only on home menuExclude a specific categoryTop Menu cache problemCreate categories through installerHow to add custom attributes as top navigation menu items?How to add custom top menu navigation link not categoryMagento 1.9.2.4: Show category images in top navigation menuHow To Display Placeholder Image In CategoryDisplay child categories in the top menu in magento 1.9Magento 1.9 How to display subcategory image in top navigation menu






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I have used below code to override category menu but unable to add category image in top menu.



protected function _getHtml(Varien_Data_Tree_Node $menuTree, $childrenWrapClass) 

$html = '';

$children = $menuTree->getChildren();

$parentLevel = $menuTree->getLevel();
$childLevel = is_null($parentLevel) ? 0 : $parentLevel + 1;

$counter = 1;
$childrenCount = $children->count();

$parentPositionClass = $menuTree->getPositionClass();
$itemPositionClassPrefix = $parentPositionClass ? $parentPositionClass . '-' : 'nav-';

foreach ($children as $child)
$child->setLevel($childLevel);
$child->setIsFirst($counter == 1);
$child->setIsLast($counter == $childrenCount);
$child->setPositionClass($itemPositionClassPrefix . $counter);

$outermostClassCode = '';
$outermostClass = $menuTree->getOutermostClass();

if ($childLevel == 0 && $outermostClass)
$outermostClassCode = ' class="' . $outermostClass . '" ';
$child->setClass($outermostClass);

$html .= '<li ' . $this->_getRenderedMenuItemAttributes($child) . '>';
$html .= '<a href="' . $child->getUrl() . '" ' . $outermostClassCode . '><span>'
. $this->escapeHtml($child->getName()) . '</span></a>';

if ($child->hasChildren())
if (!empty($childrenWrapClass))
$html .= '<div class="' . $childrenWrapClass . '">';

$html .= '<ul class="level' . $childLevel . '">';
$html .= $this->_getHtml($child, $childrenWrapClass);
$html .= '</ul>';

if (!empty($childrenWrapClass))
$html .= '</div>';


$html .= '</li>';

$counter++;


return $html;



i have applied many solutions but no luck. Can anyone help?










share|improve this question




























    2















    I have used below code to override category menu but unable to add category image in top menu.



    protected function _getHtml(Varien_Data_Tree_Node $menuTree, $childrenWrapClass) 

    $html = '';

    $children = $menuTree->getChildren();

    $parentLevel = $menuTree->getLevel();
    $childLevel = is_null($parentLevel) ? 0 : $parentLevel + 1;

    $counter = 1;
    $childrenCount = $children->count();

    $parentPositionClass = $menuTree->getPositionClass();
    $itemPositionClassPrefix = $parentPositionClass ? $parentPositionClass . '-' : 'nav-';

    foreach ($children as $child)
    $child->setLevel($childLevel);
    $child->setIsFirst($counter == 1);
    $child->setIsLast($counter == $childrenCount);
    $child->setPositionClass($itemPositionClassPrefix . $counter);

    $outermostClassCode = '';
    $outermostClass = $menuTree->getOutermostClass();

    if ($childLevel == 0 && $outermostClass)
    $outermostClassCode = ' class="' . $outermostClass . '" ';
    $child->setClass($outermostClass);

    $html .= '<li ' . $this->_getRenderedMenuItemAttributes($child) . '>';
    $html .= '<a href="' . $child->getUrl() . '" ' . $outermostClassCode . '><span>'
    . $this->escapeHtml($child->getName()) . '</span></a>';

    if ($child->hasChildren())
    if (!empty($childrenWrapClass))
    $html .= '<div class="' . $childrenWrapClass . '">';

    $html .= '<ul class="level' . $childLevel . '">';
    $html .= $this->_getHtml($child, $childrenWrapClass);
    $html .= '</ul>';

    if (!empty($childrenWrapClass))
    $html .= '</div>';


    $html .= '</li>';

    $counter++;


    return $html;



    i have applied many solutions but no luck. Can anyone help?










    share|improve this question
























      2












      2








      2








      I have used below code to override category menu but unable to add category image in top menu.



      protected function _getHtml(Varien_Data_Tree_Node $menuTree, $childrenWrapClass) 

      $html = '';

      $children = $menuTree->getChildren();

      $parentLevel = $menuTree->getLevel();
      $childLevel = is_null($parentLevel) ? 0 : $parentLevel + 1;

      $counter = 1;
      $childrenCount = $children->count();

      $parentPositionClass = $menuTree->getPositionClass();
      $itemPositionClassPrefix = $parentPositionClass ? $parentPositionClass . '-' : 'nav-';

      foreach ($children as $child)
      $child->setLevel($childLevel);
      $child->setIsFirst($counter == 1);
      $child->setIsLast($counter == $childrenCount);
      $child->setPositionClass($itemPositionClassPrefix . $counter);

      $outermostClassCode = '';
      $outermostClass = $menuTree->getOutermostClass();

      if ($childLevel == 0 && $outermostClass)
      $outermostClassCode = ' class="' . $outermostClass . '" ';
      $child->setClass($outermostClass);

      $html .= '<li ' . $this->_getRenderedMenuItemAttributes($child) . '>';
      $html .= '<a href="' . $child->getUrl() . '" ' . $outermostClassCode . '><span>'
      . $this->escapeHtml($child->getName()) . '</span></a>';

      if ($child->hasChildren())
      if (!empty($childrenWrapClass))
      $html .= '<div class="' . $childrenWrapClass . '">';

      $html .= '<ul class="level' . $childLevel . '">';
      $html .= $this->_getHtml($child, $childrenWrapClass);
      $html .= '</ul>';

      if (!empty($childrenWrapClass))
      $html .= '</div>';


      $html .= '</li>';

      $counter++;


      return $html;



      i have applied many solutions but no luck. Can anyone help?










      share|improve this question














      I have used below code to override category menu but unable to add category image in top menu.



      protected function _getHtml(Varien_Data_Tree_Node $menuTree, $childrenWrapClass) 

      $html = '';

      $children = $menuTree->getChildren();

      $parentLevel = $menuTree->getLevel();
      $childLevel = is_null($parentLevel) ? 0 : $parentLevel + 1;

      $counter = 1;
      $childrenCount = $children->count();

      $parentPositionClass = $menuTree->getPositionClass();
      $itemPositionClassPrefix = $parentPositionClass ? $parentPositionClass . '-' : 'nav-';

      foreach ($children as $child)
      $child->setLevel($childLevel);
      $child->setIsFirst($counter == 1);
      $child->setIsLast($counter == $childrenCount);
      $child->setPositionClass($itemPositionClassPrefix . $counter);

      $outermostClassCode = '';
      $outermostClass = $menuTree->getOutermostClass();

      if ($childLevel == 0 && $outermostClass)
      $outermostClassCode = ' class="' . $outermostClass . '" ';
      $child->setClass($outermostClass);

      $html .= '<li ' . $this->_getRenderedMenuItemAttributes($child) . '>';
      $html .= '<a href="' . $child->getUrl() . '" ' . $outermostClassCode . '><span>'
      . $this->escapeHtml($child->getName()) . '</span></a>';

      if ($child->hasChildren())
      if (!empty($childrenWrapClass))
      $html .= '<div class="' . $childrenWrapClass . '">';

      $html .= '<ul class="level' . $childLevel . '">';
      $html .= $this->_getHtml($child, $childrenWrapClass);
      $html .= '</ul>';

      if (!empty($childrenWrapClass))
      $html .= '</div>';


      $html .= '</li>';

      $counter++;


      return $html;



      i have applied many solutions but no luck. Can anyone help?







      magento-1.9






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 27 '17 at 10:23









      user52327user52327

      111




      111




















          1 Answer
          1






          active

          oldest

          votes


















          0














          Hi finally i got the answere:



           $splittedArray = explode($delimiter = 'category-node-', $child->getId());
          $category = Mage::getModel('catalog/category')->load(end($splittedArray));
          $html .= '<li ' . $this->_getRenderedMenuItemAttributes($child) . '>';
          if (!empty($category->getData('image')))
          $html .= '<div> ';
          $html .= "<a href=" . $category->getURL() . " title =" . $category->getName() . ">";
          $html .= "<img src=" . Mage::getBaseUrl('media') . 'catalog/category/' . $category->getData('image') . " alt=" . $category->getName() . " >";
          $html .= "</a>";
          $html .= '</div>';






          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "479"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f166323%2fhow-to-display-category-image-in-top-navigation-menu%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Hi finally i got the answere:



             $splittedArray = explode($delimiter = 'category-node-', $child->getId());
            $category = Mage::getModel('catalog/category')->load(end($splittedArray));
            $html .= '<li ' . $this->_getRenderedMenuItemAttributes($child) . '>';
            if (!empty($category->getData('image')))
            $html .= '<div> ';
            $html .= "<a href=" . $category->getURL() . " title =" . $category->getName() . ">";
            $html .= "<img src=" . Mage::getBaseUrl('media') . 'catalog/category/' . $category->getData('image') . " alt=" . $category->getName() . " >";
            $html .= "</a>";
            $html .= '</div>';






            share|improve this answer



























              0














              Hi finally i got the answere:



               $splittedArray = explode($delimiter = 'category-node-', $child->getId());
              $category = Mage::getModel('catalog/category')->load(end($splittedArray));
              $html .= '<li ' . $this->_getRenderedMenuItemAttributes($child) . '>';
              if (!empty($category->getData('image')))
              $html .= '<div> ';
              $html .= "<a href=" . $category->getURL() . " title =" . $category->getName() . ">";
              $html .= "<img src=" . Mage::getBaseUrl('media') . 'catalog/category/' . $category->getData('image') . " alt=" . $category->getName() . " >";
              $html .= "</a>";
              $html .= '</div>';






              share|improve this answer

























                0












                0








                0







                Hi finally i got the answere:



                 $splittedArray = explode($delimiter = 'category-node-', $child->getId());
                $category = Mage::getModel('catalog/category')->load(end($splittedArray));
                $html .= '<li ' . $this->_getRenderedMenuItemAttributes($child) . '>';
                if (!empty($category->getData('image')))
                $html .= '<div> ';
                $html .= "<a href=" . $category->getURL() . " title =" . $category->getName() . ">";
                $html .= "<img src=" . Mage::getBaseUrl('media') . 'catalog/category/' . $category->getData('image') . " alt=" . $category->getName() . " >";
                $html .= "</a>";
                $html .= '</div>';






                share|improve this answer













                Hi finally i got the answere:



                 $splittedArray = explode($delimiter = 'category-node-', $child->getId());
                $category = Mage::getModel('catalog/category')->load(end($splittedArray));
                $html .= '<li ' . $this->_getRenderedMenuItemAttributes($child) . '>';
                if (!empty($category->getData('image')))
                $html .= '<div> ';
                $html .= "<a href=" . $category->getURL() . " title =" . $category->getName() . ">";
                $html .= "<img src=" . Mage::getBaseUrl('media') . 'catalog/category/' . $category->getData('image') . " alt=" . $category->getName() . " >";
                $html .= "</a>";
                $html .= '</div>';







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 27 '17 at 13:17









                user52338user52338

                1




                1



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f166323%2fhow-to-display-category-image-in-top-navigation-menu%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

                    Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

                    Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림