Python, PHP, NodeJS, Perl and Ruby in ASP.NET CMS!
Tags: python, php, node, perl
Published: 2023-09-10 15:56:53

If we make the architecture the basis of comparison, [Elanat](https://elanat.net) is currently the most powerful CMS compared to all open-source or paid CMS. The unique add-on-oriented architecture in Elanat allows you to create add-ons for Elanat with all programming languages.

[Elanat](https://github.com/elanatframework/Elanat) is built under ASP.NET Core and uses the powerful [CodeBehind framework](https://github.com/elanatframework/Code_behind); programming in this framework is very simple; the structure of the CodeBehind framework is very close to the frameworks of common scripting languages, and scripting language programmers can write code under ASP.NET Core by using this framework; also, it is very easy to create an ASP.NET Core add-on for Elanat, and scripting language programmers will soon be able to use Elanat and create their own add-ons under ASP.NET Core or other scripting languages.

By default, Elanat uses the py, php, pl, and rb extensions to support Python, PHP, Perl, and Ruby, and the njs extension is used to support NodeJS.

Scripting languages in Elanat are only supported on Windows operating system. Linux support may be added in the future.

In this article, we will explain to you how to create an add-on for Python and PHP programming languages (of course, explaining one of these things was enough). Other programming languages such as NodeJS, Perl and Ruby are also the same and only the coding will be different!

## How to Create Python add-on in Elanat?

![Python in Elanat](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2vv9przvvx4v8wtmff9h.png)

**Step 1:** 
Add Python package from below link in Elanat patch component.
[https://elanat.net/content/29/Python Package Windows.html](https://elanat.net/content/29/Python%20Package%20Windows.html)

Note : Elanat also supports file path and just copy the download link and no need to download.

![Elanat Python package patch](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ek2lnffdmxi5ln4c4ta3.png)

**Step 2:** Write your programming code in Python programming language in a file and save it with py extension.

```python
a = "Hello world!";
b = "Elanat created by ASP.NET";
c = "Create Python add-ons in Elanat!";

print(a + "<br>");
print(b + "<br>");
print(c);
```

**Step 3:** Add the Python file in the page component.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0pc8gl7q37kst5o7zh0h.png)

Note: There are eight types of add-ons in Elanat, excluding templates, styles, language packs and other items. Page in Elanat is a type of add-on. You can add a file with a non-zip extension only in the page add-on and the plugin add-on. If your add-on needs more files, you should download the raw zip file of the same plugin model and replace the values.

You can refer to the following article:
[https://elanat.net/content/2/How create plugin add-on in Elanat framework.html](https://elanat.net/content/2/How%20create%20plugin%20add-on%20in%20Elanat%20framework.html)

Add-on raw file in Elanat download center page:
[https://elanat.net/page_content/download_center](https://elanat.net/page_content/download_center)

**Step 4:** View it!

![View it](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r211i69rssmirg7exax8.png)

## How to Create PHP add-on in Elanat?

![PHP in Elanat](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dvs7j79n7kkktefikezi.png)

**Step 1:** 
Add PHP package from below link in Elanat patch component.
[https://elanat.net/content/25/PHP Package Windows.html](https://elanat.net/content/25/PHP%20Package%20Windows.html)

Note : Elanat also supports file path and just copy the download link and no need to download.

![Elanat PHP package patch](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tn5k4mki44th6lwa0weg.png)

**Step 2:** Write your programming code in PHP programming language in a file and save it with php extension.

```php
<?php
$a = "Hello world!";
$b = "Elanat created by ASP.NET";
$c = "Create PHP add-ons in Elanat!";

echo $a . "<br>";
echo $b . "<br>";
echo $c;
?>
```

**Step 3:** Add the PHP file in the page component.

![PHP file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/17fqfxoeb20vfw2x9i12.png)

**Step 4:** View it!

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zbry3vfto9gbqr7yhyb3.png)

## Access to query string and form data will be as follows:

**python**
```python
import sys
print(sys.argv[1]) # QueryString
print(sys.argv[2]) # FormData
```

[https://elanat.net/content/29/Python Package Windows.html](https://elanat.net/content/29/Python%20Package%20Windows.html)

**PHP**
```php
<?php
echo $argv[1]; // QueryString
echo $argv[2]; // FormData
?>
```

PHP Package download link:
[https://elanat.net/content/25/PHP Package Windows.html](https://elanat.net/content/25/PHP%20Package%20Windows.html)

**NodeJS**
```javascript
console.log(process.argv[2]); // QueryString
console.log(process.argv[3]); // FormData
```

NodeJS Package download link:
[https://elanat.net/content/26/Node.js Package Windows.html](https://elanat.net/content/26/Node.js%20Package%20Windows.html)

**Perl**
```perl
print @ARGV[0]; # QueryString
print @ARGV[1]; # FormData
```

Perl Package download link:
[https://elanat.net/content/27/Perl Package Windows.html](https://elanat.net/content/27/Perl%20Package%20Windows.html)

**Ruby**
```ruby
puts (ARGV[0]) # QueryString
puts (ARGV[1]) # FormData
```
Ruby Package download link:
[https://elanat.net/content/28/Ruby Package Windows.html](https://elanat.net/content/28/Ruby%20Package%20Windows.html)

The query string and form data are added as the following strings:
name1=value1,name2=value2,name3=value3...nameN=valueN

In the next versions of Elanat, this system will support session and cookie in addition to query string and form data.


Add-on raw file in GitHub:
[https://github.com/elanatframework/Elanat_add-ons/tree/elanat_framework/component/component_raw](https://github.com/elanatframework/Elanat_add-ons/tree/elanat_framework/component/component_raw)
[https://github.com/elanatframework/Elanat_add-ons/tree/elanat_framework/module/module_raw](https://github.com/elanatframework/Elanat_add-ons/tree/elanat_framework/module/module_raw)
[https://github.com/elanatframework/Elanat_add-ons/tree/elanat_framework/plugin/plugin_raw](https://github.com/elanatframework/Elanat_add-ons/tree/elanat_framework/plugin/plugin_raw)
[https://github.com/elanatframework/Elanat_add-ons/tree/elanat_framework/page/page_raw](https://github.com/elanatframework/Elanat_add-ons/tree/elanat_framework/page/page_raw)
[https://github.com/elanatframework/Elanat_add-ons/tree/elanat_framework/patch/patch_raw](https://github.com/elanatframework/Elanat_add-ons/tree/elanat_framework/patch/patch_raw)
[https://github.com/elanatframework/Elanat_add-ons/tree/elanat_framework/extra_helper/extra_helper_raw](https://github.com/elanatframework/Elanat_add-ons/tree/elanat_framework/extra_helper/extra_helper_raw)
[https://github.com/elanatframework/Elanat_add-ons/tree/elanat_framework/editor_template/editor_template_raw](https://github.com/elanatframework/Elanat_add-ons/tree/elanat_framework/editor_template/editor_template_raw)
[https://github.com/elanatframework/Elanat_add-ons/tree/elanat_framework/fetch/fetch_raw](https://github.com/elanatframework/Elanat_add-ons/tree/elanat_framework/fetch/fetch_raw)