Search code examples
modx-revolution

Tag link with parameters from snippet


How can I add parameter to link from snippet?

[[~34? &p=[[!getUrlParam? &name=p&int=1]]]]

This is not working (none snippet don`t work). Why?


Solution

  • Use makeUrl:

    http://rtfm.modx.com/revolution/2.x/developing-in-modx/other-development-resources/class-reference/modx/modx.makeurl

    // snippet getUrlParam

    // if you have to get a url param: $param = isset($_GET['id']) ? $_GET['id'] : 0;

    $url = $modx->makeUrl(34,'',array('p' => $param));

    return $url;