Posts

Showing posts with the label Drupal

Drupal 8 Architecture Overview

Image
What is Drupal? Drupal is the most powerful CMS and open source in the market. It is built on top of PHP. Competitors are Joomla and Wordpress on open source. When it comes to paid resources on the content management systems, a couple of other high traffic CMS available in the market like Sitefinity, Sitecore, and Sharepoint. There are few other advantages over drupal like vast community, open-source, serving a long period in the market and provided different solutions for respective domains. On community support get benefits out on the following areas on the development. Documentation Translations Testing Development including theming and contribution modules Drupal community assembles the different experts in a common forum on drupal.org How Drupal 8 different from Drupal 7? Drupal 7 Drupal 8 It is built on top of core PHP It is built on top of Symfony Framework Templates are built on PHP template files Templates are built on

Drupal 8 Media Library with SVG upload

Image
Uploading the media content and maintaining together with reusability was one of the challenges in earlier versions of drupal. Media Library has been included in the Drupal core. It has a better user experience including multiple media types that can be customized based on development requirements. Media Library is a media management tool that enables you to find media that exists in your site and to add new media items. It allows you to search, sort, and create media items with a customizable interface. It can be used to add media items to an entity reference field or embed media into your content via a text editor. To use the media library luxury, Throughout the site we should use the media field. It will help us to collect the media elements as a single point and will be provisioned for us to reuse using the media library. Media type management will be maintaining the list of media types being supported by the media field. We can add the new media type thro

Drupal Content Workflow

Image
In CMS world maintaining the content workflow is very important. When the content editor is updating the content to the page, it always requires review and approval by the content manager. This workflow will define the way, how the content will be published to the end-user on the site. Drupal 8 has a core module to support content authorization workflow. But it doesn’t have the ability to provide the interface to customize the own workflow depending on different organizations. That will be achieved by contribution module called Workflow This will help you establish the transition state between different content types and roles. But the known disadvantage on this module, will not able to edit the published content (Current published state content)

Drupal 8 aggregator workflow

Image
Drupal aggregation has 2 different elements that are compressing the content on temporary files. JS CSS Whenever we are enabling the aggregation in drupal. It will create a file in /sites/default/files/css  and /sites/default/files/js folder with file contents. This file name will be stored in a cache table called “cache_data”. If you delete any one of the files, it will keep on cache content and will try to find the JS and CSS from this table. If you opted for the drupal aggregation, make below steps are followed as drupal administrator Keep ready all JS and CSS files in the themes folder (themes/themesname/css and themes/themesname/js) Clear the cache (Configuration > Performance) Activate the aggregation in drupal CMS (Configuration > Performance) After activated the above steps, you can find the compressed files on sites/default/files/css and sites/default/files/js folder.  Execute the below query in mysql DB, to find the list of aggregation entrie

Creating content type tpl file in drupal 7

In Drupal 7, Page.tpl.php will be the default template file for whole site. In top of this, we can customize our template for different content type, individual nodes and front pages. Even we can customize the block template and views templates. In this blog post, i am going to give you small snippet of code for creating template file depends on content type. To create a template file for content type, First step we need to define in template.php file on hook_preprocess_page method. After included in template.php we need to copy the page.tpl.php. Paste in same folder, rename it according to you content type. For example:- My content type name is reviews. My file name should be page--reviews.tpl.php In this file, you can customize your design.

Get node content using node_view and node_load in drupal 7

Drupal 7 has vast functions to manipulate node and its content. Here i have gave you the piece of code to get node content using node id.

Call content type form in custom module with Drupal 7

Here we have realtime syntax to call content type form in drupal 7. It will allow you to call add form of particular content type. To use this code, please add some custom module with menu hook. For menu hook, Have the callback function with below code. You will get the form to submit your values.

Enable default token values in drupal 7

To enable the default token to be display in the drupal site. We have to install separate module to do the same. This module will allow the content type field to enable and replace with particular token. You download the module here . Steps to install Download the module from this location and extract it. Extract folder should be placed in /sites/all/modules folder. Then, Login as administrator in site. In admin menu, Please click on module menu. In the list modules, You will able to see the "Field default token" . Please check the checkbox, which is row of same module. Then, scroll down and click "Save Configurations" . Now, you module will start to work on the same. Please give some default token in text field of content type and check.

Create a block using custom module in drupal 7

In this post, we will discuss about creating block using custom module in drupal 7. The main benefit of build a block using custom module is connectable module. This code will act as separate connectable component. In Drupal 6, there is only one hook used for all block operations but now in Drupal 7 there are different functions for different operations of the blocks. This are the hook method provided by drupal 7 for build a block. hook_block_info() hook_block_configure() hook_block_save() hook_block_view() hook_block_list_alter() hook_block_view_alter() hook_block_info_alter() hook_block_view_MODULE_DELTA_alter() Here we will discuss through different steps. Step : 1 We need to create a directory in this path "sites/all/modules". i.e you need to create a new module folder inside drupal directory. Directory name must under-stable and meaningful related to your module purpose. I will named as "customblockmodule" for module directory. We should have thi