Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Building a Link with the Sitetree ID


Go to End


3 Posts   2818 Views

Avatar
bezarre

Community Member, 13 Posts

6 August 2010 at 8:09am

Hello,

I have one little question.

If I have a sitetree id, is there any internal function which builds with the help of the id the absolute url and returns it?

Thank you for your help.

Bez

Avatar
swaiba

Forum Moderator, 1899 Posts

6 August 2010 at 8:59am

How about...

$doSitetree = DataObject::get_by_id('SiteTree',$iSiteTreeID);
$strLink = $doSitetree->Link();

Avatar
bezarre

Community Member, 13 Posts

6 August 2010 at 9:43pm

Hey,

thank you :-)