Development

#7761 (Remove stylesheets in view.yml disfunctional / CSS declarations in sfDoctrinePlugin to all elements in global.css)

You must first sign up to be able to contribute.

Ticket #7761 (new defect)

Opened 3 years ago

Last modified 3 years ago

Remove stylesheets in view.yml disfunctional / CSS declarations in sfDoctrinePlugin to all elements in global.css

Reported by: 4levels Assigned to: Jonathan.Wage
Priority: minor Milestone:
Component: sfDoctrinePlugin Version: 1.4.0
Keywords: global css view.yml generator.yml sfJqueryTreeDoctrineManagerPlugin Cc:
Qualification: Unreviewed

Description

Hi Symfony / Doctrine Team,

I've been bothered by the global css rules defined in the sfDoctrinePlugin stylesheet global.css.

Is there a way to enable/disable inclusion of this stylesheet?

I've followed the directives given in the View chapter of symfony to remove it but this doesn't seem to work for the sfDoctrinePlugin stylesheets - edit: for any stylesheet! in view.yml

default:
  stylesheets: [ -*] 
  stylesheets: [ main, -global] 
  stylesheets: [ main, -sfDoctrinePlugin/css/global] 
  stylesheets: [ main, -/sfDoctrinePlugin/css/global.css] 

I can totally understand why these global styles are applied in a project, but why does it come inside the sfDoctrinPlugin and not in the default layout.css (or even better admin.css)?

Change History

12/01/09 15:46:09 changed by 4levels

  • keywords changed from global css to global css view.yml.

02/17/10 14:45:19 changed by Roman.Zajac

  • keywords changed from global css view.yml to global css view.yml generator.yml sfJqueryTreeDoctrineManagerPlugin.

Part of the answer is in templates/_assets.php:

<?php if (isset($this->params['css']) && ($this->params['css'] !== false)): ?> 
[?php use_stylesheet('<?php echo $this->params['css'] ?>', 'first') ?] 
<?php elseif(!isset($this->params['css'])): ?> 
[?php use_stylesheet('<?php echo sfConfig::get('sf_admin_module_web_dir').'/css/global.css' ?>', 'first') ?] 
[?php use_stylesheet('<?php echo sfConfig::get('sf_admin_module_web_dir').'/css/default.css' ?>', 'first') ?] 
<?php endif; ?>

so f.ex. setting "css" in generator.yml to "false" should do what You want:

generator:
  class: sfDoctrineGenerator
  param:
    #...
    css: false

... But at least in one plugin (sfJqueryTreeDoctrineManagerPlugin) I've found that this is not sensitive to above setting in generator.yml. So need to override it in application.