Landing page template using tokens - problem with URL resolving | Community
Skip to main content
Level 3
February 25, 2019
Question

Landing page template using tokens - problem with URL resolving

  • February 25, 2019
  • 1 reply
  • 4208 views

I am trying to tokenise some landing page templates to use program tokens for URLs. My problem comes when I use a token in the following part of the template:

<div id="mktHeader" class="mktEditable">

<!-- Logo and Header -->

<div class="logo"><a href="{{my.Event page URL2}}"><img src="{{my.LP_Header Image}}" width="600" height="165"></a></div>

</div>

The value of the {{my.Event page URL2}} token (rich text) in the program is

https://www.owlstonemedical.com/about/events/, ​however, when I use it in a landing page created using the template, it resolves this as

http://info.owlstonemedical.com/www.owlstonemedical.com/about/events/

I previously tried it with a plain text token and am getting the same thing.

I have searched the community and the documentation and haven't been able to find the answer. I'm probably doing some rookie mistake, as templates are not my area of expertise, and I'm trying to tokenise one created by someone else.

There is this bit of JQuery which might conceivably be replacing the a href in the HTML, but I don't know JQuery at all: (I know the function is to register clicks on pdfs or ppts but it may be doing more than that?)

<script>

$jQ(document).ready(function() {

$jQ('a[href^="http://info"][href$=".pdf"], a[href^="http://info"][href$=".ppt"]').click(

function(e) {

mktoMunchkinFunction('visitWebPage', { url: $jQ(this).attr('href') });

}

).attr('target', '_blank');

});

</script>

- I would appreciate any advice!

Erica

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

SanfordWhiteman
Level 10
February 25, 2019

Nothing to do with that JS (though it is broken in its own right).

Most likely you've omitted the protocol (http:​// or https:​//) from the token value, which means the value is interpreted as a relative path.

The literal href

www.example.com/coogaga

will become

https:​//info.example.com/www.example.com/coogaga

using standard URL parsing rules.

Level 3
February 26, 2019

No, as I posted above,

The value of the {{my.Event page URL2}} token (rich text) in the program is

owlstonemedical.com/about/events/

So I've included the protocol in the token value.

Level 3
February 26, 2019

So I switched back to a text (instead of rich text) token, and found that works if I include the https:// in the token value.

You mention standard URL parsing rules, would you post a link to those?

Thanks for pointing me in the right direction -

Erica