Drupal 7

My block_render resource (Drupal 7)

I often use this helpfull function to render my blocks anytime anywhere.

Script code: 

Use preprocess page

In case you need to embed some views in your page.tpl.php I will encourage you to use preprocess functions, @oskar_kalvo recommended me to use this kind of functions instead of views_embed_view at the template.

Links con #ajax graceful degradation #Drupal 7

Crear links en Drupal 7 con degradación elegante no es un proceso complicado, pero debemos conocer bien el procedimiento. 

Voy a compartir a continuación un ejemplo de lo que yo suelo utilizar para hacerlos.

Primero de todo, declaramos un hook_menu que atenderá a las respuestas de nuestras peticiones:

Custom Webservice Client. Una interfaz para tus clientes Soap en #Drupal

Buenas a todos, aprovechando una necesidad puntual he aprovechado para crear este módulo que da una utilidad para crear clientes de webservice.

Este modulo mantiene una lista de clientes de webservice en base de datos que pueden ser invocados desde cualquier otro modulo con unas simples líneas. 

Utiliza la clase Soap de php con lo que hace falta tener instalado el módulo php_soap, y extiende la clase SoapClient para que soporte MTOM.

Connecting to external database with #Drupal7 abstraction layer (And testing connections)

Hi all,

If you want to temporary connect to another database and make some Querys in Drupal 7, there is a very simple procedure:

First of all, declare the array with the information of the connection

hook_field_schema for a text_format (textarea) #Drupal

Hi all,

Recently we had some troubles when we were defining some new custom fields through code. Our goal was to create 2 fields in one, a textbox and a text area with format selector.

The problems came when we didnt found the correct schema definition for a text_format. But finally the solution came across this implementation (extracted from the text core module).

In this example I will only talk about the textarea. The solution was dividing the text_format in two columns, one for the format and other for the markup.

Instalando #CentOs 5 con #Drush, #Jenkins, Php5.3, PEAR y Drupal7

Para continuar con el hilo de los post anteriores y vista la dificultad de hacer funcionar correctamente nuestro Drush con Jenkins en Windows, vamos a pasar a hacerlo en un CentOs.
Podemos descargar CentOs desde la lista de mirrors públicos. http://www.centos.org/modules/tinycontent/index.php?id=30
En este caso, hemos optado por montar una imagen virtual con VirtualBox. Lanzando las Isos con UltraISO para Windows.
Una vez tenemos instalado CentOs, debemos actualizar el sistema:

Example module: News jQuery carousel

Here's a first approach of an example module I've created. It can create a jQuery carousel that displays news of the selected content type.
Options:

Query Alter en Drupal 7, filtrando resultados de busqueda

Objetivo: Filtrar los resultados de las búsquedas a un tipo o varios tipos de contenido.


Para limitar la búsqueda de contenidos de drupal a una serie de tipos de contenido podríamos recurrir a un módulo e instalar search config


O programarlo, para evitar el resto de opciones del módulo, si no nos interesan.

Creating forms with a template file! (#ajax included)

If you need to create custom forms that have to be rendered with a custom appearance you might be in trouble...



This will never be a problem again with:

Custom field access permissions in code!

You need to create custom field permission in Drupal 7?

A simply way is installing Content Access module, but it overloads too much the performance of the page.

Content Access allows you to define per field / per role permissions. But, what if you only need some fields to be private?

I wrote the following example for that purpose:

Updated, Enabling HTTPS in Drupal 7

HTTPS is a protocol which encrypts HTTP requests (like the kind you just made to see this page) and their responses. This ensures that if someone were able to compromise the network between your computer and the server you are requesting from, they would not be able to listen in or tamper with the communications.

I've been doing a work around including Https in a Drupal 7 site, the modules i found are these ones:

Using Views Query Alter and adding a table to the query

Views provide a great functionality to Drupal, but sometimes, relations are just impossible to handle.
Being aware of that problem at the time we are trying to get some info from the database, we made a change in our default views query.

In my module I implemented views_query_alter and I used the add_table function as shown below.

The default query alter was:

Print custom menu in TPL file, Drupal 7

If we need to print a custom menu in our TPL file we should do the next:

Use our preprocess_page function in our template.php.

Subscribe to RSS - Drupal 7