Drupal 8 is bringing in numerous enhancements and features which will support editors in creating content on a day-to-day basis. The newest version of Drupal is set to bring a sea change in the entire experience of Content Authoring.
[Drupal] How to retain the default values of step 1 form after successfully submitting the step 2 form of a two step form
To keep the default values of the step one form after successfully submitting the step 2 form, here is an easy way. Just pass the form state values of step 1 form as query parameters to the same page on submitting step 2 form. Set the default values of step 1 form as, first check whether the form_state value is set. If yes, set the default values of step 1 form fields with the form_state values. Else check the URL query parameters, whether this variable is set. If yes, then set the default value with that value.
It would be an understatement to say that the implementation of HTML 5 in Drupal 8 is much-awaited. The introduction of HTML 5 is a big step for the Drupal community, as nowadays, with the proliferation of new-age devices, websites are no longer viewed only on desktops but in mobile phones, smart phones, and tablets.
The web development world is buzzing with the news of the launch of Drupal 8, the world’s most loved CMS. With an amazing array of more than 200 new features and improvements, the upcoming release of Drupal 8 is sure to win hearts. Drupal 8, the latest version of Drupal slated for release this month, is touted to be a boon for API writer and application builders and of course, all those looking for a smoother mobile interface.
When you try to set up a local development environment from a drupal dump which includes just the code base and the database without the Drupal files folder you will run into the issue of missing files. Drupal would think that it still has all the files in the Drupal files folder and would create links / process images as usual. This would however lead to a lot of unexpected errors in a lot of unexpected places. If you really do not care about the content in these files and want to recreate the missing files here is how you do this.
We can use l() to add links in our Drupal pages. However, while using the output of drupal_get_destination() in the l() as link, it might end up in the wrong functionality. If the drupal_get_destination() returns a url with parameters involved, then using it directly in the l() would cause the link to redirect to the wrong page.
Here are the simple commands to reset the Drupal user/admin password without accessing the default administration page.
If you run into a Drupal 7 site with file system access and you would want to change the password of a user in the system programmatically, here is an easy way to do this.
This article explains how to replace tokens to webform, views, blocks and Drupal forms from the node body. The preg_replace function for replacing the tokens. The preg_replace function works in the same way as preg_match. preg_replace is used to search a regular expression and replace it.
The World Wide Web is getting cluttered with numerous brands and products. In this scenario, how will you get search engines to favour your Drupal website? Search engines are obsessed with quality content and so your “content” is ultimately going to decide how well your website gets ranked in search engine results. Drupal is the best and most efficient platform for you to easily create and manage your content.
This article covers to the How to integrate Single Page Site module in a Drupal website. Single page site is of one of the newest trends in web designing. It allows you to automatically create a single page from a menu. The single page module will render all contents from the configured menus and links.It will then override the menu links so that they refer to an anchor instead of a new page.
Before we discuss on how to to join multiple database tables using db_select in Drupal 7, let me tell you that we can add as many joins as we want and most methods such as, 'fields', 'conditions', joins etc. can be called multiple times. However, one thing may be worth mentioning is that the call to join() needs to be separate. It should not be "chained", meaning that one should use this,
Discover how to enhance your Drupal website's user experience with Readmore Js. Follow our step-by-step guide to easily install and configure this useful feature through your Drupal theme.
In this article lets checkout how to fetch tweet count for a Drupal website. For this purpose we are using the Count API of twitter. Compared to Facebook on fetching likes and share counts we will notice a little difference. Simplest way to acquire the tweet count is to send request to the below url:
We can display user's identity based on their properties other than username, including actual name, email address, or user ID using the module RealName .
In order to add a new theme template file (.tpl.php file), we need to implement hook_theme() in our Drupal 7 module. A theme template need to be specified in the hook_theme() function. They produce HTML and renders Drupal render array elements to the screen.
Technology has completely changed the way businesses were operated in the past. Now, marketers can make their products available to the customers at their finger tips at any place and time. About two decades ago, nobody could ever imagine that buying and selling would be carried out in such a seamless manner sans the brick and mortar retail outlets. All this has been possible only because of technological advancements. Technology is progressing in leaps and bounds, opening newer avenues for success.
Form API validation is a contributed module which allows us to write the validation rules in custom forms, without the use of hook_validate/form_validate function
To submit a Drupal form, suppose a registration form to Hubspot we need the following.
While using the D3 implementation in one of my project for collapsible tree, I used the following piece of codes to add dragging and zooming feature in the tree. At first I have downloaded the D3 JS and loaded to the page callback as specified in the D3 implementation notes.