magento2 – How do I load a category image in the frontend?

We have created a mega menu and want to load the category image into the menu. I'm not sure how to load this.

From now on we have the image only hard coded.

Below is the code:

_categoryHelper = $categoryHelper;   
    $this->_categoryRepository = $categoryRepository;
        parent::__construct(
            $context,          
            $data
        );


    }

    public function getStoreCategories($sorted = false, $asCollection = false, $toLoad = true)
    {
        return $this->_categoryHelper->getStoreCategories($sorted , $asCollection, $toLoad);
    }

    public function getCategoryById($categoryId) 
    {
        return $this->_categoryRepository->get($categoryId);

    }

public function  getSubcategories($categories, $parent= "http://magento.stackexchange.com/") {
    $i = 0;
    $array= '
    '; foreach($categories->getChildrenCategories() as $category) { $array .= '
  • '; $cat_image = 'https://techcrunch.com/wp-content/uploads/2010/10/pirate.jpg?w=990&crop=1'; if($i == 3 && $parent == "http://magento.stackexchange.com/" && $cat_image != "http://magento.stackexchange.com/"){ $array .= ''; $array .= '
  • '; } $array .= '' . $category->getName() . "n"; if($category->hasChildren()) { $children = $this->getCategoryById($category->getId()); $array .= $this->getSubcategories($children, 'child'); } $array .= '
  • '; $i++; } return $array . '
'; } }

Every help is appreciated!

sharepoint online – Image Carousel Video Autoplay right or wrong

I would like to set AutoPlay to true when playing the video, and false when trying to use the image in Autoplay at the specified state, but an error will occur

autoPlay = {this.setState ({autoplayvideo: true})} type & void; & # 39; void & # 39; void & # 39; void & # 39; void & # 39; is not
assignable to type & boolean & # 39; .ts (2322)

                         

                        {this.state.items.map((imageList,key) => {    
                          if(imageList.SourceType =="Video")
                        return (

{this._onClickItem(imageList.Title)}}>{imageList.Title}

) if(imageList.SourceType =="Text") return (

{this._onClickItem(imageList.Title)}}>{imageList.Title}

) })}

Does using an img title attribute in addition to the old attribute in image SEO help?

When I experimented with Google Image Search (many years ago), I found that this markup caused Google to associate the text most often with the image:

Funny Cat

Pasting text into a container div with the image was more effective than the alt attribute, the title attribute, or the combination of the two.

When it comes to image SEO, it does not hurt to duplicate the text into it alt and or title but it does not help rankings.

Funny Cat Funny Cat

However, if you paste the text both in the alt tag and next to the image, the text is duplicated and the usability is compromised if the image is not displayed.