There's a key bit of information I think I'm finally ready to learn - how to determine where information on a page is coming from in Drupal.
And by "where" I mean how do I find the templates being used that generate information I see on a given web page.
I'm working with CRM Core right now and I've noticed a few places where I have no idea where the info I'm seeing is getting generated. There is one that is bothering me more than the others - a view that includes 3 buttons that are not to be found anywhere in the views ui.
There are a few others, but my hope is that figuring out this one will give me the knowledge needed to figure out any others. I suspect the buttons are hard-coded into ... some file - hence the question.
Also, I'm pretty sure there is documentation out there that will help guide me through this, so I'm not looking for anyone to hold my hand through something I can learn on my own. A link to one or more resources would be great. Unfortunately, I just don't know enough about what I'm asking to be able to get a helpful answer from Google.
Any / all help will be much appreciated - thanks!
Comments
Places to look for custom coding
It sounds like you are working with a site that someone else has developed. If that is the case, get in touch with the developer and ask some questions. Then again if that was the case, you would not be asking us for clues.
There are likely two places to check for modifications to the output of the site.
Theme Templates
Take a look in the theme folder of the current theme of the site. Look for *.tpl.php files. The names of the files will correspond to the items they modify.
node-type.tpl.php (d6) and node--type.tpl.php (d7) would modify the node template file for that particular content type. For more info, check here -
https://drupal.org/node/17565 - Theming nodes by content type
Views can also be altered with template files. Here's a link to info on views templates:
https://drupal.org/node/1089656 - Drupal 7 Template (Theme Hook) Suggestions
Custom modules
Another way to update forms and pages is with custom modules. Look in your module directories for custom modules. You might have to do some looking, here are some possibilities:
/profiles/PROFILENAME/modules/
/sites/default/modules/
/sites/all/modules/
/sites/SITENAME/modules/
A few other conventions folks use:
/sites/all/modules/custom
/sites/SITENAME/modules/custom
The most famous function for altering a form is hook_form_alter. Once you find your custom modules, you can search for _form_alter to find functions within these modules that will alter the forms on your site.
You can also do test searches for the button names to see if you can find them defined in the custom modules.
There are MANY ways to change the output on your site pages. Don't get discouraged, you will find it! A good way to get help is to show up at any of our local events. You will get slightly different responses from everyone you ask, and they could ALL be right.
Let us know how it goes.
Thank you very much for the
Thank you very much for the detailed reply!
I am actually working with 2 dev sites (i.e. local to my laptop) - one is a demo distribution called "AbleOrganizer" put out by Trellon, the folks who built CRM Core, the other is a clean install of Drupal 7 with only CRM Core and its dependancies enabled. The 3 buttons that appear to be contained within a view but have no apparent source within the views ui are in both the distro and the base module...
I've looked through pretty much every file that I thought might be relevant in the crm_core modules on both the distro and the clean install and don't yet know enough about module building & php to understand fully what I'm looking at. I'm starting to get there, but I ain't there yet.
The one place you mentioned that I hadn't thought to look was the theme templates, as I assumed templates installed with the theme wouldn't be able to insert module-specific information into a view, but I'll check them out as well as the 2 links you included.
I'll be at David's half-day intro to module building class on 5/14, and will hopefully be able to make his into to theming class on the same day. I was at last year's camp, most of the 4th Wed meetups, 4 or 5 of the 1st Thursday meetups at the Blue Nile, and I was one of the volunteers who helped at David's January Intro to Drupal class. I wish I had started looking into CRM Core before last month's community lab hours as I'd have definitely asked this question there... :)
I have posted a couple of questions in the CRM Core issue queue but haven't gotten any responses back yet and I've got a relatively short time frame in which to figure this out for a client. I fully understand that my emergency isn't anyone else's problem, but I thought I'd take the advice David gave me after last month's lab hours - post questions here as I might be more likely to get a response from folks I've met. Excellent advice of course, but only relevant if anyone can place the user "dang42" with my face and realize they've met me... ;)
I will post back when I find the answer or have further questions based on what I learn from the links & info you posted - and I'll be happy to follow up on links anyone else posts as well should they care to do so.
Thanks again!
Dan
Devel module suggestion
Dan --
Have you installed and used the Devel module -- https://drupal.org/project/devel ? It provides an inspector overlay which shows where things are coming from and suggests best-practices methods for overriding things. It would likely reveal the info you're looking for or at least provide a strong hint on where to look. Check out the instructive screenshot for an example of how it works -- http://cyrve.com/screenshots/devel_theme_snap-20080113-205127.jpg.
Best,
Barry
P.S. I finally do make the proper association between your dang42 moniker and you in person after months of "who's this dang fellow?"
Barry Madore
Triplo
Minneapolis-St. Paul, MN
Theme Developer?
Hey Barry - I think you might mean devel_themer: https://drupal.org/project/devel_themer. This used to be part of the devel module, so it's a common mistake. This is the one that gives you the overlay that helps tell you what template things are generated in (and suggestions for naming conventions to override them).
--
David Needham
Team Lead of Training at Datadog
Umm, yeah!
You are correct, sir! I did see that devel_themer is now separate. The screenshot linked to on the devel project page clearly shows the themer overlay not devel's, so I was (justifiably) confused.
Dan, while devel is absolutely a good tool to have in your arsenal, I was referring to features specifically in the devel_themer module that David points to. It's a separate install. Look at the documentation on the project page as there seem to be some caveats about dependencies. I think you'll find the module helpful...
Barry Madore
Triplo
Minneapolis-St. Paul, MN
Devel module
I do have it installed but have never really gotten the hang of how it works. That lack of understanding is probably why I didn't think to try to use it to answer this question (oops...). Thanks for reminding me and for the link - I'll learn more about it and hopefully that will help on this and other similar questions in the future.
Re: "dang42" - At my first job, names were listed as 'first name' 'first letter of last name'. Dan G works, but I always thought running them together was more amusing.
As for "42" - it is "the funniest of the two-digit numbers", so why not... ;)
re: devel_themer
David, Barry-
Thanks for the clarification - I'll check it out!