0

i'm using drupal 7 with starter theme of zen. i've created a view on a block, now i need to customize some parts of html / css in order to add just media query (css part) and add a <a> tag with display:none for desktop version and display:block for mobile. SO i need to modify html AND css of this view. I'm searching for the php file of this view and i didn't find it.

Any help please ?

  • 2
    It's dynamic, the rendered content isn't actually saved anywhere except a transient cache if you have that enabled. For the customisations you've outlined, you don't need to make any HTML changes, just CSS, so just use your theme's CSS file – Clive Apr 25 '16 at 14:53
  • You can find the appropriate file name for the template in the right part of your view's interface: click on Theme and you'll see the activated templates. – Jeroen Apr 25 '16 at 14:55
0

If you click on the Theming link in the Advanced tab, you will get a list of possible template files that you can use. See here: Views Theming - Information Tab

Next, you can click on "Display Output" to get a copy of the PHP that is powering the view. See here: Views Theming - Display Output

Copy that PHP into a file and save it using the naming pattern of your choice from the list beside "Display Output".

Click on "Rescan template files" to make your theme aware of the new template.

Now, any changes you make to that template - add CSS classes, etc - will automatically be picked up.

If you wish to edit HTML for the style or row, just click on the relevant "Style Output" or "Row Style Output" link instead of "Display Output".

I hope this helps you.

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.