Drupal 7

Getting a teaser from multiple nodes

If you've done an entity field query you can process it like this to get a 'teaser' rather than a 'full' view

drupal_add_js weighting options structure

In order to set the weight of a js file relative to one of the other using drupal_add_js:

URL Alias Site Map

To Create a page listing all URL Aliases you will need to import the two views below, as well as, the tpl for the field.

After importing the views, make sure to go into each view and set the filter values for what content and taxonomy terms should be shown.

Also, make sure the permissions are set to the desired standards of the AE.

Images to scale or crop and aspect ratios

These are some help diagrams to assist people in understanding the basic image operations we can do with image cache styles.  There are lots of subtle things we can do, but the bulk of the decision always comes down to whether we should scale or crop.  The balance is this:

Content Delivery Paths - Places where things can go bad

There are cases where  a client or user can see something completely broken and other see it as fine.  Some typical reasons for this are:

Theme-ing a Search Form

When themeing a Search form there is often the challenge of having the search field expand to fill the space but not collide or get covered by the search button.

[[{"type":"media","view_mode":"media_original","fid":"42","attributes":{"alt":"","class":"media-image","typeof":"foaf:Image"}}]]

The trick is to make them act like table cells.

Safely Grabbing Drupal Path Args

In Drupal there are system paths (not to be confused with friendly URLs) that provide information that can be used to make a page or block "self-aware".  In the example below, the user friendly path may have any one of the three example system paths.

Drupal arg structure.

 

 

 

Taxonomy Term Display

In core there is a module called: Taxonomy display.

The module allows for the custom display of Drupal's default taxonomy term pages. The module is enabled upon installation.

To use the module, go into the "Manage Display" tab of the taxonomy term. Under Default display in the lower tabs, make sure "Taxonomy term page" is checked under "Use custom display settings for the following view modes and click on ". Then click save. Move to the "Taxonomy term page" display and customize the options there.

Importing an Excel (xls) File to Generate Nodes or Terms (Feeds)

Often we get issued an Excel spreadsheet of pages with names and description and need to import them into Drupal.  Here are the steps.

codit_memorytracker() - Tracking Memory use in a Drupal Script

Devel has some output that you can turn on to inspect script memory useage. In some cases (like batch processes) they may not give you what you need. Especially if you want to watch it while it is happening.

Here is a function that is part of the Codit module. Here are some sample ways to call this function.

Pages

Subscribe to RSS - Drupal 7