Hi! I would like to link categories by ID in my static blocks / pages. I know the {{store url='x'}} function, but this is not safe for updates on the URL. Is there a way to deal with it by using the ID of a category or page?
Thanks
Valentin
Solved! Go to Solution.
okay - i understand the requirement you have , below is the solution !!
Instead of {{store} url syntax - you need to Use Widgets for the same.
Below is the syntax to add specific category into block with specific id.
{{widget type="Magento\Catalog\Block\Category\Widget\Link" anchor_text="MY Custom category" title="Custom Category" template="category/widget/link/link_block.phtml" id_path="category/12"}}
In a more details when you edit/add any static block click on show/hide editor button.
You can also Choose template - like category block template you want or category inline template you want !!
Then click on save button ! clear the cache and check at frontend !
Hope it helps !!
okay - i understand the requirement you have , below is the solution !!
Instead of {{store} url syntax - you need to Use Widgets for the same.
Below is the syntax to add specific category into block with specific id.
{{widget type="Magento\Catalog\Block\Category\Widget\Link" anchor_text="MY Custom category" title="Custom Category" template="category/widget/link/link_block.phtml" id_path="category/12"}}
In a more details when you edit/add any static block click on show/hide editor button.
You can also Choose template - like category block template you want or category inline template you want !!
Then click on save button ! clear the cache and check at frontend !
Hope it helps !!