1

I'm helping someone to maintain a Drupal site and I still have not figured out how drupal actually works, it's driving me bonkers. I need to make a change to the way some content is displayed, but cannot figure out where that change needs to be made - I could go around just changing up the site until I stumble on it, but would rather not put a wrecking ball through their site like that.

Would appreciate if anyone can point me to a simple explanation of how to find out how a node is rendered and how I can track down the views involved.

The setup of the site is they have content types candidate and survey

When you view a candidate you see a nice table with info on the candidate and their survey responses.

I want to add some new fields (some to survey, some to candidate) I've added the fields, but don't know which view is involved in rendering as the views are not named clearly.

How can I figure out which view is involved in rendering a candidate when I go to www.site.com/candidate/bob ?

1 Answer 1

1

Your question is actually very generic and can have a big explanation but I will actually pickup a couple of points from the question description and will try to explain.

How is node is rendered? Node is drupal's "most" core part. Most of the code is written in node.module in "modules/" directory. https://api.drupal.org/api/drupal/modules%21node%21node.module/7

Drupal uses a theming layer to render the content to the browser. If you want to alter the display of any node, you can check node.tpl.php in the current active theme directory. You can override the HTML of a node using node--[CONTENT_TYPE].tpl.php. For example if you want to change the HTML structure of article content type, you can copy node.tpl.php to node--article.tpl.php and can update the structure.

How to check the view

The easy way The easiest way is to login using admin and place mouse on the part of page you think rendered using views. You will see a dropdown menue with links like "Edit", "Delete" etc. If it doesn't help, there is a:

Technical way You can check the css class of the div enclosing the view data. For example if a view's div contains the class "view-front-page", then most likely the views name will be something like "front_page" or "Front Page".

Thirdly, I will recommend that you install devel module. I have never seen any module for developers that is more helpful than devel. It helps your print a lot of debugging information like error stacks etc.

Hope this will help.

0

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.