1

I am trying to add some classes on the specific row in one of my view table. I have tried to use MYTHEME_preprocess_views_view_table, but failed. Nothing changed on my page.(Here is my previous question link:How to add css class to specific rows base on fields in order commerce view page, if you have any idea about this, I am interested in hearing from you). So I decided to create a new view.tpl.php file to display them. However, nothing showed on my page again.

Here is a screenshot includes: 1.my view theme detector 2.my code 3.result on Chrome enter image description here

I can find my file being used by my view, however, I don't see any changes on my page. Does anyone know what mistake I have made? Or any idea about how to add class on specific row.

Update:

I have already cleared the cache several times.

Finally: Normally, Chris Happy's answer should work. But there might be some problem with my website, so we figured it out my problem by using JQuery. Thank you for @Chris Happy's help.

1

I tested it out, and it didn't work for me....until I cleared the cache!

Just go to yoursite.com/admin/config/development/performance/ and click "clear all caches".

Update: since clearing the cache didn't work, check if you are editing the right file: delete all the code in the tpl.php file.

  • If the view disappears, you are editing the right file.
  • If it still shows, close your editor window and select the file again.
9
  • Sorry that I forgot to point out this. I have already cleared my caches for several time. – jmu Nov 28 '16 at 21:32
  • Have you made sure that you were editing the correct file? I have double checked it and I can't reproduce. Updated answer for things to check – Chris Happy Nov 28 '16 at 21:55
  • Here are my steps: First, I go the page which displays my view, then I click "edit view" on that page. Now, I was directed to view edit page. All the information I used are from this page. Therefore, I thought I was editing the right file. But it's still not working... – jmu Nov 28 '16 at 22:43
  • I meant your views-view-table--page-1.tpl.php file. Please erase all the code, flush the cache, and tell me what happens to your view. – Chris Happy Nov 28 '16 at 22:50
  • Okay...Hmm... Nothing happened. The view is still displayed. – jmu Nov 28 '16 at 22:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.