1

Please check this site

I am trying to create rounded corner rectangle on right hand side where products are listed. This is currently working because I modified view-view-grid.tpl.php. Doing this has changed everywhere wherever I was using grid. I want to add this style only to a particular view. How can I achieve this in views. I also want to modify style of each category displayed within the box eg. Product category should be bold or some different color.

I am beginner so please let me know steps or some good references.

3

This is actually really easy with views. I am going to assume you are using Drupal 7 with Views 3. But this works almost the same in previous versions of both as well.

First, go into your view. On the far right expand the "Advanced" fieldset if it isn't already expanded. Then click on the "Information" link next to Theme at bottom of the list.

This will popup a modal that will display how to name your template files to replace the default template. It specifically allows you to modify different levels of the template. Find the level you want to modify. Then, while reading the list from left to right (right being the most specific) pick the name that is specific enough for your uses.

Next, go into the views module and find a copy of the bolded template file and copy that into your theme folder into a templates folder or into a custom module. Then give it the name you found above and make your changes.

Finally save it and flush the Drupal cache. Now when you go back to that information page it should show your new template file highlighted. This may require a few refreshes.

Now on another note, if you use the built-in field controls you can add custom CSS classes to help target the specific view and thus a specific button underneath it. You can also add specific classes to the view in the advanced section.

Though keep in mind drupal already gives us a ton of classes to each element, so you shouldn't need any of this just to target that view and a specific button within it.

| improve this answer | |

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.