Magento 2 : Face Error while create a custom blockIn block getModel error?Magento 2.1 Create a filter in the product grid by new attributeAlthough I use the correct namespace a wrong instance is passed to the constructorMagento after upgrading to 2.2 issue coming while editing productadmin grid not workingMagento offline custom Payment method with drop down listMagento 2.3 Can't view module's front end page output?Magento 2 Fatal error when adding date field in admin form and saveMagento 2.3 email attachment not working while sending custom emailOverride framework file vendor/magento/framework/View/Element/Html/Link/Current.php

Polar contour plot in Mathematica?

Why should P.I be willing to write strong LOR even if that means losing a undergraduate from his/her lab?

Replacing old plug-in 220V range with new hardwire 3-wire electric cooktop: remove outlet or add a plug?

Reducing contention in thread-safe LruCache

Can I submit a paper computer science conference using an alias if using my real name can cause legal trouble in my original country

Do predators tend to have vertical slit pupils versus horizontal for prey animals?

Has there ever been a truly bilingual country prior to the contemporary period?

How could Tony Stark wield the Infinity Nano Gauntlet - at all?

What should I do with the stock I own if I anticipate there will be a recession?

Eric Andre had a dream

What's the point of writing that I know will never be used or read?

Have made several mistakes during the course of my PhD. Can't help but feel resentment. Can I get some advice about how to move forward?

Quick destruction of a helium filled airship?

Will some rockets really collapse under their own weight?

Programming a recursive formula into Mathematica and find the nth position in the sequence

Why do aircraft leave cruising altitude long before landing just to circle?

Number of matrices with bounded products of rows and columns

Meaning and structure of headline "Hair it is: A List of ..."

The anatomy of an organic infrared generator

Photoshop older default brushes

What was the intention with the Commodore 128?

global variant of csname…endcsname

Why can't I see 1861 / 1871 census entries on Freecen website when I can see them on Ancestry website?

What is the purpose/function of this power inductor in parallel?



Magento 2 : Face Error while create a custom block


In block getModel error?Magento 2.1 Create a filter in the product grid by new attributeAlthough I use the correct namespace a wrong instance is passed to the constructorMagento after upgrading to 2.2 issue coming while editing productadmin grid not workingMagento offline custom Payment method with drop down listMagento 2.3 Can't view module's front end page output?Magento 2 Fatal error when adding date field in admin form and saveMagento 2.3 email attachment not working while sending custom emailOverride framework file vendor/magento/framework/View/Element/Html/Link/Current.php






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








0















I got the below error when create the Custom Block for the HTML sitemap.




Error filtering template: Warning: Declaration of
VaporSitemapBlockSitemapCategory::_getHtml(MagentoFrameworkDataTreeNode
$menuTree, $childrenWrapClass, $limit, $colBrakes = Array) should be
compatible with
MagentoThemeBlockHtmlTopmenu::_getHtml(MagentoFrameworkDataTreeNode
$menuTree, $childrenWrapClass, $limit, array $colBrakes = Array) in
C:xampphtdocsMagentoappcodeVaporSitemapBlockSitemapCategory.php
on line 62




Block Code



<?php
namespace VaporSitemapBlockSitemap;
// use MagentoFrameworkViewElementTemplateContext;
use MagentoFrameworkViewElementTemplate;
// use VaporSitemapModelSitemapCmsPages;
// use VaporSitemapBlockSitemapCms;
// use VaporSitemapBlockSitemapCategory;
class Index extends Template

const SITEMAP_CUSTOM_TEMPLATE = 'Vapor_Sitemap::sitemap/sitemap.phtml';

/**
* [__construct]
* @param MagentoFrameworkViewElementTemplateContext $context
* @param MagentoFrameworkStdlibDateTimeTimezone $_stdTimezone [description]
* @param array $data
*/
protected $getSitemap;

public function __construct(MagentoFrameworkViewElementTemplateContext $context,MagentoFrameworkStdlibDateTimeTimezone $_stdTimezone,
array $data = [])

parent::__construct($context, $data);
$this->getSitemap();



/**
*
* @return html
*/
protected function _toHtml()

return parent::_toHtml();

/**
* @return Mixed data
*/
public function getSitemap()

//echo "ComeHere";exit;
$this->setTemplate(self::SITEMAP_CUSTOM_TEMPLATE);
return $this;




Can anyone help to solve this.



Any help would be appreciated.



Thanks in advance..!










share|improve this question


























  • share your block file code..such that it will be easy to debug

    – aravind
    Aug 6 at 6:59











  • @aravind Updated the Question.

    – AKM
    Aug 6 at 7:02

















0















I got the below error when create the Custom Block for the HTML sitemap.




Error filtering template: Warning: Declaration of
VaporSitemapBlockSitemapCategory::_getHtml(MagentoFrameworkDataTreeNode
$menuTree, $childrenWrapClass, $limit, $colBrakes = Array) should be
compatible with
MagentoThemeBlockHtmlTopmenu::_getHtml(MagentoFrameworkDataTreeNode
$menuTree, $childrenWrapClass, $limit, array $colBrakes = Array) in
C:xampphtdocsMagentoappcodeVaporSitemapBlockSitemapCategory.php
on line 62




Block Code



<?php
namespace VaporSitemapBlockSitemap;
// use MagentoFrameworkViewElementTemplateContext;
use MagentoFrameworkViewElementTemplate;
// use VaporSitemapModelSitemapCmsPages;
// use VaporSitemapBlockSitemapCms;
// use VaporSitemapBlockSitemapCategory;
class Index extends Template

const SITEMAP_CUSTOM_TEMPLATE = 'Vapor_Sitemap::sitemap/sitemap.phtml';

/**
* [__construct]
* @param MagentoFrameworkViewElementTemplateContext $context
* @param MagentoFrameworkStdlibDateTimeTimezone $_stdTimezone [description]
* @param array $data
*/
protected $getSitemap;

public function __construct(MagentoFrameworkViewElementTemplateContext $context,MagentoFrameworkStdlibDateTimeTimezone $_stdTimezone,
array $data = [])

parent::__construct($context, $data);
$this->getSitemap();



/**
*
* @return html
*/
protected function _toHtml()

return parent::_toHtml();

/**
* @return Mixed data
*/
public function getSitemap()

//echo "ComeHere";exit;
$this->setTemplate(self::SITEMAP_CUSTOM_TEMPLATE);
return $this;




Can anyone help to solve this.



Any help would be appreciated.



Thanks in advance..!










share|improve this question


























  • share your block file code..such that it will be easy to debug

    – aravind
    Aug 6 at 6:59











  • @aravind Updated the Question.

    – AKM
    Aug 6 at 7:02













0












0








0








I got the below error when create the Custom Block for the HTML sitemap.




Error filtering template: Warning: Declaration of
VaporSitemapBlockSitemapCategory::_getHtml(MagentoFrameworkDataTreeNode
$menuTree, $childrenWrapClass, $limit, $colBrakes = Array) should be
compatible with
MagentoThemeBlockHtmlTopmenu::_getHtml(MagentoFrameworkDataTreeNode
$menuTree, $childrenWrapClass, $limit, array $colBrakes = Array) in
C:xampphtdocsMagentoappcodeVaporSitemapBlockSitemapCategory.php
on line 62




Block Code



<?php
namespace VaporSitemapBlockSitemap;
// use MagentoFrameworkViewElementTemplateContext;
use MagentoFrameworkViewElementTemplate;
// use VaporSitemapModelSitemapCmsPages;
// use VaporSitemapBlockSitemapCms;
// use VaporSitemapBlockSitemapCategory;
class Index extends Template

const SITEMAP_CUSTOM_TEMPLATE = 'Vapor_Sitemap::sitemap/sitemap.phtml';

/**
* [__construct]
* @param MagentoFrameworkViewElementTemplateContext $context
* @param MagentoFrameworkStdlibDateTimeTimezone $_stdTimezone [description]
* @param array $data
*/
protected $getSitemap;

public function __construct(MagentoFrameworkViewElementTemplateContext $context,MagentoFrameworkStdlibDateTimeTimezone $_stdTimezone,
array $data = [])

parent::__construct($context, $data);
$this->getSitemap();



/**
*
* @return html
*/
protected function _toHtml()

return parent::_toHtml();

/**
* @return Mixed data
*/
public function getSitemap()

//echo "ComeHere";exit;
$this->setTemplate(self::SITEMAP_CUSTOM_TEMPLATE);
return $this;




Can anyone help to solve this.



Any help would be appreciated.



Thanks in advance..!










share|improve this question
















I got the below error when create the Custom Block for the HTML sitemap.




Error filtering template: Warning: Declaration of
VaporSitemapBlockSitemapCategory::_getHtml(MagentoFrameworkDataTreeNode
$menuTree, $childrenWrapClass, $limit, $colBrakes = Array) should be
compatible with
MagentoThemeBlockHtmlTopmenu::_getHtml(MagentoFrameworkDataTreeNode
$menuTree, $childrenWrapClass, $limit, array $colBrakes = Array) in
C:xampphtdocsMagentoappcodeVaporSitemapBlockSitemapCategory.php
on line 62




Block Code



<?php
namespace VaporSitemapBlockSitemap;
// use MagentoFrameworkViewElementTemplateContext;
use MagentoFrameworkViewElementTemplate;
// use VaporSitemapModelSitemapCmsPages;
// use VaporSitemapBlockSitemapCms;
// use VaporSitemapBlockSitemapCategory;
class Index extends Template

const SITEMAP_CUSTOM_TEMPLATE = 'Vapor_Sitemap::sitemap/sitemap.phtml';

/**
* [__construct]
* @param MagentoFrameworkViewElementTemplateContext $context
* @param MagentoFrameworkStdlibDateTimeTimezone $_stdTimezone [description]
* @param array $data
*/
protected $getSitemap;

public function __construct(MagentoFrameworkViewElementTemplateContext $context,MagentoFrameworkStdlibDateTimeTimezone $_stdTimezone,
array $data = [])

parent::__construct($context, $data);
$this->getSitemap();



/**
*
* @return html
*/
protected function _toHtml()

return parent::_toHtml();

/**
* @return Mixed data
*/
public function getSitemap()

//echo "ComeHere";exit;
$this->setTemplate(self::SITEMAP_CUSTOM_TEMPLATE);
return $this;




Can anyone help to solve this.



Any help would be appreciated.



Thanks in advance..!







magento2 cms-block custom-block






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 6 at 12:55









moni patel

237 bronze badges




237 bronze badges










asked Aug 6 at 6:48









AKMAKM

14 bronze badges




14 bronze badges















  • share your block file code..such that it will be easy to debug

    – aravind
    Aug 6 at 6:59











  • @aravind Updated the Question.

    – AKM
    Aug 6 at 7:02

















  • share your block file code..such that it will be easy to debug

    – aravind
    Aug 6 at 6:59











  • @aravind Updated the Question.

    – AKM
    Aug 6 at 7:02
















share your block file code..such that it will be easy to debug

– aravind
Aug 6 at 6:59





share your block file code..such that it will be easy to debug

– aravind
Aug 6 at 6:59













@aravind Updated the Question.

– AKM
Aug 6 at 7:02





@aravind Updated the Question.

– AKM
Aug 6 at 7:02










1 Answer
1






active

oldest

votes


















2














make your _getHtml method from the class VaporSitemapBlockSitemapCategory look like this:



protected function _getHtml(
MagentoFrameworkDataTreeNode $menuTree,
$childrenWrapClass,
$limit,
array $colBrakes = []
)
.....



you are missing a type hint array on the last parameter






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%2f284521%2fmagento-2-face-error-while-create-a-custom-block%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









    2














    make your _getHtml method from the class VaporSitemapBlockSitemapCategory look like this:



    protected function _getHtml(
    MagentoFrameworkDataTreeNode $menuTree,
    $childrenWrapClass,
    $limit,
    array $colBrakes = []
    )
    .....



    you are missing a type hint array on the last parameter






    share|improve this answer





























      2














      make your _getHtml method from the class VaporSitemapBlockSitemapCategory look like this:



      protected function _getHtml(
      MagentoFrameworkDataTreeNode $menuTree,
      $childrenWrapClass,
      $limit,
      array $colBrakes = []
      )
      .....



      you are missing a type hint array on the last parameter






      share|improve this answer



























        2












        2








        2







        make your _getHtml method from the class VaporSitemapBlockSitemapCategory look like this:



        protected function _getHtml(
        MagentoFrameworkDataTreeNode $menuTree,
        $childrenWrapClass,
        $limit,
        array $colBrakes = []
        )
        .....



        you are missing a type hint array on the last parameter






        share|improve this answer













        make your _getHtml method from the class VaporSitemapBlockSitemapCategory look like this:



        protected function _getHtml(
        MagentoFrameworkDataTreeNode $menuTree,
        $childrenWrapClass,
        $limit,
        array $colBrakes = []
        )
        .....



        you are missing a type hint array on the last parameter







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 6 at 7:03









        MariusMarius

        172k30 gold badges333 silver badges708 bronze badges




        172k30 gold badges333 silver badges708 bronze badges






























            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%2f284521%2fmagento-2-face-error-while-create-a-custom-block%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

            Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form