Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthorandrewl
     
    I'm starting on the (somewhat steep) learning curve with the booklink tutorial.

    Environment is Linux, Apache and Mysql.

    I've installed Akelos using subversion to /home/user/akelos/akelos_framework-1189
    I used scripts/setup to create the project in /home/user/akelos/projects/booklink
    and the external url that resolves to .../booklink/public is at http://localhost/bk

    I followed the currently published web tutorial to the letter with only the addition of a chmod o+w for the config, tmp and app/locales directories.

    So far, so good - I've been working most things out for myself with the help of the tutorials and posts in the forum
    and I can get a list of books and/or authors, I've also added the relationships between them and I can add books
    including choosing an author - great :)

    But I can't quite figure out one issue concerning the path to the stylesheet.

    In all of the scaffold generated views the style sheet tag is being rendered in the html file as:

    <link href="/stylesheets/scaffold.css" media="screen" rel="Stylesheet" type="text/css" />

    This is, I believe, coming from the layout file (eg, ...booklink/app/views/layout/book.tpl) in the expression:

    $asset_tag_helper->stylesheet_link_tag('scaffold')

    However, the stylesheet that I believe should be being used is in the file at ...booklink/public/stylesheets/scaffold.css
    which maps to a url of /bk/stylesheets/scaffold.css (note the extra leading 'bk')

    I've initially worked around this by changing all of the layout files to use:

    $asset_tag_helper->stylesheet_link_tag('/bk/stylesheets/scaffold')

    But I'm sure that's not the Akelos way - I would sort have expected the asset_tag helper to be able to figure out the correct public path.

    Could you please advise me of the correct way of doing this?

    Thanks,
    Andrew
    •  
      CommentAuthorbermi
     

    Hi Andrew,

    Normally the akelos web installer detects your relative path, but if some some reason it didn't, you need to add it to your config file like:

    define('AK_ASSET_URL_PREFIX', '/bk/');
    

    Hope that helps

    • CommentAuthorandrewl
     
    Hi Bermi,

    Yes, that did the trick. And with your lead I did a bit more digging and found the lib/constants.php file, which looks like where AK tries to work out the path. My web server executes inside a chroot environment, so the home directory path as seen by PHP is actually '/chroot/home/user/...' whereas in the filesystem (as seen by, eg, the setup script) it is seen as '/home/user/...' - I'm guessing this is what is throwing the constants.php script off the scent.

    Thanks for your help,
    Andrew
    • CommentAuthorinsanet
     
    setting a virtual host also fix this. without the need to touch akelos.
    • CommentAuthorandrewl
     
    I'd be interested to hear more about that, insanet - what exactly do you mean? My setup already is using a virtual host. Eg, the site homepage is at a url of http://www.mysite.com/ with the root directory defined as /home/user/mysite.com/html/. My booklink project is set up in the directory /home/user/akelos/projects/booklink. The url is http://www.mysite.com/bk/ so I have a symlink from /home/user/mysite.com/html/bk to /home/user/akelos/projects/booklink/public/. Have you done something similar?
    • CommentAuthorinsanet
     
    hi andrew, my usual setup is:
    www.myweb.com - points to -> /var/www/project
    and /var/www/ contains akelos and project
    /var/www/project/public
    /var/www/akelos
    and in this way works fine, but, yeah, i had the same issues you got when trying to do similar settings as you, but it causes me a lot of trouble, and i ended always writing the path in the app when trying those settings. so i guess there is not so many alternatives.
    • CommentAuthorandrewl
     
    Ok insanet, well, I'm just starting out here so everything is a new experience - thanks for commenting,
    Andrew