Drupal

Drupal 7 – Show one teaser image of multiple added images

0

Since Drupal 7 the CCK module is for a large part integrated into the Drupal core. You can very easily create and add new fields to a certain node type. One of the available field types is “field_image”. You can set the setting that multiple images are allowed.

If you create a view that displays all the node teasers, the images will be visible there. That all images are appended is nice, but actually only for the full node and not the teaser. So if you only want one image to show in the teaser you have to override the More >

Drupal 7 – Multi language front page

4

It’s not possible in Drupal 7 to define a front page per language with the core or i18n module or something. However with a little bit of code it’s still not so hard to do.

Create a custom module “alter” for example. Create the folder in “sites/all/modules/alter”. Create “alter.info”

name = Alter description = "This module performs several minor changes" package = Custom version = 7.x-dev core = 7.x

And create a file with the name “alter.module”. And put the following code in it with your More >

Drupal 7 – Exclude node type in search results

1

Websites that use the search of Drupal 7 core have now ability to restrict the search and exclude some node types for example. I see some articles that Drupal 8 probably will have this kind of functionality.

However, it’s possible to rewrite the SQL query that selects the search results. Thanks to the Drupal database layer this can be done quite easily.

/**  * Excludes node type "foo" from search results  *  * @param object $query  */ function mymodule_query_alter(&$query) {   $is_search = FALSE;   foreach ($query->getTables() as

More >

Go to Top