For more flexibility it would be cool to have the ability to have more than one striping class on each row.

Here is the usecase that isn't possible today:

http://drupal.org/files/issues/semanticviews-tokens.patch

...but it would be possible with this small patch. I realize that this can't go into 6.x-1.x because it would break existing views in a horrible way. But why not start a 6.x-2.x branch?

Comments

dixon_’s picture

Oops, I had the wrong URL in the clipboard. Sorry about that. Here is the usecase: http://drupal.pastebin.com/PHysxN9h

Anonymous’s picture

For this to be added to Semantic Views, we can't break backward compatibility so easily.

I suggest this:

If there are commas, split on the comma,
else split on the space.

I'm looking in the HTML standards for rules about class attributes. Logic dictates that commas can't be in class attributes. Just think how hard it would be to write styles for class attributes containing commas.

<div class="verySpecial,p" />

Would be styled with:

verySpecial,p { color: blue; }

This would cause all paragraphs (p) to be blue.

It only makes sense that commas need to be encoded if they are to be allowed at all. Normally we don't force users to pre-encode HTML entities, so this would be exceptional.

Anonymous’s picture

I just ran a test.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>Untitled</title>
</head>
<body>
<div class="hi,there">
</div>
</body>
</html>

This validates. Commas are allowed in class attributes.

dixon_’s picture

StatusFileSize
new969 bytes

Okey. That is a problem. Anyway, here is a patch that solves the backward compatibility (if you aren't using commas in your class names) :)

dixon_’s picture

Status: Needs review » Postponed

Setting this to postponed after out last discussion in IRC.

Scyther’s picture

Version: 6.x-1.x-dev » 8.x-2.x-dev
Issue summary: View changes
Status: Postponed » Needs work

This would be a nice feature to have, I have thought about this my self.

This patch needs update for Drupal 8 and Drupal 7.

cuman’s picture

+1