1

I am trying to replace part of a url address when a link is clicked.

If the url is mysite.com/photos/ i would like to replace mysite.net with another url say yorsite.net/photos/.

If someone could please let me know how to go about this.

What i have tried so far

{{#if /\\/(mysite.net)$/.test.($jason.url.replace('mysite.net/',
'yoursite.net')) }}
Jerry
  • 46
  • 6

1 Answers1

0

like this :

{
    "{{#elseif $jason.url.indexOf('mysite.net') !== -1  }}": {
        "type": "$href",
        "options": {
            "url": "{{$jason.url.replace(mysite.net/, 'yoursite.net')}}",
            "view": "web"
        }
    }
}
David Buck
  • 3,752
  • 35
  • 31
  • 35