I love the new CSS class for views, however, when I try to add the class "grid_16" which is from my 960 grid system CSS file, I get the error "CSS classes must be alphanumeric or dashes only."

I think it's okay to have underscores in class names, right?

For now, I just added grid16 to my class, but I think this should be addressed if it's an easy fix.

Files: 
CommentFileSizeAuthor
#8 939992-css-underscore.patch617 bytesdawehner

Comments

Status:Active» Needs review

Status:Needs review» Active

There is no patch to review here.

regular expressions :)

-?(?:[_a-z]|[\200-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])(?:[_a-z0-9-]|[\200-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*

+1 for underscores

+1 for underscores

+1 for underscores

+1 for underscores but also for spaces (left as spaces and not dashed)

Status:Active» Needs review
StatusFileSize
new617 bytes

Here is a patch.

+1 for underscores

Status needs review means that the module needs review. It would be nice if someone actually tested it.

I applied the patch, great that I can enter underscores without errors, but it would be nice if they didn't get converted to dashes on the page. Anyone else get that?

Priority:Normal» Major

Underscores are valid for CSS class names. read these resources:
- http://stackoverflow.com/questions/448981/what-characters-are-valid-in-c...
- http://www.w3.org/TR/CSS21/syndata.html#characters
- http://www.w3.org/TR/CSS21/grammar.html#tokenizer-diffs

+1 for underscores. please add support.
for now i have to do massive class name renaming... :(

Priority:Major» Normal

There are a "few" issues that needs review, please don't change the priority of an issue for a simple underscore addition in a css class. Be patient.

You could have changed the priority of the issue if you would have reviewed/tested the patch :)

Status:Needs review» Needs work

Thanks dereine, unfortunately your patch doesn't seem to solve the problem. In plugins/views_plugin_style.inc (function get_row_class) there's a call to drupal_clean_css_identifier which transliterates underscores to dashes. In my opinion drupal_clean_css_identifier should not replace underscores by default, I already filed an ticket for that: #1109854: Overly aggressive transliteration in drupal_clean_css_identifier removes underscores from classes. A workaround for the moment could be

<?php
$class
= drupal_clean_css_identifier($class, array(' ' => '-', '/' => '-', '[' => '-', ']' => ''));
?>

Seems like drupal_clean_css_identifier will not be fixed anytime soon: #1109854: Overly aggressive transliteration in drupal_clean_css_identifier removes underscores from classes, so I'd recommend the aforementioned workaround.

Status:Needs work» Needs review

@Pisco

This issue is about the validation itself. There is another issue on the views issue queeu which removes drupal_clean_css_identifier/let it use the right identifiers.

So change back the patch. In general this issue is marked against 6.x-3.x so it should be first fixed there.

@dereine, you're right, sorry for the confusion with the versions. You were referring to #1032380: More than one wrapper class?

Yeah exactly.

+1

Status:Needs review» Fixed
Issue tags:+dvcs11

This change seemed to be already in 7.x-3.x so committed to 6.x-3.x only
Yeah another patch

Status:Fixed» Closed (fixed)
Issue tags:-dvcs11

Automatically closed -- issue fixed for 2 weeks with no activity.