We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32300
    • 17 Posts
    I am creating a component. I want it to use small icons which I will place in assets/images. Then I want to be able to call these images from a snippet.

    So I tried using...

    $image_path = $modx->getOption('assets_path').'components/stockfinder/images/';
    
    echo "<img src='".$image_path."saveicon.png' />";


    And it’s returning a path which isn’t relative to http://... but to D:/Domains/... can anyone point me as to how I could create the former?

    Any help would be appreciated.

    edit: sorry just found $modx->getOption(’site_url’) will work for me.