sample code

Ionic 2 components (Part 1)

Let's learn some of the useful components in ionic 2. "Action sheet" - Action sheets are nothing but a dialog in which the user can choose from a set of options. It is normally shown as a popup above the page. This action sheet contains an array of buttons with properties such as

Sample Code:

Creating a simple search page in Ionic 2 application

An ionic search bar can be created to bind to a model so that when ever there is any change in that element will emit an input change. (ionInput) attribute callback will be triggered. In this below example we are going to create a search page to list a list of topics that can be filtered using search bar

Add below code in .html file

Drupal 6: Database Select, Insert, Update and Delete Query with example

In Drupal system have its own query builder it will create a query on Drupal way and sent to the Database server. To run a Database query we have built our condition on a specific format. The function db_query() function helps us to achieve run database queries in Drupal 6. The below is the syntax and example using a different type of Database queries.

Drupal 7: CTools adding CSS to Modal window with example[ctools_add_css()]

In Drupal core the function drupal_add_css() help us to achieve adding CSS for a specific pages. The CTools modal popup will not support core drupal_add_css() functions. We have to use CTools functions for adding CSS files to modal window. The function ctools_add_css() will help to adding CSS files into modal popup windows. The function accepts filename, Module name and path for adding the CSS file.

Drupal 7: CTools adding JS to Modal window with example[ctools_add_js()]

In Drupal core the function drupal_add_js() help us to achieve adding JS for a specific pages. The CTools modal popup will not support core drupal_add_js() functions. We have to use CTools functions for adding JS files to modal window. The function ctools_add_js() will help to adding JS files into modal popup windows. The function accepts filename, Module name and path for adding the JS file.

Drupal 7: CTools Image button with Example [ctools_modal_image_button()]

The CTools not supporting normal l() function of Drupal, we need to use its own function for creating links and buttons. The below example will demonstrate about creating Image link button with an example. The function ctools_modal_image_button() used for creating image button by CTools.

Drupal 7: Programatically Creating CTools Buttons [ctools_ajax_text_button()]

The CTools plugin will not open with normal buttons and links. To open a page or form via CTools we need to use ctools buttons(ctools_ajax_text_button()). This ctools_ajax_text_button will create a link that contains the base class that help to pop up the pages.

Drupal 7: Adding Drupal set messages using PHP(drupal_set_message()) and Javascript:

In Drupal messages are printed using the PHP function drupal_set_messages(). This article will discuss the adding message to page through the PHP as well as Javascript. The normally the set message will create a div HTML wrapper for display the messages. Using the classes of the set message we can display the Error/Status/Warning message to the end users.

JQuery: Get/Load Element by ID (or) Clases with spaces - Sample code

In Jquery we allowed accessing the element by its class or ID. If we use the help of class means the '.'(dot) followed by class name will help us to access the information. If we use ID means, the '#'(hash) followed by ID name help us to load the element object. The below is the accessing element property.

Drupal 7: Commerce POS Accessing Order object

The Drupal Commerce Commerce POS module help us to achieve Point of Sale concept. The Drupal Commerce POS differs from normal commerce order. On Commerce POS they have implemented their own Order management rather than using Commerce Order. This has been achieved by its own interface and classes. On Completing each order, the order is again mapped to normal commerce order.