We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24351
    • 15 Posts
    Hi Guys.

    I try to output some links with ajax. I get the objects and corresponding resource id’s in the ajax file. But when I put the link syntax [[~anyresourceid]] the link doesn’t get transformed (obviously).

    So my approach here is to use the API function modxLinkTag.

    But I can’t find any information on using this class.

    I can get the resource object like this:
    $resourceObj = $modx->getObject('modResource', 237);
    if($resourceObj) {
    
    $linkAlias = $resourceObj->getLinkTag->getTag();
    
    }
    


    But this code is just bullshit. so I know it doesn’t work like that but I don’t see how I am supposed to get a link with alias from a resource id generated by the API.

    any help or clarification would be appreciated

    thanks
    ragnar