Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Camster created an issue. See original summary.

No Sssweat’s picture

Issue summary: View changes
No Sssweat’s picture

Issue summary: View changes
jchin1968’s picture

I'll work on this

jchin1968’s picture

Assigned: Unassigned » jchin1968
jchin1968’s picture

With nth-child() selector available in CSS3, I don't think it's necessary to include classes like views-row-1, views-row-2, views-row-even, etc. in the HTML. You can do something like the following to highlight the first row.

.views-row:nth-child(1) {
background-color: yellow;
}

Regardless, here's a patch in case there is a use for the additional classes.

jchin1968’s picture

Status: Active » Needs review
dawehner’s picture

Status: Needs review » Needs work

@jchin1968 This is totally right, we don't need this actually. Let's create a patch to update the string in the UI instead

The last submitted patch, 6: core-views_row_class_number_missing-2669394-6-D8.patch, failed testing.

jchin1968’s picture

@dawehner OK, I'm glad the patch is not needed since I was running into problems with simpletest.

Sorry, I don't understand your comment "create a patch to update the string in the UI". What string and which UI?

dawehner’s picture

Well, maybe replace "like views-row-1" in the UI.

dagmar’s picture

Version: 8.0.3 » 8.2.x-dev
Status: Needs work » Needs review
FileSize
1.06 KB

The only class added when clicking 'Add views row classes' is views-row.

dawehner’s picture

If its the only one, we could drop "like" from that help text.

dagmar’s picture

Well, we don't know if other plugin could define other default classes. I particularly prefer at is currently implemented.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

I see

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +String change in 8.2.0
+++ b/core/modules/views/src/Plugin/views/style/StylePluginBase.php
@@ -345,7 +345,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
+        '#description' => $this->t('Add the default row classes like views-row to the output. You can use this to quickly reduce the amount of markup the view provides by default, at the cost of making it more difficult to apply CSS.'),

Hmmm whilst we are fixing this can be put views-row into a placeholdered variable. It is not translatable. It should not be part of the translatable string.

dagmar’s picture

Status: Needs work » Needs review
FileSize
1.09 KB

Thanks @alexpott. Here is the new patch.

alexpott’s picture

Status: Needs review » Needs work
+++ b/core/modules/views/src/Plugin/views/style/StylePluginBase.php
@@ -345,7 +345,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
+        '#description' => $this->t('Add the default row classes like @classes to the output. You can use this to quickly reduce the amount of markup the view provides by default, at the cost of making it more difficult to apply CSS.', array('@classes' => 'view-row')),

Should'nt that be views-row?

dagmar’s picture

Status: Needs work » Needs review
FileSize
1.09 KB

Sorry. Wrong copy and paste.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Ha, someone here has good eyes, someone doesn't

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed d46b0af and pushed to 8.2.x. Thanks!

  • alexpott committed d46b0af on 8.2.x
    Issue #2669394 by dagmar, jchin1968, Camster: Views Row Class Number is...

Status: Fixed » Closed (fixed)

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