href page macro anchor

kyle shapiro asked on March 24, 2015 17:55

I can hardcod href locations such as href="http://localhost/kentico82/mySite/HomePage.aspx", but anticipating a domain name change, for example http://MyDomain/kentico82/ this code will break upon implementing a new domain. I have a piece of dynamic code <a href="{% RootDocument.AbsoluteURL #%}"></a> that will give me the correct url for http://anyDomain/kentico82/mySite/default.aspx. Is there a path expression macro where I can have kentico resolve the correct url for any page using only the page name found in the content tree to use in an anchor href? I want to href link to "Home" or "Contact-Us".

Correct Answer

kyle shapiro answered on March 24, 2015 17:59

Never mind, I found that I can just write a tilde. <a href="~/myPageName.aspx">

0 votesVote for this answer Unmark Correct answer

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