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.
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.
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.
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"}}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With