Skip to main content

Drupal 7

Dynamic form fields

Create Dynamic Form Fields in Drupal 7

Drupal's Form API helps developers to build complex, extensible forms with minimal code and also gives the option to make the form fields as dynamic. It means to change/create form fields based on the other field's given value. There is a cool trick to make dynamic fields in drupal.

translation

Translation of custom modules and themes in Drupal 7

As we discussed a lot about translation in the previous posts Translation in Drupal 7: How it works? and TRANSLATION in Drupal 7: How to work with, let us discuss a few points about how to do a custom translation to our module and pot(.po) file handling for string translations. Before getting into the custom translation let us know few things about pot file handling. The pot (or) potx file which will be with extension .po.

knackforge blog knowledge base

TRANSLATION in Drupal 7 : How to work with

In the previous part, we discussed about the Translation in Drupal 7 works with few snapshots and some makeovers. Now, lets discuss how to work with translation to translate the contents, field values and entity items.

1) Translating Menus

With Drupal core alone, user-defined menu items are not translatable. The Menu translation module, part of the Internationalization (i18n) package, allows users to select a translation mode for each menu.The following modes are available:

    Music player

    Drupal 7 audio player with download

    In this post, I would like to explain how to have a download button for an audio file along with an audio player. My objective was to allow users to play the audio file using a media player and also allow them to download the file using a button.

    For this purpose, I created a content type called "Media" with "field_audio" as the audio file field. I chose Mediafront module for the audio player. I hope setting up the audio player won't be that difficult, so let's move into the coding part.

    Slideshow drupal

    Slideshow in Drupal

    This post explains about creating a slideshow in drupal. There are many ways and plugins available to create a slideshow in drupal and I am going to discuss some methods which will be very efficient and useful.

    1) Using Views slideshow module

    2) Using jQuery cSlider plugin

    3) Using the Bootstrap carousel

    1. Using Views slideshow module:

    The modules required for this method are:

      1) Views

    translate in drupal 7

    Translation in Drupal 7 : How it works?

    As we all know that, we were all getting projects and clients across the globe. But doing a multilingual website with each having different set of requirements make the website handling tougher and tougher. Also, building a multilingual web site involves much more than translating content from one language to another. Translation must be done with an awareness of a language's idioms as spoken within a geographic region. But in Drupal we’ve been provided with rich set of core and contrib modules, which supports translation for our website(s).

    knackforge blog knowledge base

    Hide "Promoted to front page" and "Sticky at top of lists" options in Drupal

    This blog describes how to hide "Promoted to front page" and "Sticky at top of lists" options from node editing page in Drupal. When adding or editing a node, you can see "Publishing options" at bottom of the page which contains 'Published', 'Promoted to front page' and 'Sticky at top of lists' checkbox options.
    knackforge blog knowledge base

    PDOException - SQLSTATE[22003] - Numeric value out of range

    This blog describes how to solve PDOException - SQLSTATE[22003] - Numeric value out of range: 1264 Out of range. When you try to store large integer value in 'integer' field type, then you will get this error. It is because the maximum value of 'integer' field type is exceeded. 
    For example, you want to store phone number in a content type. Then you may create new field with 'integer' field type in the content type. When you store 10 digit phone number in this field, "PDOException error" will be shown.
    Subscribe to Drupal 7