Drupal

Caching Module

بوب إلى هذا الموقع اقرأ المقال
Caching Module
Loading menus and rendering content in Drupal can be slow, especially if your menus are large, you have allot of entities on a single page or the rendering causes allot of database lookups for getting path aliases or similar.  Below is a simple module that aloows you to cache both menus and rendered content by using a the "caching_cache_render" function instead of "render" and "caching_cache_menu_tree" instead of "menu_tree".  There are then controls for you to set whether the caching takes place or not and the duration the items are cached for in the admin area at "/admin/config/development/performance/caching". 

Bright Sites: The Independent and Evening Standard

اذهب هنا
Bright Sites: The Independent and Evening Standard
October 2015 Present (Contract). My work at Bright Sites is as senior back end Drupal developer on The Independent and The London Evening Standard websites. Having joined the team about 6 weeks after the migration to Drupal from a previous version I have mainly been developing new features and optimising the existing codebase to maintain a fast and fluid user experience at all times with the high volumes of traffic and complexity of a truly dynamic and reactive content driven and highly availabl

Recursive Image Viewer

Recursive Image Viewer
If you have ever wanted to see all the images in your files directory or from a package that contains multiple directories, each with multiple images or subdirectories that may or may not contain images more images then this may help you.  This is a very simple script that recursively scans a directory for images and then makes a HTML page displaying all these images on a single page to make browsing as easy as possible.  To save your browser from crashing the images are lazy loaded as you scroll down and to fit as many on the page as possible there is a max width set on each image and I am using CSS Flex to give a little order to the chaos. 

Drupal JSON Node API

Drupal JSON Node API
To help with a content migration project I have recently made a module that exposes all published node types, node IDs and the nodes via a very simple JSON API. There are only 3 custom functions needed to give the requesting user a list of the types that are available, the node IDs of any given type and then finally the nodes by ID. I have set this up on here as an example. Node Types NIDs of type blog This node as JSON This was just intended to be used locally when importing content to a different site with another custom module I made for easy content migration but may be of use to someone so I made a Drupal 7 version as well, they are both available for download here: Toms GitHub:/modules

JavaScript Feature Detection in Drupal Behavior

JavaScript Feature Detection in Drupal Behavior
This is a very lightweight way to add feature detection to your Drupal site. Add this Javascript file to your theme and then include it in your theme.info file for the best results.  The file adds a Drupal Behaviour that adds classes to the HTML tag of the page so that you can interact better with the users browser.  The features this detects are listed below:  Flash  Sliverlight  PDF  QuickTime  Windows Media Player  Shockwave  RealPalayer  Java  This is also available to download from my GitHub account.  (function($) { Drupal. behaviors.featureDetection = {};

Adding bundles to your xml sitemap the easy way

Adding bundles to your xml sitemap the easy way
If you have ever had to configure the Drupal xmlsitemap module for a site with lots of content types, vocabularies or any other entity types you know how frustrating and tedious it is having to edit each one of these bundle through it's own edit page to have it included in the sitemap. Having recently had about 10 sites who's sitemap settings had all been neglected and with each site having over 20 content types and other bundles that were supposed to have been added to the sitemaps I decided to make a module so I can do this all from a single page with a single form. There is no option to set the priority of each bundle on the form as this was not my concern and this is not being

Why do spammers even bother?

Why do spammers even bother?
If you have heard about the recent Drupal security bug that was found then it will probably be no surprise to you that there has since been a huge increase in spam post attempts towards Drupal sites. I do what I can to hide as much info about this site as I can with the minimum effort so I delete the read-me files form my Drupal installation and make sure I keep all my code up to date with the latest versions of the modules I use but these guys still decided to target this site an no doubt yours with more links to fake handbags and all that beautifully writtent content they post. I am still surprised to see just how many links to pointless websites trying to sell pointless junk people still

Drupal add JS from the UI

Drupal add JS from the UI
Adding JavaScrip to Drupal pages is super simple as you know but it you would prefer not to have to do a full release of the site in question for the sake of a new banner or whet ever amazing and critical feature you are adding on behalf of your marketing department the options are limited. You could use a block, this is a reasonably painless way as the blocks interface has a nice way to target pages specifically and in most cases it works, it is however pretty nasty when you think about it, there is also limited control of where in the page you place this JavaScript, it's not like you can put a block in the <head> of your page is it. There may be other solutions for this pro

Drupal 6 MD5 Password Reverse Lookup

Drupal 6 MD5 Password Reverse Lookup
The ethics or reverse engineering your users passwords are at best questionable but I have recently had a case to do so ethically as the site used a 3rd party API to which the password was sent when the user logged in to a Drupal 6 site. This old system is clearly not very well thought through as it sends un-encrypted user data via http but this is not the point of this post. As I needed to get some real data from the API I had no choice to look-up the MD5 hashed passwords form the Drupal 6 database to gather a good batch to work with. Please note this is only intended to help people facing similar issues and not designed to hack people's facebook or bank accounts!

Drupal auto login

Drupal auto login
I have lots of different Drupal sites I have to log in to on a regular basis and remembering what password I am using at any given time is impossible, my Chrome often gets my passwords wrong as well so to make my life easier I have written a tampermonkey script to log me in to my Drupal sites automatically.  I also generally use a batch file if I have to open many sites at the same time so I have included that here as well, typing my password out 17 times becomes very tedious!  Batch file for opening multiple incognito chrome tabs  FOR %%A IN ( http://site-1.co.uk/user http://site-2.co.uk/user http://site-3.co.uk/user http://site-4.co.uk/user http://site-5.co.uk/user

Pages

Subscribe to RSS - Drupal