URL being generated with file path when using php local server

The image URLs are being generated as file paths when using the php local server, which causes the images not to load. Is there a way to tell the helper to generate the url with the web address instead?

I’m working with Halcyon and the method in question is:

{{ page.media[item.img].url }}

when you say PHP local webserver, do you mean the built-in PHP webserver? There are many problems with this related to routing because it has no rewrite capabilities.

I’m not sure if this is or is not your problem however. What is the resulting output you are seeing? also what value is item.img ?

Yes, the local webserver. Using it primarily for ease of use. If it won’t work properly, I can use MAMP instead.

I’m talking about the default Halcyon portfolio images or anything else you put in there. Let’s say the image is portfolio-01.jpg the resulting url that is generated is /Users/useraccount/sites/halcyon/user/pages/01.home/_portfolio/portfo lio-01.jpg

Thanks for the quick reply.

Try putting a .cache in the call like this:

{{ page.media[item.img].cache.url }}

Basically the situation is if you do no media operations (resize etc) there is no work down on the image, so it points to the image where it sits. However, because you have a space in your folder structure, and because the built-in PHP server is so limited in functionality when it comes to path routing, it doesn’t translate this space properly.

I think that if you ran MAMP it would work as-is, but this .cache call will force images to be processed by the image library, and remove the space from your path. However this does cause initial page load (before cache) be slightly slower (after cache its the same), and could cause some very minor degradation in image quality.

Thanks again for the quick response. Unfortunately it doesn’t look like it worked with the cache call. No big deal - I should be using MAMP anyways. I was hoping I could mockup stuff quickly without having to add the MAMP config, but I need to stop being lazy. Thanks a million! Great project. Can’t wait to be able to support it with the premium admin plugin.