drupal 7

Cómo crear un bloque de contenido relacionado con views en Drupal 7
As usual in Drupal, there are always several ways to solve a problem. In this case we want to make a block content related to be displayed on a node, for example the typical block of related news shown in the node of a story.  What we need to do is to create a view that shows the news with the same taxonomy term that the node on which the block will be displayed and, of course, that it doesn’t show us the same node we are. For this we must follow these steps:  1. Create a view with a block type display.  2. We add the fields you want to appear as the title, date and photo. 3. We add a context filter to exclude the current node. Click on "Add contextual Filter"   Select "Content: Nid (The node ID)". Now if the filter is not available,  select "Provide default" and Type select "Content ID from URL" Finally we go to the "More" section and check the "Exclude box - If checked, the numbers indicated for the filter will be excluded rather than limiting the view. " 4. We add a second contextual filter:  Select "Content: It has an id from a taxonomy term."  When the filter is not available select "Provide default" and Type select "ID taxonomy term from URL" and then mark the box "Load default filter from node page, that's good for related taxonomy blocks" and select the vocabulary we want. If you do not load the list of vocabularies, click Save and re-click on the conceptual filter. 5. Now you only have to go to the block settings and locate the block in the region and the type of content that interests you.   And that’s it, we have our block content related to views in Drupal 7.   Main photo: Nicolas Hoizey
Placeholder text form
With the advent of HTML5 few years ago, the possibility to add placeholder has appeared The placeholder text is displayed in a text field on a form before the user complete, it’s very useful since it clarify what information must be entered in this field. For example, the HTML code: <form> <label for="search">Subscribe to the newsletter</label> <input id="news" type="text" placeholder="Enter your email" name="seach"> <button id="subscribebutton" type="submit">Send</button> </form> It show something like this Adding placeholders to the forms is a good practice that improves usability and of course the user experience. The W3C recommends using the placeholder always with the Label that, since they are supposedly complementary, but in Wild Wild Web, we often use only one of the two, since using both will be redundant. Support for placeholder will only be visible in most modern web browsers but usually a jquery fallback is implemented for the same functionality in older browsers. There are several ways to add a placeholder to a field on a form in Drupal 7. Below we highlight 4 which we consider the most useful. Form module Placeholder https://www.drupal.org/project/form_placeholder This module allows us to add placeholders to any form of the site from the Drupal administration. Hints Webform module https://www.drupal.org/project/webform_hints This module allows automatic placeholders to incorporate any textfield, testarea, select list and email field forms created with the webform module (https://www.drupal.org/project/webform) This module also comes with support for older browsers that do not support the placeholder attribute will and implement the fallback using jQuery. Field placeholder module https://www.drupal.org/project/field_placeholder It allows you to add the placeholder attribute to any field of a drupal entity, as fields of a content type, terms of taxonomy, user, etc. When activated, it displays a new option to enter the placeholder when you edit or create a field. Function in the template.php Finally the more advanced technical approach that involves all code but it’s the most powerful of all. It is about adding the following function to template.php file from our theme. function YOURTHEMENAME_form_alter( &$form, &$form_state, $form_id ) { if (in_array( $form_id, array( 'user_login', 'user_login_block'))) { $form['name']['#attributes']['placeholder'] = t( 'Username' ); $form['pass']['#attributes']['placeholder'] = t( 'Password' ); } } This case introduces a placeholder for the login form. Remember to change the name of the function YOURTHEMENAME by the name of your theme, and change the id of the form and name of the field you want to make the change. Learn how to get the id of a form.
Rocket launching
Optimize the performance of your website with Drupal Boost, a module that provides a cache for static pages Drupal allowing a significant improvement in the performance for sites that receive traffic preferably from anonymous users. It is the best option to improve and optimize our sites hosted on shared hostings. Boost stores and compresses (gzip) HTML content, XML, Ajax, CSS and JavaScript. In this tutorial videoe, we explain to you how to install and configure the Boost module in Drupal 7. I hope you have find this helpful, you can leave your comments or questions and we’ll try to answer them all.   Esperamos que os haya servido de ayuda, podéis dejar vuestros comentarios o dudas y trataremos de responderos a todos.
How can we help?Get in touch