On the Cornell AAP website, many nodes use field collections, and recently had to make some content types translatable. Field collections are not translatable by default - there is a patch that needs to be applied. I'm going to write about how to do this so you don't have to waste a good part of your day figuring it out.
At the time this post was written the module and Drupal versions used are:
On Cornell AAP's new site (http://aap.cornell.edu) one of the requirements was to show their Twitter tweets in different pages. The tweets had to match the look and feel of the new site, and had to pull in new tweets periodically so I knew I had to use hook_cron. Tweets that have images also needed to be saved and clicking the Tweet's image takes the user the original image.
This is a brief guide of where Drupal 7 will look for the template.tpl.php file in a hook_theme item depending on the 'template' and 'path' settings, or lack of. For a thorough and complete explanation head to the official hook_theme page.
Our setup:
Module: modules/mymodule Theme: themes/mytheme
We're going to output the value using $html = theme('news_filters').
While in Coda, I press Command + R to refresh Firefox, saving one (measly) click. There are probably better ways to do this like using the LiveReload plugin.
I had a bunch of PDF's that needed to be merged into one PDF file and present it as a file download to the user. To do this I first installed Pdftk (the pdf tookit) on the server then ran the command via shell_exec(). Steps with code below.
On a recent project I had to show the total number of comments posted using Disqus for each node on a page. What the page did was loop through a bunch of nodes and render the teaser view of each node. The teaser was shown by rendering node.tpl.php, and in that file I had to display the total number of comments. Clicking a teaser view took me to the full page of the node that also contained the Disqus commenting box.
I recently finished a project and soon after the customer asked that the site load a different theme if the visitor was on a mobile device such as an iPhone or Android phone. The site is in Drupal 7 and the mobile version needed to load the same content as the main site. I came up with these requirements: