cancel
Showing results for 
Search instead for 
Did you mean: 

Inline link widget not working?

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Inline link widget not working?

Does the inline link widget in Magento 2 work the same way as the previous version? In my Magento 1 installation, I had no problem using the widgets in my template files, static blocks, and static pages. For example, I built a custom navigation menu that linked to certain product categories by linking to each with a widget. In Magento 2, this doesn't generate the corresponding link if used in the sections.phtml template or any other template I've tried. I've only gotten it to work inside a page created in the backend. Any ideas? Here's what I'm using:

<li class="menu-item">{{widget type="Magento\Catalog\Block\Category\Widget\Link" anchor_text="Text" title="Title" template="category/widget/link/link_inline.phtml" id_path="category/31"}}</li>

 

3 REPLIES 3

Re: Inline link widget not working?

It's a shame this has gone unanswered for so long.  This exact issue is driving me away from using Magento.

Re: Inline link widget not working?

@cvaucher@jlosey90

 

You can try with this syntax in phtml file, Its working syntax for magento 2,

 

echo $this->getLayout()->createBlock("Magento\Catalog\Block\Category\Widget\Link")->setIdPath("category/31")->setTemplate("category/widget/link/link_inline.phtml")->toHtml();

 If issue solved, click Kudos and Accept as Solution.

 

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: Inline link widget not working?

hey @cvaucher, it should be work.

 

Add below code and flush the cache

 

{{widget type="Magento\Catalog\Block\Category\Widget\Link" template="category/widget/link/link_block.phtml" id_path="category/31"}}

 

If work then marks as solution.

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer