18591 Posts in 4875 Topics by 2285 members
General Questions
SilverStripe Forums » General Questions » Director::BaseURL() in Template?
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba
|
Page:
1
|
Go to End | |
| Author | Topic: | 3226 Views |
-
Director::BaseURL() in Template?

27 October 2009 at 2:29am
Hey all,
Anyone know id there is a template tag to retrieve Director::BaseURL() from a template? I can create a method like:
public function getBaseUrl() {
return Director::BaseURL();
}But I was wondering if maybe there is something I can already use and not create duplicate code?
Cheers,
Mo
-
Re: Director::BaseURL() in Template?

13 January 2010 at 9:20am Last edited: 13 January 2010 6:40pm
Just an addition... if you're wanting to get the page's full URL inside a template for something like a Digg link.. you can do the following
{$BaseHref}{$Top.URLSegment}
Hope this helps others.
[[Edited by Admin]]
| 3226 Views | ||
|
Page:
1
|
Go to Top |


