This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Forums » eZ Publish 5 Platform » Loading styles from ini file

Loading styles from ini file

Loading styles from ini file

Wednesday 09 January 2013 9:13:03 pm - 4 replies

Hi Guys. I finally have an ezpublish5. It's un "upgrade" from one of my sites. I have all working perfectly with legacy mode. 

Now i'm starting to code some twig templates based on the provided eZDemoBundle, and thought that maybe my work could help. But i dunno if you have planned how to go with somethings. 

First one i would like to change is provided page_head_style.html.twig template, which starts with this comment 

 {# TODO: add loading external CSS files defined in the INI settings #}

So, is there any plan from this? I have the following questions:

Knowing that normally in design.ini we added FrontendCSSFileList, BackendCSSFileList...

  1. Will there be a new equivalents entry in ezpublish.yml or the plan for this is to use ezpublish_legacy.config.resolver?
  2. If the previous answer is "a", which names should be used for this new settings? And should we add under another group?

I'm a bit confused with this, cause before we have site.ini, image.ini, design.ini, and now we have image_variations, database connection among others...

i wonder if the plan is add more settings to the ezpublish.yml file or maybe adding more .yml that should be imported from it.

Please, let me know if is there any spec about. 

Thank you!. 

Modified on Wednesday 09 January 2013 9:13:32 pm by Carlos Revillo

Wednesday 09 January 2013 10:29:39 pm

Hi Carlos, and happy new year happy.gif Emoticon

The comment is missleading indeed, there are basically two options:

  1. Create a new concept like we have in legacy, but in yml for assets placed in bundles, then provide that to assetic on our own.
  2. Re use a existing convention in Symfony framework (and assetic) for this.

In general if there is a fitting convention in Symfony we should always prefer that, to make sure most Symfony bundles can be used in eZ Publish 5.x, so #2 is preferred if possible here.

Modified on Wednesday 09 January 2013 10:32:35 pm by André R

Thursday 10 January 2013 10:07:27 am

Hi André. Thanks and happy new year too happy.gif Emoticon

I dunno if there's a convention for that in symfony. Reading the book a bit, all samples there don't use any yml file or something like that. Normally they go for adding the bundle route

but i think it should be possible to have a config file where the stylesheets were defined and loop over there. 

About the yml... if we add new setting like, for example, frontendstylesheets or whatever, would we add in on ezpublish.yml itself? My concern here is if that ezpublish.yml can became too big if we place more settings on it...

i was thinking in design.yml that coudl be imported from ezpublish.yml... but don't know if is this is the way to go. 


Friday 11 January 2013 7:57:17 pm

Maybe you can tell me if my idea is doable or totally crazy. I would like to simulate ezpublish_legacy as muchs as possible so, i've thought something like this

  • declare stylesshets in an yml file. can be ezpublish.yml itself or maybe a new one that we could import from ezpublish.yml
  • each bundle should be able to provide its own stylesheets (as ez4 extensions did )
  • then we could get this setting, loop it, and make the css declaration.

Same could work for stylesheets. 

P.S. Maybe its time to add yaml language to the literal tag in happy.gif Emoticon

Saturday 12 January 2013 1:06:49 pm

I actually prefer the Symfony (and a similar approach is available in legacy view ezjscore functions) approach here, it makes sure css is only included when needed, and couples the css to the html it styles. The configuration approach opens the door for bad practice of always loading css that might not be needed on the pages at all.

The general css should be covered by the main css files in the default stylesheets/javascript block and theming will be covered by custom theming support at a later stage. The convention for names of the general css could be copied over from bootstrap. 

Modified on Saturday 12 January 2013 1:07:27 pm by André R


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

36 542 Users on board!

Forums menu

Proudly Developed with from