Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthordpinte
     
    Hi,

    I'm integrating an OpenLayers application within Akelos. The Javascript configuration of the Openlayers library requires to define the image path :

    OpenLayers.ImgPath = "/public/images/openlayers";

    I have hardcoded it as written here before but is there a way to get the "/public/images" path using a function or constant ? If someone defined a AK_ASSET_URL_PREFIX, my hardcoded path will be broken.

    Thanks

    Didrik
    • CommentAuthormerindol
     

    var OpenLayers.ImgPath = <?= substr( $asset_tag_helper->image_path( '.' ), 0, -1 ); ?>openlayers";

    It's not pretty at all. But it's working. This way we benefit from the helper function that checks for the host and the prefix.

    P.S: sorry for the < replacement, I bet you got it it's a php opening tag

    • CommentAuthordpinte
     
    Hi Merindol,

    Thank you for the trick. It's working.