Solving Menu Import Issue when Featuring Sample Data in Drupal

Currently, if you would like to export and import the sample data( like kickstart) via features, then the menus for your data breaks because it uses the hard coded path(i.e. node/id) and the new instance has different path for the nodes imported. To my understanding there is a work in place to fix this in future release of features by using the path uuid but of January, 2014 that is not available at least in …

Continue reading →

Handling Artifacts for Custom Module in Drupal

You have custom module that you have made exportable via features. This custom module has sample kickstart data that contains artifacts such as images, video, etc. In this post, we cover how to manage these artifacts, so when user enables your custom module those are copied accordingly and automatically Env: DRupal:7.26, Features:7.x-2.0, UUID:7.x-1.0-alpha5+17-dev, Feature_UUID:7.x-1.0-alpha3+15-dev About uuid_features_file_path Each artifact exported via Features module receives an attribute – uuid_features_file_path. This attribute specifies where are the artifact located …

Continue reading →

How To Implement Custom Field Types In Drupal

In this post, we go over on how to create, handle and display a custom fields in Drupal. In addition, we look on situations when your custom field contains an artifacts that requires an additional care The hook_field_schema() defines the columns. The table will be only added after an actual field is created(attached to content type). So, if you like to see if the data is being added for the custom field, look into table …

Continue reading →

Make Custom Field with File Exportable in Drupal Features

In this post, we cover a case where we have a custom field that contains a file and we would like to be able export/import it with a Features module in Drupal Env: Drupal 7, UUID Features 7.x-1.0-alpha3+1(dev), UUID 7.x-1.0-alpha5+1(dev) Intro We have content type with a field field_elastic_slide that contains a file among other things(see our other post for “How To Implement Custom Field Types In Drupal”). We are exporting Nodes with this field …

Continue reading →

Activate Context To Rebuild Page More Than Once Per Page Load in Drupal

There was a situation where we needed to rebuild a page content and do it from Page scope(hook_preprocess_page). Most of the time the page content is altered via hook_page_alter(), however. This adds overhead of setting up a separate function, filtering request and other things all of which creates another dependency to the logic already handled from the hook_preprocess_page(). In this post, we cover how to accomplish the same thing from Page scope(hook_preprocess_page) to force rebuild …

Continue reading →

Rendering Page Programmatically To Create Permanent URLs like /shop, /gallery

In this post, we cover how to render a page programmatically in a context of practical need to have a permanent generic URLs for pages such us ‘Shop’(i.e. /shop), ‘Gallery’(i.e./gallery) etc. One may argue that by creating these permanent generic URLs you are limiting others because those URLs are not available unless the module implementing them is disable, however. We believe permanent URLs can help people get up Drupal Site for the first time much …

Continue reading →

Setting Up and Managing Multiple SSH Accounts for Drush on Mac

It may be the case, you have multiple ssh connections some for github accounts and some for one or more virtual boxes for Drupal sites. In this post, we cover how to generate, configure and manage multiple SSH accounts for drush. In addition, we go over how to overcome the error ‘ssh-copy-id: command not found ‘ that happens for Mac machines when trying to setup ssh keys via drush command ‘pushkey’ Generating Public/Private SSH Key …

Continue reading →

Breadcrumbs in Drupal

In this post, we go over manipulating the structure while altering the presentation of breadcrumbs in Drupal Framework When the task is to update breadcrumbs in Drupal, we try to separate the task into two sub-tasks: Manipulating Breadcrumbs Structure Altering Breadcrumbs Presentation Manipulate Breadcrumbs Structure We have found that the best way to manipulate breadcrumbs structure is in the page preprocessor function(in template.php file). Lets, say we need to insert additional item in the breadcrumbs …

Continue reading →

WYSIWYG with CKEditor in Drupal

It appears that CKEditor is the most advance and aesthetic WYSIWYG editor available for Drupal. As of February 2014, we run into issues installing the CKEditor as regular way WYSIWYG editors are installed in Drupal. Here are steps summarized 1. Enable WYSIWYG [wysiwyg] editors To enable WYSIWYG editors in Drupal, install and enable wysiwyg module With drush: 2. Install Editor of your choice Once module wysiwyg installed, then got to ‘admin/config/content/wysiwyg’ to see all the …

Continue reading →

Forms In Drupal Overview

In this post, we cover Form API of Drupal including form creation, validation and submission. Creating Form There is essentially two ways with slight variation on how the form is declared and initiated. a)Simple Form Have a module with the moduleName.module containing the following: The input_menu() function defines the page the end point of ‘fruit/simple’ where the form is going to be rendered (see more on Menu Sys in Drupal at post Add And Manipulate …

Continue reading →