In one of my recent tasks I had to create custom token to show current page url inside ads targeting. I will share my code.
Hi sometimes we need quickly import a lot of redirects. We can just put file with redirects in format:
Then read line by line and create redirect if it is unique.
We can easilly do all this using code given below.
Sometimes we need to provide php profiling to find bottlenecks inside our site. Xhprof extension is one of the best solutions. Here is example of found small issue and given graphs before and after chnages.
Graph before changes
After changes (I just added module_load_include into condition to call it not so often).
If we need to disable drupal js or css compression for some roles we can use code below. Moreover we can change here ary settings from global $conf variable. For example you can change cache life time for certain roles or block caching. Any setting from this page http://yoursite.com/admin/config/development/performance can be changed in code given below.
Thank you for reading! Continue doing drupal!
For SEO purposes sometimes we need to create chronological sitemap of nodes. Great sites like New York Times and other use this technique. Now any drupal site also can create chronological sitemap using this module https://drupal.org/project/chrono_sitemap. Here is description what this module does.
Hi Sometimes facebook cache doesn't allow us to make visible changes we made into node. To prevent this cache issues we can create custom module and add hook given below. It will flush facebook cache on node update event.
Thank you. Continue doing drupal!
In some projects, highly loaded ones, we need to optimize search work. Default drupal search is a bottleneck it takes a lot of resources and give slow responses. Even when apache solr module is installed and properly configured we need to leave default search enabled. It means that on any cron run default drupal search ndex will be rebuilded, it will take disk space and dozens of Mb in data base search_index table. To prevent this we need to execute one update_hook which will disable search index update during cron run and will make empty search_index and other search related tables.
Sometimes we need to flush cache on drupal site for one small thing become visible. And we had to clear all caches to make visible small change for block or for node field value. Now we have solution it is Cache Flush module. We can easily flush cache for block using "Flush cache" contextual link.
Hello, sometimes we need to add custom rss feed. We can make it using custom approach and can make it thorugh services. I prefer using services because they give us great possibilites. Services is a nice solution to integrate external applications with Drupal.