I came across a situation in my recent project, where user roles other than admin have to access the admin pages. The default admin theme was not provided for the admin pages in which the user role is not admin.
Drupal has a module which allows us to add the admin theme to specific pages irrespective of the user role. Below are the steps which I followed to achieve this.
Drupal 7
Developments in machine learning have a great influence on the e-commerce sector. Online purchase is steadily on the rise, allowing companies to capture all kinds of data on the customer experience, including
Administration Menu Source module is used to display different menus based on the roles existing in the system. This module is only available in Drupal 7. We can install the module using the following steps :
Installation
Views query alter is used to edit the query in views that we created using Drupal. In cases where we cannot add fields in views, we can use hook_views_query_alter to change the query in views.
Have you ever found it difficult to access a private file within Drupal? Then read on.
To render a block, a few methods are used. One way to render is to use block_load() function. In order to render a block, the following syntax is used,
For one of my project, I have implemented the Chosen module to display a list of content in a select box with user-friendly option style. I used the following configurations:
In one of my works, I want to programmatically uncheck the checkbox option of 'Generate automatic URL alias' for a specific node editing form. For this, I have created the following form alter for the content type. I have added a custom after-build function for the necessary content type in the form alter.
When I planned to use media upload in CKeditor for uploading files to the site, I faced one problem, i.e. I could use only predefined image style as a preset to style my image. I wanted to use a custom preset to media upload. To achieve that we have to do some customization.
Add the following custom code in our custom module.
You can create your custom color box styles instead of using a plugin provided styles. For creating custom color box style go to /sites/all/modules/contrib/color box/styles copy any one of the folders. (You can find plain, default, and Stockholm syndrome styles there).Place the copied folder into your theme folder. Rename the folder with your custom name. Also, rename the CSS and js files.
In Drupal 7 we can upgrade a module in many ways but we fail on upgrade feeds excel module. The reason being the newer version of the module is entirely different from the old version folder structure and file naming. We can overcome this situation by uninstalling the older version and installing the new version. Sometimes we cannot uninstall the module due to the module dependency and data lock. We can achieve this manually using the following steps.
In Drupal 8, variable_set() and variable_get() is deprecated. The variables database table in Drupal 7 is now removed in Drupal 8, and is replaced with config table. We can create a variable while installing the module using MODULE.setting.yml and MODULE.schema.yml files.
Drupal has established itself as a solid platform for Educational websites. The fact that all Ivy League colleges have Drupal websites is proof enough of Drupal’s popularity as a great Content Management Framework to build educational websites. A recent study conducted by TheDropTimes find that 80% of Top 100 Universities use Drupal. Brown University, Columbia University, Cornell University, Dartmouth College, Harvard University, University of Pennsylvania, Princeton University and Yale University are the eight old and distinguished colleges in the north east of US are the highly sought after Ivy League colleges.
Most of the operations that are done when developing sites in Drupal deals with enabling and configuring modules that are to be saved for future use. This is most certain times a time consuming process. But what if we could automate these tasks by developing a deployment module. Let's find out how we could achieve this goal.
Fivestar module is a simple module that adds a "rating star" widget to the nodes. This module displays number of stars that you set; a click from a reader rates the page with that number. We can create custom widgets for changing the color of stars or for showing any other images instead of stars. For example, we can use symbols like a diamond, banana, flower etc.
One such feature used widely throughout the site is the use of popups for alerting users. Popups are nothing new to web development. In fact Drupal provides multiple tools to create popups including the more widely used Colorbox plugin. For this project we chose to go with Ctools modal popup as it provided more options than Colorbox. Read on to know how to implement popups using Ctools.
Follow the steps below to implement the pop-ups
Planning to create a Drupal website? Explore essential factors and considerations you should keep in mind before embarking on your Drupal web design journey. Ensure a successful project with our expert insights
Moving to Drupal 8 deserves careful consideration in the technical front,especially when it comes to migrating from an almost stable platform like Drupal 7. Having said that, considering the advantages of Drupal 8, it will likely be the best solution for your business.
Moving to Drupal 8 deserves careful consideration in the technical front,especially when it comes to migrating from an almost stable platform like Drupal 7. Having said that, considering the advantages of Drupal 8, it will likely be the best solution for your business.
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,