href to external website

kyle shapiro asked on May 31, 2017 23:32

I'm writing a transformation for a page repeater. I would like to write

<a href="www.google.com">google</a>

but the resulting HTML is

<a href="[Your entire website path of this page's parent document]/www.gooogle.com">google</a>

please help me get the former instead of the latter.

Correct Answer

Brenden Kehren answered on May 31, 2017 23:46

For the href to work properly you need the protocol as well. The browser simply sees www.google.com as a relative link because it doesn't have a protocol with it. Assign the protocol and you'll be set. It's not a Kentico "thing", it's a browser "thing" and your href needs to be in the proper format. I'd suggest ensuring the input checks for a protocol or your output checks for the protocol.

1 votesVote for this answer Unmark Correct answer

Recent Answers


kyle shapiro answered on June 1, 2017 00:07

Hahaha such a silly mistake! Thank you so much Brenden. Even though this was an simple thing, I was so stumped and hung up on it. Appreciate it!

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.