Opened 15 years ago

Closed 15 years ago

#715 closed defect (invalid)

Masking / Removing classes from the list provided by a Dynamical CSS file

Reported by: sgougeon Owned by: gogo
Priority: high Milestone:
Component: Plugin_DynamicCSS Version: trunk
Severity: normal Keywords:


The dropdown menu as well as the stylist (whenever it is activated)
present the WHOLE list of classes defined into the Dynamical
CSS file declared through the pageStyleSheets or the stylistLoadStylesheet
config parameters. There is presently no proper way to select some
specific classes from the full available list.

So, I have written in PHP a filter feeding the xinha_config.pageStyle
parameter. However, this trick requires that the xinha_my_config.js
file where xinha_config.pageStyle is PHP-defined must be PHP-interpreted.
Therefore, xinha_my_config.js MUST be declared into the calling script
as an inclusion :

<script type="text/javascript"><?php include("xinha_my_config.js);?></script>

; while a simple reference

<script type="text/javascript" src="xinha_my_config.js"></script>

would be smarter but IS NOT PHP-processed.

This ticket aims to encourage proper support for such a feature.

Here is the filter for interested people working with PHP :

$CSSclasses?='.class1,.class2,...'; Classes to be selected from $CSS[filename]

IN xinha_my_config.js :
xinha_config.pageStyle='<? $tmp=implode("|",explode(",",str_replace(".","\.",$CSSclasses?))); preg_match_all("(?:$tmp)\s*\{[^}]+?\}",file_get_contents($CSSfilename?),$tmp); echo implode("

sgougeon (a) (Sam) would be glad to read you about any proper development of this feature.

Change History (1)

comment:1 Changed 15 years ago by gogo

  • Resolution set to invalid
  • Status changed from new to closed

Not a bug - what styles you provide to Stylist plugin etc is up to you, there are several ways of doing it.

Note: See TracTickets for help on using tickets.