Ticket #531 (closed bug: wontfix)

Opened 8 months ago

Last modified 2 weeks ago

Template meta CSS aren't generated in the right order

Reported by: SooW Assigned to:
Priority: normal Milestone: jelix 1.1
Component: jelix:tpl Version: 1.0.2
Severity: normal Keywords:
Cc: Php version:
Review: Hosting Provider:
Documentation needed: 0 Blocking:

Description

Here's an example:

I've a framework template, which includes another template for the current page. If the framework template includes a CSS stylesheet with "{meta_html css $j_themepath.'css/framework.css'}", I want to be able to include another CSS in the current page. This would allow me to define the style of "div#content" in the framework, and to override in the other CSS.

This means that I want Jelix to output the <link> nodes in their order of appearance. Currently, Jelix seems to do just as it wants, and this bothers me.

As I'm French, you can comment on this report in French if you prefer.

Change History

04/02/08 09:58:03 changed by laurentj

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

It is too difficult to fix it. CSS link order is the order of template fetching.

If you want some CSS links appearing before any other, you should declare them in the constructor of your own response object.

04/02/08 10:11:53 changed by laurentj

  • priority changed from high to normal.
  • status changed from closed to reopened.
  • resolution deleted.
  • severity changed from major to normal.

A solution could be a different implementation of jResponseHtml::addCSSLink, which would allow us to add the css link at the top or at the bottom of the list of css link.

04/02/08 13:35:40 changed by SooW

By default, it should just appear in the order of appearance. In my example, Jelix will first open framework.tpl then the other which is inside. When you find a CSS meta, you should just add it to the array. Then, generation of the HTML will output the CSS <link> in the right order, no ?

04/02/08 13:56:46 changed by laurentj

I've a framework template, which includes another template for the current page

How did you made this include ?

04/02/08 17:38:26 changed by SooW

Can't look at the file right now, but the framework template contains a zone that includes the other template.

framework.tpl:

{meta css framework.css} <div id="content">

{zone 'my_page'}

</div>

my_page.zone.php:

uses 'my_page.tpl'

my_page.tpl:

{meta css my_page.css} <h1>My page</h1>

Where both CSS files qualify HTML element div#content. I want my_page.css to be able to override framework.css. Currently, it works by using !important on CSS attributes. But as you said, it should work by declaring the links in the constructor of my response object.

11/07/08 13:19:58 changed by laurentj

  • milestone set to jelix 1.1.

11/08/08 10:07:03 changed by laurentj

  • status changed from reopened to closed.
  • resolution set to wontfix.

Since we cannot add an element at the begining of an associative array in PHP, changing the addCSSStyle method will add some cost on performance.

Download in other formats: Comma-delimited Text Tab-delimited Text RSS Feed