Jump to content

PierreC

Members
  • Posts

    3
  • Joined

  • Last visited

Profile Information

  • First Name
    Pierre
  • Last Name
    Couy

PierreC's Achievements

Newbie

Newbie (1/14)

0

Reputation

1

Community Answers

  1. It might be a cleaner way to do it, but it does not offer the flexibility I want : I would have to define a width for each 'widthX' class (X being the variable).
  2. I don't know how to remove my post, but I just misunderstood a little detail and just found the solution by myself : $this->addCSS(array( _THEME_CSS_DIR_.'dyn_categories.php?count='.$nb_subcategories => 'all', ), 'all', null, false); The last parameter of 'addCSS' is checkpath, and if set to true (its default value) the files won't be included as there is no such file as 'dyn_categories.php?count=X' Sorry for the useless post
  3. Hi, I'm currently writing an override for the CategoryController and I'm having issues adding a dynamically generated CSS file. My goal is to make subcategories icons' width adapt to the number of subcategories. In order to do that, I'm using a little "trick" that have worked in the past : I use a PHP file and declare the content as "text/css" in the header. Here is my php file dyn_categories.php : <?php header( 'content-type: text/css' ); $cat_count = $_GET['count']; $width = 100/$cat_count.'%'; ?> #subcategories ul li { width: <?php echo $width; ?>; } ?> In my CategoryController override, I use this line in order to include the file : $this->addCSS(array( _THEME_CSS_DIR_.'dyn_categories.php?count='.$nb_subcategories => 'all', )); The string for the file name is good, as a simple "<?php echo _THEME_CSS_DIR_.'dyn_categories.php?count='.$nb_subcategories; ?> prints the expected path. However, the file is not included and the string "dyn_categories" cannot be found in the source of the generated page. I tried to understand the addCSS and addMedia methods of FrontController and Controller, but I don't find any explanation. Can anyone help me on this. Thanks a lot
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More