Question

I'm trying to get the base url in a static block.

I've tried the following code:

<a href="{{base url=""}}../business">

I knew this wasn't going to work because it needs <?php ?> around it.
Is there an alternative way to get the base url in a static block through the backend?

Screenshot for clarification: enter image description here

Was it helpful?

Solution

You can get base url in static block like this.

<a href="{{store direct_url="business"}}">Your link</a>

OTHER TIPS

You can get it by {{config path="web/unsecure/base_url"}} and If you want to append another URL then you can do like

<a href="{{config path="web/unsecure/base_url"}}test213/32"> test </a>

If you want secure base URL then you can get it by

{{config path="web/secure/base_url"}}

You can add store URL in static block:

<a href="{{store direct_url='identifier'}}">Your link</a>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top