3212 Posts in 847 Topics by 809 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 200 Views |
-
Linking to an internal page

22 February 2013 at 10:07am
Hi,
In one of my templates I want to hardcode a link to the contact page this is what I've got:
<a href="$BaseHref/contact-us/" id="askBtn" class="largeBtn">Ask A Question</a>
However the link produced is:
http://localhost/infoandtrack//contact-us/
Which still works but is there a better variable to use than $BaseHref which won't add the extra slash?
Thanks!
-
Re: Linking to an internal page

22 February 2013 at 10:13am
Ahh figured it out!
<a href="./contact-us/" id="askBtn" class="largeBtn">Ask A Question</a>
-
Re: Linking to an internal page

22 February 2013 at 10:30am
Got given a better answer,
In the controller on Page.php:public function ContactPage() {
return UserDefinedForm::get()->filter('ParentID', '0')->first();
}Then back to my link:
<a href="$ContactPage.Link" id="askBtn" class="largeBtn">Ask A Question</a>
-
Re: Linking to an internal page

22 February 2013 at 10:31am
This is incase the client changes the page name etc..
| 200 Views | ||
|
Page:
1
|
Go to Top |

