DEV Community

Cover image for Fetch component VS Views module
elanatframework
elanatframework

Posted on

Fetch component VS Views module

In this tutorial, we present how to work with the fetch component of the Elanat framework.

More information about Elanat framework.
dev.to/elanatframework/elanat-framework-134d

Please, before reading this article, learn about the views module in Drupal, and then comment on the similarities or differences between the fetch component in the Elanat framework and the views module in Drupal.
www.drupal.org/docs/7/modules/views/what-are-views

The fetch component allows the user to extract database data and then combine it with HTML tags or other values and display these values in any part of the website he wants.

This component is very powerful and practical and does a lot of work.

For example:

  • Show avatars of online users
  • List of latest content by time
  • The list of the latest content based on the number of views
  • List of tags of the week
  • Create rss
  • Create a sitemap
  • Grant temporary access
  • Delete content after display
  • And many other things

Note:
You can simply call a series of sql commands (add, edit and delete) in the database with or without data display.

There are two ways to add a add-on in the fetch component; one is to create by writing a query and the other is to upload a fetch add-on.

Here we teach how to create a add-on in the fetch component by writing a query.

Step 1:
After logging in, enter the admin panel; then select the Add-ons system in the upper bar and after displaying the list of components, click on the fetch component and then click on the add button to open the space to add a new fetch.
Choose a name for your add-on in the fetch name field and then enter your query in the fetch sql query field and then click on the get sql query column button.

Fetch component tutorial add fetch 1

Step 2:
After completing the steps of step 1, you will see the list of selected columns in the sql query column section. Below, you can see the fetch box, which repeats the values of fetch list item with the value of $_asp item; It changes in the fetch box. In the fetch list item section, you can combine database variables with HTML tags.

Fetch component tutorial add fetch 2

Step 3:
Click on the fetch active and fetch public access show checkboxes to activate them; In the fetch menu section, you can select a part of the website where you would like your fetch add-on to appear. Then click on the add fetch button.

Now you can see the result.

Fetch component tutorial view it

Note:
You can add the fetch add-on variable in any part of a page add-on so that the fetch add-on is displayed on that page. For this, you must activate the checkbox called page use fetch on that page.

The fetch add-on variable is written as follows:
$_fetch_name example;
The fetch name example value is your fetch name.

Questions:

  • Do you think beginners can use fetch component in Elanat?
  • Are professionals more comfortable with the Elanat fetch component or the views module in Drupal?
  • Does the Drupal views module, like the fetch component in Elanat, have the ability to access all the database data and display the database data as desired?
  • Does the Drupal views module, like the fetch component in Elanat, have the ability to edit and delete from the database in addition to displaying information?

Top comments (0)