0

I use Views to create new content and a new page for the content, but how am I supposed to customize the HTML layout of the page? I can style elements of the page via CSS, but what if I wanted to have my own CSS3 (animated sprite) elements? For example, most CSS3 sprites require you to have divs contained in a specific manner, but those divs are not present in a Views created page and I see no viable way to manually add them? How would I go about doing this?

1 Answer 1

2

When you edit the View, under the Advanced settings on the right-hand side you should see "Theme information". If you click that it will give you the content of the theme templates for the View, which you can then override by copying into your theme, in a file with a corresponding name.

2
  • Thank you! Just to clarify though, is this considered 'hacking?' i.e. Will I mess things up just by hard-coding markup in these files? Similar to how you screw over Drupal by modifying core files.
    – Matt
    Commented Mar 8, 2013 at 4:38
  • 1
    Don't modify the files that Views provides directly. Instead, copy them into your theme, rename them accordingly, and modify your version of them. That overrides the originals instead of modifying them directly. You could still put some awful markup in there, and no one can stop you, but you're not hacking Views or core or anything.
    – beth
    Commented Mar 8, 2013 at 4:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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