eZ Community » Forums » eZ Publish 5 Platform » CSS/JS assets with SF pagelayout,...
expandshrink

CSS/JS assets with SF pagelayout, asset_url does not exist

CSS/JS assets with SF pagelayout, asset_url does not exist

Tuesday 07 May 2013 8:47:22 pm - 2 replies

Hello,

Just trying to setup the recent 2013.4 version with eZDemo package. Once I am done with the installation process, which goes more or less OK, I have a running site with public and admin interfaces/siteacceses available.

Unfortunately, for the ezdemo public siteaccess, the JavaScript and CSS asset paths are not calculated correctly. After some digging I found that this only happens when the symfony-based pagelayout is called. So for CSS as an exmaple, we have this code executed (/vendor/ezsystems/demobundle/EzSystems/DemoBundle/Resources/views/page_head_style.html.twig):

{% stylesheets filter='cssrewrite'
    '@eZDemoBundle/Resources/public/css/bootstrap.css'
    '@eZDemoBundle/Resources/public/css/responsive.css'
    'bundles/ezdemo/css/video.css'
%}
    <link rel="stylesheet" type="text/css" href="{{ asset_url }}"/>
{% endstylesheets %}

The above code results in the follwing piece of HTML:

<link rel="stylesheet" type="text/css" href="/css/5c47eed.css"/>

Unfortunately, the /css/5c47eed.css resource or link does not exist in the /web folder. Same happens with JavaScript.

I think I have all the necessary asset symlinking done correctly, the administration interface is working just fine as well. I looked through all the documentation looking for some missing rewrite rule that would perhaps forward the above *.css request to another location, but don't seem to be able to locate anything like that.

How do I get it working? blunk.gif Emoticon
How are the ascetic-handled packed resource files supposed to be handled correctly?

Thanks a lot!

Tuesday 07 May 2013 9:00:16 pm

Hi Piotr,

The section on this page may helpĀ http://symfony.com/doc/current/cookbook/assetic/asset_management.html#cookbook-assetic-dumping.

Tuesday 07 May 2013 9:29:23 pm

Thanks Michael, that was it.

Actually, I just found another post related to this issue with some additional information on apache rules:
http://share.ez.no/forums/install-configuration/new-link-assets-command-required-for-ez-publish-community-project-2013.4/%28language%29/eng-GB

Too bad these .htaccess rules aren't there in the .htaccess_root legacy file and difficult to find in the doc... Well, hope this helps other people.

Cheers!

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from