01142: $PageCSSListFmt does not get defaults if config.php already set any values

Summary: $PageCSSListFmt does not get defaults if config.php already set any values
Created: 2009-09-19 21:02
Status: Closed - replied
Category: Cookbook
From: Maxim?
Assigned:
Priority: 4
Version: 2.2.0
OS: Linux/Apache 2.0.63/PHP 5.2.8

Description: In scripts/skins.php we have

SDV($PageCSSListFmt,array(
  'pub/css/local.css' => '$PubDirUrl/css/local.css',
  'pub/css/{$Group}.css' => '$PubDirUrl/css/{$Group}.css',
  'pub/css/{$FullName}.css' => '$PubDirUrl/css/{$FullName}.css'));

This executes after local/config.php. Some recipes set their own keys inside $PageCSSListFmt to get their CSS into the header; but because they ran first, the SDV will do nothing, and these defaults are lost. (action=diag confirms this.)

Changing it to SDVA() in skins.php is one solution but that disallows customisation of $PageCSSListFmt to remove these defaults. Another option is to re-add them in local/config.php.

This is not a bug, SDV() is used instead of SDVA() precisely in order to allow the removal, and yes, an admin has to redefine the whole array in config.php. --Petko

Is it wrong for a recipe to do this? Is there a better way to inject CSS file links?

The recipe could add the <link rel='stylesheet' type="text/css"> markup directly in a $HTMLHeaderFmt['recipename1'] variable. --Petko September 20, 2009, at 02:39 AM