Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento How to link to category by id from static block/page

I'm looking to link to a category from a static block using the category id. Any thoughts?

I've done the usual searches, but to no avail.

At the moment I can do something like <a href="{{store url="category-i-want.html"}}">, but this is hardly robust.

like image 648
Alex Hadley Avatar asked Apr 25 '12 14:04

Alex Hadley


People also ask

What is Anchor category in Magento?

Magento 2 anchor category is the definition of the category in which the Magento native Layered Navigation can be displayed. If you need to set it as the anchor category then you need to go to Product > Categories > Display settings and switch the Anchor option to Yes. After that, don't forget to save the changes.

How do I change a category link in Magento?

Change Category Page URLsGo to Catalog→Categories, choose needed categories. Expand the drop-down Search Engine Optimization. Update the Magento URL Key. Save the changes.


1 Answers

Use the category link widget inline link code:

{{widget type="catalog/category_widget_link" anchor_text="Displayed Text" title="Title attribute text" template="catalog/category/widget/link/link_block.phtml" id_path="category/22"}}
like image 196
benmarks Avatar answered Nov 04 '22 02:11

benmarks