Take a look at the
makeURL function.
Got Music? Try
XSPFjukebox - Skinnable MODx Media Player
-
MODX Staff
- 1,535 Posts
The weblink URL is just stored in the ’content’ field, there’s no special ’weblink’ field or anything. If you adjust your code above then that should work okay.
Garry Nutting
Senior Developer
MODX, LLC
Email:
[email protected]
Twitter: @garryn
Web: modx.com
Oops, I forgot about weblinks and thought sal was asking for the way to return a doc’s URL from code. My bad!
Guess you should do:
$docid = ’12’;
$url = $modx->getDocument($docid, ’content’, 1);
$url = $url[’content’];
BTW, $url = $modx->getPageInfo($docid,1, ’content’); will work too.
garryn, which one is the lightest method? I assume it’s getPageInfo() because it queries the DB directly and doesn’t call getDocuments(), is this correct?
Got Music? Try
XSPFjukebox - Skinnable MODx Media Player