Development

#87 (Select media type for CSS style sheets)

You must first sign up to be able to contribute.

Ticket #87 (closed enhancement: fixed)

Opened 5 years ago

Last modified 4 years ago

Select media type for CSS style sheets

Reported by: 4-him@charter.net Assigned to:
Priority: minor Milestone:
Component: Version:
Keywords: Cc:
Qualification:

Description

Currently any style sheet linked has the hard coded attribute media=screen. It would be nice to declare a particular style sheet for different media say one for screen and a different one for print.

Attachments

AssetHelper.php.patch (1.8 kB) - added by kfuglsang@gmail.com on 02/15/06 23:57:53.
Halfway patch for solution. Rewrite of stylesheet_tag()-function.

Change History

02/08/06 15:09:36 changed by davedash

It'd be nice to specify all attributes of a link tag, like title for example. Not sure how hard that'd be to do in YAML.

maybe

stylesheets:
  ss1: {href: main, title: Favorite style, media: all}
  print: {href: print, title: Suitable for printers, media: print}

and it'd output

<link title="Favorite style" href="css/main.css" media="all" /> <link title="Suitable for pritners" href="css/print.css" media="print" />

02/15/06 23:57:53 changed by kfuglsang@gmail.com

  • attachment AssetHelper.php.patch added.

Halfway patch for solution. Rewrite of stylesheet_tag()-function.

02/16/06 00:02:13 changed by kfuglsang@gmail.com

The supplied patch enables the wanted features in stylesheet_tag().

E.g.

stylesheet_tag('style');

Will give:

<link rel="stylesheet" type="text/css" media="screen" href="/css/style.css" />

While

stylesheet_tag('style', array('media' => 'print', 'title' => 'My great style'));

will give:

<link rel="stylesheet" title="My great style" type="text/css" media="print" href="/css/style.css" />

I will need help on rewriting include_stylesheets to support this functionality.

02/17/06 15:06:53 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.

fixed in r847.

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.