4

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

0

3 Answers 3

17

You can get base url in static block like this.

<a href="{{store direct_url="business"}}">Your link</a>
1
  • 1
    Using URL routing like this is always preferred over concatenating the URL.
    – Phil M
    Nov 30, 2016 at 16:30
2

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"}}

0

You can add store URL in static block:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.