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.

General Questions

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

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

Building a Link with the Sitetree ID


Reply

3 Posts   1590 Views

Avatar
bezarre

6 August 2010 at 8:09am Community Member, 13 Posts

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

6 August 2010 at 8:59am Forum Moderator, 1796 Posts

How about...

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

Avatar
bezarre

6 August 2010 at 9:43pm Community Member, 13 Posts

Hey,

thank you :-)